Algorithmics (ºtºâªk) 2020

Lecturer: ¦¿®¶·ç
Teaching Assistants (TAs): ³¯¾Ç­P §õ¨ÎÀM ¹ù«Ø³Í ³¯ªu§Ê
Time: ¶g¤G 14:00~16:50
Place:
¶g¤G ¤u¤­À]E6-A207
TA Class:  ¶g¤G 13:00~13:50 (¤u¤­À]E6-A207)
Online Video: https://www.twitch.tv/acanlab

Offline Video: https://drive.google.com/folderview?id=1WsZopoti_c_7gKfFHerIk5iflLGsQc4_
Scoring¡G
Textbooks:
Reference Books:
Programming:
  • ¦w¸Ë½Òµ{¬ÛÃö³nÅé¤Î­ì©lµ{¦¡½X: Jeep7 (for JAVA platform on Windows)
  • 1 ¦w¸ËJava Development Kit (JDK): http://java.sun.com/javase/downloads/index.jsp
    2 ¦w¸ËMinGW C++ Compiler (G++): http://prdownloads.sf.net/mingw/MinGW-3.0.0-1.exe?download
    3 ¦w¸Ë³Ì·sPython 3 Interpreter: https://www.anaconda.com/
    4 ¦w¸ËJeep7(Java editor for every programmers v7.0) (¤U¸ü: Jeep7Setup&SourceCode.exe) (¨¾¬r³nÅé·|»~§P¬°¤£¦w¥þ³nÅé¡A¦ý«OÃÒ¦w¥þ¡A½Ð¦w¤ß¨Ï¥Î¡C)
    5 ³]©w¸ô®|°Ñ¼Æ: ª`·N¡A³o·|¦]¬°§A¦w¸Ë¤W¦C¤£¦P³nÅ骺¤£¦Pª©¥»¦Ó¤£¦P¡A¤]·|¦]¬°§A¦w¸Ëªº§@·~¨t²Îª©¥»¤£¦P¦Ó¤£¦P¡C¥H¤U¬°°w¹ïWindows§@·~¨t²Îªº³]©w:

    ¿ï¾Ü [±±¨î¥x][¨t²Î¤Î¦w¥þ©Ê][¨t²Î][¶i¶¥¨t²Î³]©w][Àô¹ÒÅܼÆ]¡A§ä¥X[path]Åܼƨëö¤U[½s¿è]¡A¨Ã¦b¨äÅܼƭȥ½ºÝ¥[¤J¥H¤U¤º®e:


    ;JDK¦w¸Ë¥Ø ¿ý\bin;MinGW¦w¸Ë¥Ø¿ý\ bin;Python¦w¸Ë¥Ø¿ý;Jeep7¦w¸Ë¥Ø¿ý 
    (¨Ò¦p:   ;C:\Program Files\Java\jdk-9.0.4\bin;C:\MinGW\bin;C:\Users\yourname\Anaconda3;C:\Jeep7)


    6 ¤U¸ü½d¨Òµ{¦¡(Sample.c)(Sample.cpp)(Sample.java)(Sample.py)Àx ¦s©óC:\Jeep7¥Ø¿ý¤¤¡A«ö¤U®à­±Jeep7¹Ï¥Ü°õ¦æJeep7³nÅé¡A¨Ã¨Ï¥Î [¶}ÂÂÀÉ]¿ï¶µ¸ü¤J½d¨Òµ{¦¡¶i¦æ[½sĶ][°õ¦æ]¡C

  • ACM°ê»Ú¤j¾Ç¥Í µ{¦¡³]­p ÄvÁÉ (ACM International Collegiate Programming Contest, ACM-ICPC) (ACM-ICPC&EPC.ppt)
  • Syllabus:  
    A. »¡©úX=ABCBA»PY=BDCA¨â­Ó¦r¦êÂǥѰʺA³W¹ººt ºâªk¨D¥X³Ìªø¦@¦P¤l§Ç¦Cªº¹Lµ{¡C
    B. ³]­p¤@­Óºtºâªk¡A¥i¥H²£¥Í¤@­Óµ¹©w¶°¦XSªº©Ò¦³¥i¯à¤l¶°¦X¡C
    C. ³]­p¤@­Óºtºâªk¡A¥i¥H¿é¤Jªø«×¬°mªº§Ç¦CX
    ¤Îªø «×¬°nªº§Ç¦CY¡A¿é¥Xtrue©Î¬Ofalse¡A¤À§O ¥NªíX¬O©Î¤£¬OYªº¤l§Ç¦C¡C
    D. µ¹©w¤@­Ó0/1­I¥]°ÝÃD¦p¤U¡F­I¥]²ü­«W=12¡A¥B4­Óª««~¨ä­«¶q¦U¬°6¡B4¡B5¡B3¡A¨ä»ù­È¦U¬°20¡B30¡B40¡B10¡A»¡©ú
    ÂǥѰʺA³W¹ººtºâªk ¸Ñ¨M¦¹0/1­I¥]°ÝÃDªº¹Lµ{¡C
    E. ¥H¤l¶°¦X¥[Á`°ÊºA³W¹ººtºâªk¸Ñ¨M¥H¤U¤l¶°¦X¥[Á`°ÝÃD: µ¹©w¾ã¼Æ¶°¦XS={1, 2, 4, 7}¤Î¾ã¼Æc=10¡C
    F. ­×§ï¤l¶°¦X¥[Á`°ÊºA³W¹ººtºâªk¨Ï¨ä¶Ç¦^¥[Á`­È¬°cªº¤l¶°¦X­Y¦¹¤l¶°¦X¦s¦b¡F§_«h¶Ç¦^ªÅ¶°¦X¡C
    G. ¥OS = (-2, 1, -3, 4, -1, 2, 1, -5, 4), ¨Ï¥Î
    °ÊºA³W¹ººtºâªk¨D¥X³Ì¤j³sÄò«DªÅ¤l §Ç¦C©M¡C
    H. ³]­p
    ³Ì¤j³sÄò¥iªÅ¤l§Ç¦C©M°ÊºA³W¹ººtºâªk¡C
    µÛ¦Wªº³Ìµu¸ô®|ºtºâªk¥]¬A¡G
    (1) ¦h¶¥¹Ï³Ìµu¸ô®|ºtºâªk
    (¨Ï¥Î°ÊºA³W¹º¸ÑÃDµ¦²¤)
    (2) Dijkstraºtºâªk(¨Ï¥Î³g°ý¸ÑÃDµ¦²¤)
    (3) Bellman-Fordºtºâªk(¨Ï¥Î°ÊºA³W¹º¸ÑÃDµ¦²¤)
    (4) Floyd-Warshallºtºâªk(¨Ï¥Î°ÊºA³W¹º¸ÑÃDµ¦²¤)

    Homework 9:
    A. ¨Ï¥Î°ÊºA³W¹ººtºâªk¨D¥H¤U¦h¶¥¹Ïªº³Ìµu¸ô®|¡C
    MSG
    B. §Q¥ÎDijkstraºtºâªk¨D¥H¤U¹Ï(graph)³»ÂI4¨ì¦U³»ÂIªº³Ìµu¸ô®|(shortest path)¤Î¨ä¶ZÂ÷(¦¨¥»)¡C
    A
              graph
    C. ©Ó¤WÃD¡A§Q¥ÎDijkstraºtºâªk¨D³»ÂI1¨ì¦U³»ÂIªº³Ìµu¸ô®|(shortest path)¤Î¨ä¶ZÂ÷(¦¨¥»)¡C
    D. µe¹Ï»¡©ú§Q¥Î§Q¥ÎFloyd-Warshallºtºâªk¨D¥H¤U¹Ï(graph)¥þ¹ï³Ìµu¸ô®|(all-pair shortest path)¶ZÂ÷(¦¨¥»)(¦¹¹Ïªº±Ò©l¶ZÂ÷¯x°}¦p¤U¡A¥H¸g¹Lªº¤¤¶¡¸`ÂI¬°s, a, b, c, dªº¶¶§Ç¼g¥X¶ZÂ÷¯x°}ªº§ïÅܹLµ{¡C)
    (d->bªº¥[Åv¦b¹Ï§Î»Pªí®æ¤¤»~´Ó¬°¤£¤@­Pªº­È¡A¦P¾Ç¥i¥H±N¤§§ï¬°5©Î6Åý¹Ï§Î»Pªí®æ¤@­P«á¸ÑÃD³£ºâµª¹ï¡C)

     
    E. ¨D¥X¥H¤Uµ¹©w¹Ï(graph)ªºFloyd-Warshallºtºâªkªº±Ò©l«e¸`ÂI¯x°}(°}¦C)¡A¨Ã¨D¥X³Ì«áªº«e¸`ÂI¯x°}(°}¦C)¡C
    A graph
    G. °w¹ï¥H¤Uªºµ¹©w¹Ï¡A¦C¥XBellman-Ford³Ìµu¸ô®|ºtºâ ªk°õ¦æ¹Lµ{¡A »¡©úBellman -Ford³Ìµu¸ô®|ºtºâªk¦p¦óÀˬd¥X¤@µ¹©w¹Ï¨ã¦³­t´`Àô(negative-weight cycle)¡C

    Problem Set 11:
    A. ¥H¤Uªº±Ô­z¬O¹ïÁÙ¬O¿ù¡A¨Ã¸ÑÄÀ¹ï©Î¿ùªº­ì¦]:
    ­Y§Ú­Ì¯àÃÒ©ú¥ô¦ó¤@­Ó NPC°ÝÃDªº³ÌÃaª¬ªp°ÝÃD¤U¬É(worst case problem lower bound)¬O«ü¼Æ¨ç¼Æ¶q¯Å¡A«h§Ú­Ì¤w¸gÃÒ©ú NP¤£µ¥©óP¡C
    B. ¥H¤Uªº±Ô­z¬O¹ïÁÙ¬O¿ù¡A¨Ã¸ÑÄÀ¹ï©Î¿ùªº­ì¦]:
    ­Y§Ú­Ì¯àÃÒ©ú¥ô¦ó¤@­Ó NPC°ÝÃDªº³ÌÃaª¬ªp°ÝÃD¤U¬É(worst case problem lower bound)¬O¦h¶µ¦¡¨ç¼Æ¶q¯Å¡A«h§Ú­Ì¤w¸gÃÒ©ú NPµ¥©óP¡C
    C. ¥H¤Uªº±Ô­z¬O¹ïÁÙ¬O¿ù¡A¨Ã¸ÑÄÀ¹ï©Î¿ùªº­ì¦]:
    ­Y§Ú­Ì¯àª½§ä¨ì¤@­Ó½T©w©Êºtºâªk¡A¦b³Ì®tª¬ªp¤U¥H¦h¶µ¦¡®É¶¡½ÆÂø«×¸Ñ¨M¤@­ÓNPC°ÝÃD¡A«h§Ú­Ì¤w¸gÃÒ©úNPµ¥©óP¡C
    D. ¥H¤Uªº±Ô­z¬O¹ïÁÙ¬O¿ù¡A¨Ã¸ÑÄÀ¹ï©Î¿ùªº­ì¦]:
    ¤H­Ì¤w¸gÃÒ©ú: ¨S¦³¥ô¦ó½T©wºtºâªk(deterministic algorithm)¥i¥H¦b³Ì®tª¬ªp(worst case)¤U¡A¥H¦h¶µ¦¡®É¶¡½ÆÂø«×¸Ñ¨MNPC°ÝÃD¡C
    E. ¥H¤Uªº±Ô­z¬O¹ïÁÙ¬O¿ù¡A¨Ã¸ÑÄÀ¹ï©Î¿ùªº­ì¦]:
    ¤H­Ì¤w¸gÃÒ©ú: ¨S¦³¥ô¦ó½T©wºtºâªk(deterministic algorithm)¥i¥H¦b³Ì®tª¬ªp(worst case)¤U¡A¥H¦h¶µ¦¡®É¶¡½ÆÂø«×¸Ñ¨MNP-hard°ÝÃD¡C
    F. ¥H¤Uªº±Ô­z¬O¹ïÁÙ¬O¿ù¡A¨Ã¸ÑÄÀ¹ï©Î¿ùªº­ì¦]:
    ¥ô¦óNPC°ÝÃD¥i¥Hpolynomially reduces to¥t¤@­ÓNPC°ÝÃD¡C
    G. ÃÒ©ú¤ä°t¶°°ÝÃD(dominating set problem)¬°NP°ÝÃD¡CÃÒ©ú¤ä°t¶°°ÝÃD(dominating set problem)¬°NP°ÝÃD¡C
    H. ÃÒ©úÂIÂл\°ÝÃD(vertex cover problem)¬°NP°ÝÃD¡C
    I. ÃÒ©ú¶°¹Î°ÝÃD(clique problem)¬°NP°ÝÃD¡C
    J. ÃÒ©úµÛ¦â°ÝÃD(chromatic coloring problem)¬°NP°ÝÃD¡C
    K. ÃÒ©ú0/1 ­I¥]°ÝÃD(0/1 knapsack problem)¬°NP°ÝÃD¡C
    L. ÃÒ©ú3-º¡¨¬°ÝÃD(3-SAT problem)¬°NP°ÝÃD¡C
    M. ÃÒ©ú³Ì¤j³Î°ÝÃD(Max cut problem)¬°NP°ÝÃD¡C
    N. ÃÒ©ú¥v©Z·S¾ð°ÝÃD(Steiner tree problem)¬°NP°ÝÃD¡C
    O. ÃÒ©ú¹º¤À°ÝÃD(partition problem)¬°NP°ÝÃD¡C
    P. ÃÒ©úÀ»¤¤¶°¦X°ÝÃD(hitting set problem)¬°NP°ÝÃD¡C
    Q. ÃÒ©ú¤Tºû¤Ç°t°ÝÃD(3-dimensional matching problem)¬°NP°ÝÃD¡C

    Links¡G

    Back to My Home