Lecturer: ¦¿®¶·ç
Teaching Assistants (TAs):
³¯«ä¿« ¦¶«TÞ³ ªL«Û§Ê ³¯¯§Åï
Time: ¶g¤G 14:00~16:50
Place: ¶g¤G ±Ð¬ã¤j¼Ó TR A203
TA Class:
¶g¤G 13:00~13:50
(±Ð¬ã¤j¼Ó TR A203)
Video List: Link
½Ð¤j®a¥ýÆ[¬Ý¥h¦~ªº½Òµ{¤¶²Ð¼v¤ù:
https://youtu.be/pLTIKYN2DUg
*¥[¿ï½Ð·V«ä¡A¦]¬°¨C¶g¤â¼g§@·~6-10ÃD¡A¥ô¿ï¤GÃD§@µª¡F¨C¶g½u
¤Wµ{¦¡§@·~3ÃD¡A¦Ü¤Ö§¹¦¨¤@ÃD¡F¨C¶g§U±Ð½Òµ{¤À²Õ³ø§i¤@¤p®É¡A»Ý¤W¶Ç§@·~¸ÑÃD§ë¼v¤ù¡C
*«Øij¥i¥H±Ä¥Î¥ý¬Ý²ßÃD¡AµM«á¦A¨ì¼v¤ù¤¤¾Ç·|¸Ñ¨M°ÝÃD§Þ³Nªº¤è¦¡¾Ç²ß¡A®ÄªG¸û¨Î!
Scope:
- Many Classical Algorithms
- Several Machine Learning/Deep Learning Algorithms
- Few Quantum Algorithms (2021·s¼W)
Scoring¡G
- ´Á¤¤¦Ò(¤ÀªR»P³]p·§©À)(25%)
- ´Á¥½¦Ò(¤ÀªR»P³]p·§©À)(30%)
- µ{¦¡³]p§@·~¡B³ø§i¡B½Òµ{°Ñ»P«×¤Îµ{¦¡³]pÄvÁɦ¨ÁZ(45%)
- 6/15-6/22
Final Examination
(®É¶¡: 6/15 20:00-6/22 12:00)
¿ï¾Ü5Óºtºâªk¤¤¦Ü¤Ö2Ó¶i¦æ¹ê§@¤W¶Ç¦ÜOnline
Judge(¦ûÁ`¤À14%)¡A¨ä¤¤1Óºtºâªk»Ýn¼¶¼g³ø§i¡A¸Ô²Ó»¡©úºtºâªk¨CÓ¨BÆJªº¹ê§@¹Lµ{¡A®Ñ±³ø§i¥Hdocx©ÎpdfÀɮ׮榡ú¥æ(¦ûÁ`¤À
8%)¡C¹ê§@ªººtºâªk©ó6/15±ß¤W20:00¤½§i¡Aµ{¦¡¤W¶Ç»P³ø§iú¥æºI¤î´Á¬Ò¬°6/22¤¤¤È12:00¡C
- My Book's Manuscript -- New Quantum
Algorithm Chapter: AlgBook-2021-0617.zip
(updated
2021/06/17)(06/17¦Ò¶q°É»~¶µ¥Ø¡F06/15·s¼W
Quantum Algorithm¤º®e)(¦¹·s³¹¸`¤º®e
°É»~¥[¤À«ùÄò¤¤...¡A
¦CÁ|°É»~½Ð¦C¥»ª©¥»¤é´Á¤Î¶½X¨Ã½Ð¥ý¬d²M¬O§_¤w¦³¥L¤H¦CÁ|¹L¡C:)
- Term Report (¦ûÁ`¤À 8%): Due Day: 06/29
20:00:
½Ð¬Ý§¹¤W¦C±Ð¬ì®Ñ¤¤¦³Ãö¶q¤lºtºâªkªº·s³¹¸`¡A°w¹ï¥H¤U¥DÃD¤§¤@(¿ïA©ÎB¡A¦h¼g¤£¥[¤À)¼¶¼g3-5¶ªº´Á¥½³ø§i¡AY
¦³¤Þzn¼Ðµù¨Ãµù©ú¥X³B¡A¥H§K³Q»{©w¬°³ø§i§Ûŧ :
A. ¶q¤lµ{¦¡»y¨¥(¿ï¾Ü¥H¤U»y¨¥¤§¤@¡A¦pQVM¡BQCL¡BQ#¡BQ|SI>¡BQ
language¡BqGCL¡BQMASM¡BScaffold¡BSilq¡BLIQUi|>¡BQuipper¡BfunQ©Î¨ä¥L»y¨¥)
B.
¶q¤lpºâ©ó¤£¦P»â°ì¤§À³¥Î(¿ï¾Ü¥H¤UÀ³¥Î¤§¤@¡A¦pºô¸ô¦w¥þ¡BÃĪ«¶}µo¡Bª÷¿Ä«Ø¼Ò¡B¥æ³q³Ì¨Î¤Æ¡B¤Ñ®ð¹w³ø¡B®ðÔÅܾE¡B¶q¤l¾÷¾¹¾Ç²ß©Î¨ä¥LÀ³¥Î)
- Term Project Due Day: 06/29
20:00
Textbooks:
- My Book's Manuscript: AlgBook-2021-0426.zip (updated
2021/04/26)(²Ä8³¹¤§«áÁÙ¦b½sפ¤¡A½Ð¥ý¤£n¶i¦æ°É»~)(04/26
¥Dn·s¼W²Ä8³¹µ²»y»P×¥¿²Ä8³¹³¡¥÷¿ù»~)(04/20
¥Dn¥]§t©Ò¦³°É»~×¥¿¥H¤Îקﬡ°Ê¿ï¾Üºtºâªk¤Î¨ä®É¶¡½ÆÂø«×¤ÀªR)(04/15
¥Dn×¥¿²Äk¤p¤¸¯À(¤¤¦ì¼Æ)selection alg.¿ù»~¡A
קïheap sort alg.»¡©ú¤ÎHuffman
coding alg.»PDijkstra alg.¦³Ãö¨Ï¥Îheap-based priority
queueªº»¡©ú¡F04/13קï®Ñ¦W¡A¼W¥[²Ä0³¹¡A¦@¦³0~14³¹§t3ªþ¿ý¡A ³¹¦W¥[ µù**¥Nªí©|¦b½s¿è¤¤)(±Ð¬ì®Ñ°É»~¥[¤À«ùÄò¤¤...¡A
¦CÁ|°É»~½Ð¦Cª©¥»¤é´Á¤Î¶½X¨Ã½Ð¥ý¬d²M¬O§_¤w¦³¥L¤H¦CÁ|¹L¡C:)
- R.C.T. Lee et. al., Introduction to the Design and Analysis
of Algorithms -- A Strategic Approach (2/e), McGraw Hill,
2005.
- Thomas Cormen, Charles
Leiserson, Ronald Rivest and Clifford Stein, Introduction to Algorithms (3/e),
MIT Press, 2009.
Reference Books:
- ±i¤¸µ¾, ¶q¤l¹q¸£»P¶q¤lpºâ, ùÖ®p, 2020.
- ³¯«Ø§»(Ķ), ¶q¤lpºâ¹ê¾Ô, ùÖ®p, 2020.
- ªL¤j¶Q, TensorFlow + Keras ²`«×¾Ç²ß¤H¤u´¼¼z¹ê°ÈÀ³¥Î, ³ÕºÓ¤å¤Æ, 2017.
- »ôÃñd¼Ý, Deep Learning -- ¥ÎPython¶i¦æ²`«×¾Ç²ßªº°ò¦²z½×¹ê§@, O'REILLY, (§d¹ÅªÚ
Ķ, ùÖ®p¸ê°T¥Xª©), 2017.
- Algorithm Design: Foundations, Analysis, and Internet
Examples, Michael T. Goodrich, Roberto Tamassia, Wiley, 2002.
(¦³¤¤Ä¶¥»)
- Computer Algorithms, Ellis Horowitz et. al., Silicon Press,
2008.
-
¤¤¤åJavaµ{¦¡³]p (²Ä¤Tª©) SIM-908A , ¦¿®¶·ç µÛ, ¾§ªL¥Xª©ªÀ, 2006.
-
ª«¥ó¾É¦V¸ê®Æµ²ºc ¡X ¨Ï¥ÎJava»y¨¥, ¦¿®¶·ç µÛ, ªQ±^¹Ï®Ñ¤½¥q, 2005.
- Algorithms, S. Dasgupta, C. Papadimitriou and U. Vazirani,
McGraw Hill, 2008.
- Programming Challenges, Steven S. Skiena and Miguel Revilla,
Elsevier, 2003.
- The Algorithm Design Manual, Steven S. Skiena, Elsevier.
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:
- 1. »{ÃѺtºâªk -- ±q¹ÃШ찪¶¥µ{¦¡»y¨¥:
(AlgSmallTalk.pptx) (Alg-Intro.pptx) (CPSforIndustry4.0.zip) (ACM-ICPC&EPC.ppt)(CPSProject.zip)(3/2)
1. ºtºâªk¦WºÙªº¥Ñ¨Ó
2. ¤°»ò¬Oºtºâªk?
3. ºtºâªkªº¨Ò¤l
4. ¦p¦óªí¥Üºtºâªk?
5. ¦p¦ó¹ê§@ºtºâªk? (EuclidGCD.c)(EuclidGCD.cpp)(EucidCGDClass1.java)(EucidCGDClass.java)(EuclidGCD.py)
6. ºtºâªkªº¥¿½T©Ê
Homework1: (for 3/2; Due day:
before next class or TA's class)
(A)¨Ï¥ÎµêÀÀº¿(pseudo
code)¼g¤@Óºtºâªk¡A¿é¤J¤@Ó¾ã¼Æn(n>2)¨Ã¨Ã§PÂ_n¬O§_¬°½è¼Æ(prime)(Write an
algorithm using the pseudo code to input an integer n and
output (decide) if n is a prime.)
(B) ¨Ï¥ÎµêÀÀ º¿(pseudo
code)¼g¤@Óºtºâªk¡A¿é¤J¤@Ó¾ã¼Æn(n>2)¨Ã¿é¥X¤p©ónªº³Ì¤j¦]¼Æ(factor) (Write an
algorithm using the pseudo code to input an integer n and
output the n's largest factor that is less than n.)
(C) ¨Ï¥ÎµêÀÀ
º¿(pseudo code)¼g¤@Óºtºâªk¡A¿é¤J¤@Ó¾ã¼Æn(n>2)¨Ã¿é¥X©Ò¦³n°£¤F¥»¨¥H¥~ªº¥¿¦]¼Æ(factor)Á`©M
(Write an algorithm using the pseudo code to input an integer
n and output the total summation of all n's factors except n.)
(D) ¨Ï¥ÎµêÀÀº¿(pseudo
code)¼g¤@Óºtºâªk¡A¿é¤J¾ã¼Æn¤Îm(n>m>2)¡A¿é¥X©Ò¦³¤ñn¤p¨Ã¤j©ómªºnªº¦]¼Æ(factor)Á`©M¡AYµL
¦¹¦]¼Æ«h¿é¥X0 (Write an algorithm using the pseudo code to input
integers n and m, and output all n's factors larger than m and
less than n.)
(E) ¨Ï¥ÎµêÀÀº¿(pseudo code)¼g¤@Óºtºâªk¡A¿é¤J¤@Ó¾ã¼Æn(n>2)¨Ã§PÂ_n¬O§_¬°§¹¬ü¼Æ(perfect
number)¡C¤@Ó§¹¬ü¼Æ¬O¤@Ó¥¿¾ã¼Æ¡A¥¦©Ò¦³ªº¯u¦]¼Æ(§Y°£¤F¦Û¨¥H¥~ªº¦]¼Æ)ªº©M¡A«ê¦nµ¥©ó¥¦¥»¨¡C (Write an
algorithm using the pseudo code to input an integer n and
output (decide) if n is a perfect number. Note that a perfect
number is a positive integer that is equal to the sum of its
proper positive divisors, that is, the sum of its positive
divisors excluding the number itself.)
(F) ¨Ï¥ÎµêÀÀº¿(pseudo code)¼g ¤@Óºtºâªk¡A¿é¤J¤@Ó¾ã¼Æn(n>0)¨Ã§PÂ_n¬O§_¬°§Ö¼Ö¼Æ(happy
number) (Write an algorithm to input an integer n and output
(decide) if n is a happy number.)
µù:
§Ö¼Ö¼Æ¦³¥H¤Uªº¯S©Ê¡G¦bµ¹©wªº¶i¦ì¨î¤U¡A¸Ó¼Æ¦r©Ò¦³¼Æ¦ì(digits)ªº¥¤è©M¡A±o¨ìªº·s¼Æ¦A¦¸¨D©Ò¦³¼Æ¦ìªº¥¤è©M¡A¦p¦¹«½Æ¶i
¦æ¡A³Ì²×µ²ªG¥²¬°1¡C¨Ò ¦p¡A¥H¤Q¶i¦ì¬°¨Ò¡G
28 ¡÷ 22+82= 68 ¡÷ 62+82=100
¡÷
12+02+02=1¡A¦]¦¹28¬O§Ö¼Ö¼Æ
- 2. ºtºâªk½ÆÂø«×¤ÀªR½d¨Ò(¥H±Æ§Çºtºâªk¬°¨Ò)(Alg-Analysis.pptx)(3/9)
.1 ºtºâªkªº®Ä¯à
.2 ºtºâªkªº®É¶¡½ÆÂø«×
.3 ¤jOº¥¶i°O¸¹
.4 °§Cºtºâªk®É¶¡½ÆÂø«×¶q¯Å
.5 º¥¶i°O¸¹(asymptotical
notation): Big O, Big Omega, Theta
.6
¦h¶µ¦¡®É¶¡¡B«ü¼Æ®É¶¡¤Î°°¦h¶µ¦¡®É¶¡ºtºâªk
.7 ®ðªw±Æ§Ç(bubble sort)ºtºâªk
.8 ´¡¤J±Æ§Ç(insertion sort)ºtºâªk
Homework 2: (for 3/9; Due day:
before next class or TA's class)
(A) ¦b®ðªw±Æ§Ç(bubble
sort)ºtºâªk¤¤¡AY¦b¬Y¦^¦X¤¤§¹¥þ¨S¦³¥ô¦ó¸ê®Æ¹ï½Õ¡A«h¥i±À½×¸ê®Æ¤w¸g±Æ§Ç§¹¦¨¦Ó¥ß§Yµ²§ôºtºâªk°õ¦æ¡A³oºÙ¬°§ï¨}®ðªw±Æ§Ç(improved bubble sort)ºtºâªk¡C½Ð¥HµêÀÀ½X´yz¡u§ï
¨}®ðªw±Æ§Çºtºâªk¡v¡C(½Ðª`·N:¦b¦³¨Ç¤åÄm¤¤¡A©Ò¿×
¡u®ðªw±Æ§Çºtºâªk¡v¨ä¹ê«üªº¬O¡u§ï¨}®ðªw±Æ§Çºtºâ
ªk¡v)
(B) ¤ÀªR§ï¨}®ðªw±Æ§Çºtºâªk³Ì¨Î¡B³Ì®t»P¥§¡®É¶¡½ÆÂø«×
(C) ¨Ï¥ÎµêÀÀº¿(pseudo
code)¼g¤@Ӯɶ¡½ÆÂø«×¬°O(sqrt(n))ªººtºâªk¡A¿é¤J¤@Ó¾ã¼Æn(n>2)¨Ã¿é¥X©Ò¦³n°£¤F¥»¨¥H¥~ªº¥¿¦]¼Æ
(factor)Á`©M¡A§A¥²¶·¤ÀªRºtºâªkªº®É¶¡½ÆÂø«×¡C
(D) ¨Ï¥ÎµêÀÀº¿(pseudo
code)¼g¤@Ӯɶ¡½ÆÂø«×¬°O(sqrt(n))ªººtºâªk¡A¿é¤J¾ã¼Æn¤Îm(n>m>2)¡A¿é¥X©Ò¦³¤ñn¤p¨Ã¤j©ó
mªºnªº¦]¼Æ (factor)Á`©M¡AYµL¦¹¦]¼Æ«h¿é¥X0¡A¤ÀªRºtºâªkªº®É
¶¡»PªÅ¶¡½ÆÂø«×¡C
(E) ¨Ï¥ÎµêÀÀº¿(pseudo
code)¼g¤@Ӯɶ¡½ÆÂø«×¬°O(sqrt(n))ªººtºâªk¡A¿é¤J¤@Ó¾ã¼Æ(n>2)¨Ã§PÂ_n¬O§_¬°§¹¬ü¼Æ
(perfect number)¡A§A¥²¶·¤ÀªRºtºâªkªº³Ì®t¤Î³Ì¨Î®É¶¡½ÆÂø«×¡C
(F) ¨Ï¥ÎµêÀÀº¿(pseudo
code)¼g¤@Óºtºâªk¡A¥H¿é¤J¤@Ө㦳nÓ¤¸¯Àªº¶°¦XS¨Ã¿é¥XSªº幂¶°(pwoer
set)¡A§A¥²¶·¤ÀªRºtºâªkªº®É¶¡½ÆÂø«×¡C (Write an algorithm to input a set S of
n elements and output the power set of S. You must analyze
the time complexity of your algorithm.)
(G) ¤ÀªR¶O§B¯Ç¦è¼Æ¦Cºtºâªk»P»¼°j¶O§B¯Ç¦è¼Æ¦Cºtºâªk¤§ªÅ¶¡
½ÆÂø«×
**(H) ¨Ï
¥ÎµêÀÀ½X¼g¥X°ï¿n±Æ§Ç(heap sort)ºtºâªk¡A¤ÀªR¨ä®É¶¡»PªÅ¶¡½ÆÂø«× (heap
sort¤£¦C¤J¦Ò¸Õ½d³ò¡A ¦ý¬O¥H¤U¦C¤J¦Ò¸Õ½d³ò: ¥Hbinary
heap¹ê§@ªºpriority queueªºoperations¡A¥]¬A insert(p): Inserts
a new element with priority p; extractMax(): Extracts
an element with maximum priority; remove(i): Removes
an element pointed by an iterator i; changePriority(i,
p): Changes the priority of an element pointed by i to
p; ³£¨ã¦³O(log n)ªºtime complexity¡F¦ÓgetMax(): Returns an
element with maximum priority; «h¨ã¦³O(1) time
complexity¡C)
(I) µe¥Xn log n¡Bn log2 n¡Bn2¤În3¹Ï
§Î(for n=2, 4, 8, ..., 128)¨Ã¤ñ¸û¤§¡C(·s¼W)
(J) Y¤@ºtºâªkAªº®É¶¡½ÆÂø«×¬°6 x 2n=O(2n)¥i¥H¦bn=10ªº®ÉÔ¯Ó¶O¤@¤p®É¸Ñ¨M°ÝÃD
X¡A¦Ó¥t¤@ӸѨM°ÝÃDXªººtºâªkBªº®É¶¡½ÆÂø«×¬°5 x
n3 =
O(n3)¡A
«h½Ð°Ý·ín=10®Éºt
ºâªkBn¯Ó¶O¦h¤Ö®É¶¡§¹¦¨?(·s¼W)
(H) Y¤@ºtºâªkAªº®É¶¡½ÆÂø
«×¬°6 x 2n=O(2n)¥i
¥H¦bn=10ªº®ÉÔ¯Ó¶O¤@¤p®É¸Ñ¨M°ÝÃDX¡A¦Ó¥t¤@ӸѨM°Ý
ÃDXªººtºâªkBªº®É¶¡
½ÆÂø«×¬°5 x n3 =O(n3)¡A«h½Ð°Ý·ín¬°
¦óȮɺtºâªkBn¯Ó¶O¤@¤p®É¤~¥i¥H§¹
¦¨?(·s¼W)
- Term Project »¡©ú»P±Ð¾Ç (3/30)
(½Ð¦P¾Ç°È¥²§â´¤®É¶¡Æ[¬Ý¥Ñ§U±Ð¿ý»sªºTerm
Project±Ð¾Ç¼v¤ù¡A¾¨¦§¹¦¨¾÷¾¹¾Ç²ß/²`«×¾Ç²ßÀô¹Ò¦w¸Ë¡A¨Ã¶}©l¼¶¼gµ{¦¡¥H§¹¦¨Term Project)
ÃD¥Ø: ²`«×¾Ç²ß¤¤¤å¤â¼g¼Æ¦r¿ëÃÑ
¿é¤J: ¤¤¤å¤â¼g¼Æ¦r¸ê®Æ¶°(dataset)
¿é¥X: ¤¤¤å¤â¼g¼Æ¦r¿ëÃѷǽT²v(accuracy)
¦û¤À: Á`¦¨ÁZ20%
¥Øªº: Åý¾Ç¥Í½m²ß¨Ï¥Î²`«×¾Ç²ß(deep learning)¼Ò«¬¸Ñ¨M¤¤¤å¤â¼g¼Æ¦r¿ëÃÑ°ÝÃD¡C²`«×¾Ç²ß(deep learning)¼Ò«¬¥i¬°²`«×¯«¸gºô¸ô(deep neural network, DNN)¡B±²¿n¯«¸gºô¸ô(convolutional neural network, CNN)¡Bªøµu´Á°O¾Ð(long short-term memory, LSTM)¯«¸gºô¸ô©Î¹h±±»¼°j³æ¤¸(gated recurrent unit, GRU)¯«¸gºô¸ô¡C
¸ê®Æ¶°»¡©ú: (¸ê®Æ¶°¤U¸ü³sµ²)
¸ê®Æ¶°ÀÉ®×handwrite_detect.zip¬°¤¤¤å¤â¼g¼Æ¦r¸ê®Æ¶°¡A¥]§t¤F°V½m¸ê®Æ¶°(training dataset)»P´ú¸Õ¸ê®Æ¶°(test dataset)
°V½m¸ê®Æ¦@¦³2450µ§
´ú¸Õ¸ê®Æ¦@¦³1700µ§
µû¤À¶µ¥Ø»P³W½d:
Source code(.py)
A short report (.pdf) (§t¦³)
¤¤¤å¤â¼g¿ëÃѷǽT²v(accuracy)¡A¥HºI¹Ï¤è¦¡§e²{
Source code¤§³v¦æ¸ÑÄÀ
ú¥æ¤è¦¡: ½Ð±N©Ò¦³ÀÉ®×À£ÁY¦¨ .zip «á¡A¦A¤W¶Ç¦Ü e-class §@·~ú¥æ°Ï
(¤W¶ÇÀɦW:Term_Project_¾Ç¸¹_©m¦W.zip)
ú¥æ®É¶¡: ´Á¥½¦Ò©P¤§¤U¤@©P¤G 20:00«eºI¤î
³Æµù : ¤Á¤Å¤¬¬Û§Ûŧ¡AYµo²{§Ûŧ¡A«h¥H0¤Àpºâ
§ë¼v¤ù: https://drive.google.com/drive/folders/1OiRiTyf5xMbHxlUEg2LUbXT9Z9GqgLZu?usp=sharing
±Ð¾Ç¼v¤ù:
ºtºâªk½Òµ{_¾÷
¾¹¾Ç²ßÀô¹Ò¦w¸Ë¤§±Ð¾Ç¼v¤ù
ºtºâªk½Òµ{_Machine Learning_01_DNN
ºtºâªk½Òµ{_Machine Learning_02_CNN
ºtºâªk½Òµ{_Machine Learning_03_LSTM
ºtºâªk½Òµ{_Machine Learning_04_GRU
- 6. ³g°ýºtºâªk(greedy algorithm):
(Alg-Greedy.pptx) (4/13)
³g°ýºtºâªk(greedy
algorithm)¤@¨B¨B¦a«Øºc¥X¤@Ó°ÝÃDªº§¹¾ã¸Ñµª¡C¨ä¨C¤@¨B³£Âǥѳg°ý¸ÑÃDµ¦²¤(greed
strategy)¼W¥[¤@³¡¥÷ªº¸Ñµª¨ì§¹¾ã¸Ñµª¤¤¡C©Ò¿×³g°ý¸ÑÃDµ¦²¤¬°:
¨C¤@¦¸³£¿ï¾Ü·í¤U³Ì¦nªº³¡¥÷¸Ñµª¥[¤J§¹¾ã¸Ñµª¤¤¡C
.1 I¥]ºtºâªk(knapsack algorithm)
(±a¥X0/1I¥]°ÝÃD«á¥i¥H¦b¤§«áÁ¿±ÂNP-hard°ÝÃD)
.2 ¬¡°Ê¿ï¾Ü(activity
selection)ºtºâªk
.3 Huffman½s½X(Huffman coding)ºtºâªk
.4 Kruskal³Ì¤p¥Í¦¨¾ð(minimum spanning
tree, MST)ºtºâªk
.5 Prim³Ì¤p¥Í¦¨¾ð(minimum spanning
tree, MST)ºtºâªk
.6 Dijkstraºtºâªk
Homework 6:
(A) ¤@ÓI¥]®e¶q¬°
10¡A²{¦b¦³5Óª««~¡A «¶q¤À§O¬°4¡B3¡B6¡B2¡B5¡A»ù®æ¤À§O¬°10¡B9¡B
12¡B4¡B8¡A¨DI¥]¯à°÷¸Ë¤J¹s¸H(fractional)ª««~ªº³Ì¤j»ùȬ°¦ó?
(B) µ¹©w 5 Ó¬¡°Ê¡A¨ä¬¡°Ê°Ï¶¡¤À§O¬° [0,18), [3, 5), [4, 16), [2, 9), [10,
15)¡A½Ð´yz¦p¦ó¥H¬¡°Ê¿ï¾Üºtºâªk§ä¥X³Ì¦hªº¬Û®e¬¡°ÊÁ`¼Æm(¥²¶·¼g¥Xmªº¼ÆÈ)¡C
(C)
§Q¥ÎHuffman ½s ½Xºtºâªk´À¥H¤U¦r¤¸½s½XA(46%)¡B B(7%)¡BC
(28%)¡BD (19%)¡C(³Æµù:¬A¸¹¤¤¬°¦r¤¸¥X²{ÀW²v)
(D) §Q¥ÎKruskalºtºâªk¨D¥X¥H¤Uªº¹Ï(graph)ªº³Ì¤p¥Í¦¨¾ð (minimum spanning tree, MST)
(E) §Q¥ÎPrimºtºâªk¨D¥X¥H¤Wªº¹Ï(graph)ªº³Ì¤p¥Í¦¨¾ð (minimum spanning tree,
MST)
(F).
§Q¥ÎDijkstraºtºâªk¨D¥H¤U¹Ï(graph)³»ÂI4¨ì¦U³»ÂIªº³Ìµu¸ô®|(shortest
path)¤Î¨ä¶ZÂ÷(¦¨¥»)¡Cµù: »Ýn¼g¥X¨C¦¸¡¥N¨CÓ¸`ÂI¤§³Ì
µu¸ô®|§ó·sªº¹Lµ{¡C
(G).
©Ó¤WÃD¡A§Q¥ÎDijkstraºtºâªk¨D³»ÂI1¨ì¦U³»ÂIªº³Ìµu¸ô®|(shortest path)¤Î¨ä¶ZÂ÷(¦¨¥»)¡Cµù: »Ýn¼g¥X¨C¦¸¡¥N¨CÓ¸`ÂI¤§³Ì
µu¸ô®|§ó·sªº¹Lµ{¡C
- ´Á¤¤¦Ò: (®É
¶¡: 4/20 ¤U ¤È2:00-3:50)(½d³ò: ¤w±Â½Òªº³¡¥÷:±Ð¬ì®Ñ²Ä0³¹¨ì²Ä7³¹¡A¥[²Ä9³¹Dijkstra
alg.)(¦aÂI: ½ÐTA¥t¦æ¤½§G«ö·Ó®y¦ìªí¤J®y¡AÀ³¸Õ½ÐÀ¹¤f¸n)(§ë¼v¤ù§ó·s¸ûºC¡A¦]¦¹¼Ð·Çµª®×¥H¦¹ª©±Ð¬ì®Ñ¬°·Ç:
AlgBook-2021-0415.zip
)
(±Ð¬ì®Ñ°É»~¥[¤À«ùÄò¤¤...)
- ¤½§i:
5/12(¬P´Á¤T)14:00-15:50 ¶q¤lºtºâªk²¤¶ºtÁ¿ (¦aÂI: ¤u¤À] A207)
6/1(¬P´Á¤G) 14:00-17:00 ¶q¤l¹q¸£µ{¦¡³]p½Òµ{ (¦aÂI: ¹qºâ¤¤¤ß)(¦]¬°¬Ì±¡¨ú®ø)
7. °ÊºA³W¹º(dynamic programming)ºtºâªk: (Alg-DP.pptx) (4/27)
ºtºâªk½Òµ{_0427 Dynamic Programming_1
ºtºâªk½Òµ{_0427 longest common subsequence, LCS or LCSS_2
ºtºâªk½Òµ{_0427 Minimum Edit Cost, MEC_3
ºtºâªk½Òµ{_0427 0/1 knapsack dynamic programming algorithm_4
ºtºâªk½Òµ{_0427 Subset Sum dynamic programming algorithm_5
ºtºâªk½Òµ{_0427 maximum contiguous subsequence sum, MCSS Dynamic Programming algorithm_6
°ÊºA³W¹º(dynamic programming)ºtºâªkÄy¥Ñ±Nì°ÝÃD¤À¸Ñ¦¨¤@¨t¦C¤l°ÝÃD
(subproblems)¡A¨Ã¨Ì§Ç¸Ñ¨M¤l°ÝÃD¨Ó¸Ñ¨Mì°ÝÃD¡C¬°ÁקK¤@¦A¦a¸Ñ«½Æªº¤l°Ý
ÃD¡A¤@¥¹¸Ñ¥X¤l°ÝÃDªº¸Ñµª(solution)¡A§Y·|±N¨ä¦s¦bªí®æ(©Î°}¦C)¤¤¡C·í»Ýn¥Î¨ì¬Y¤@¤l°ÝÃDªº¸Ñµª®É¡A»P¨ä«·spºâ¨ä
¸Ñµª¡Aºtºâªk·|¨ú¦Ó¥N¤§¦a
±qªí®æ¤¤ª½±µ¨ú¥X¨ä¸Ñµª¥H¸`¬Ùpºâ®É¶¡¡A¬O¤@Ó¡u¥HªÅ¶¡´«¨ú®É¶¡¡vªººtºâªk¡C¤@ӰʺA³W¹ººtºâªk·|¥ý±q³Ì²³æªº¤l°ÝÃD¥ý¸Ñ°_¡A¨Ã
¥H¤@©wªºµ{§Ç«ùÄò¹B¦æª½¦Ü ¨D¥Xì°ÝÃD¸Ñµª¬°¤î¡C
³Ì¨Î¸Ñì«h(Principle of optimality):
°²³]¬°¤F¸Ñ¨M¤@Ó°ÝÃD¡A§ÚÌ¥²¶·§@¥X¤@¨t¦Cªº¨Mµ¦ D1, D2, ¡K,
Dn¡CY³o¤@¨t¦Cªº¨Mµ¦¬O³Ì¨Î¸Ñ¡A«h°w¹ï©ó«en-kÓ(©Î³Ì«án-kÓ)¨Mµ¦©Ò²£¥Íªºª¬ºA(¤l°ÝÃD)¦Ó¨¥¡A³Ì«áªºkÓ(©Î«ekÓ)¨M
µ¦(1<= k<=n)¥²©w¤]¬O³Ì¨Îªº¡C
*³Ìªø¦@¦P¤l§Ç¦C(longest common
subsequence, LCS or LCSS)ºtºâªk
*³Ì¤p½s¿è¦¨¥» (Minimum Edit Cost, MEC)ºtºâªk
*0/1I¥]°ÊºA³W¹ººtºâªk(0/1 knapsack dynamic programming
algorithm)
*¤l¶°¦X¥[Á`(subset sum)°ÊºA³W¹ººtºâªk
*(½Æ²ß)¦h¶µ¦¡¤Î°°¦h¶µ¦¡®É¶¡ºtºâªk
*³Ì¤j³sÄò¤l§Ç¦C©M(maximum contiguous subsequence sum, MCSS)°ÊºA³W¹ººtºâªk
Homework 7:
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/1I¥]°ÝÃD¦p¤U¡FI¥]²ü«W=12¡A¥B4Óª««~¨ä«¶q¦U¬°6¡B4¡B5¡B3¡A¨ä»ùȦU¬°20¡B30¡B40¡B10¡A»¡©úÂǥѰʺA³W¹ººtºâªk
¸Ñ¨M¦¹0/1I¥]°ÝÃ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¶°¦XY¦¹¤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
- 8.
(5/4)¾ð·j´M(tree
search)»P¦^·¹(backtracking)ºtºâªk: (TreeSearch.pptx)
(5/4)
Slides and Videos: (Alg4-1203(NoMark).pptx)
(§ó¥¿: §ë¼v¤ù²Ä36©M37¶ ¾ð²Ä¤T¼h¥kÃ䪺¤TÓ¸`ÂI¥Ñ¥ª¦Ó¥k¨Ì§Ç¬°"2' "4' "5") 5/4½Òµ{¼v¤ù==>Youtube
video:https://youtu.be/mM93FheJEGQ)
*³\¦h°ÝÃDªº´M§ä¸Ñµª¹Lµ{¥i¥H¨Ï¥Î¾ð
(tree)¨Óªí¹F¡A³oÃþ°ÝÃD¤]³£¥i¥H«Øºc ¥X¸ÑµªªÅ¶¡¾ð(solution space
tree)¡C¦]¦¹n§ä¨ì³o¨Ç°ÝÃDªº¸Ñµª¡A¤£ºÞ¬O¥i¦æ¸Ñ(feasible solution)©Î¬O³Ì¨Î¸Ñ(optimal
solution)¡A´NÂàÅܦ¨¤@Ó¾ð·j´M(tree search)°ÝÃD¡C
*¦³³\¦h¤èªk¥i¥H«ô³X(visit)»P©Ý®i(expand)¤@ӸѵªªÅ¶¡¾ð¡A¥]¬A²`«×Àu¥ý·j´M(depth- first search, DFS)¡B¼s«×Àu¥ý·j´M (breadth- first search,
BFS)¡Bµn¤s·j´M(hill climbing search, HCS)¥H¤Î³Ì¨ÎÀu¥ý·j´M(best-first
search)µ¥ºtºâªk¡C
* ¼s«×Àu¥ý·j´M(breadth-first search, BFS)ºtºâªk
* ²`«×Àu¥ý·j´M(depth-first search, DFS)ºtºâªk
* µn¤s·j´Mªk(hill climbing search,
HCS)ºtºâªk
* ³Ì¨ÎÀu¥ý·j´Mªk(best-first search)ºtºâªk
* ¦^·¹(backtracking)ºtºâªk
Homework 8:
A. µ¹©w¤@¶°¦XS={7, 4, 1, 2,
11}¥H¤Î¤@¥[Á`È10¡A§Q¥Î²`«×Àu¥ý·j´Mªk¨Ó¸Ñ¤l¶°¦X¥[Á`°ÝÃD¡A§A¥²¶·µe¥X¸Ñ¥X°ÝÃDªº¸Ñ
µªªÅ¶¡¾ð(solution space tree)¡C
B. ¥H²`«×Àu¥ý·j´Mºtºâªk§ä¥X¥H¤U¹Ï
(graph)ªºº~¦Ìº¸¹y°j¸ô (Hamiltonian circuit)¡A§A¥²¶·µe¥X¸Ñ¥X°ÝÃD
ªº¸Ñ µªªÅ¶¡¾ð(solution space
tree)¡C
C. ¥H¼s«×Àu¥ý·j´Mºtºâªk§ä¥X¤W¹Ïªºº~¦Ìº¸¹y
°j¸ô¡A§A¥²¶·µe¥X¸Ñ¥X°ÝÃD
ªº¸ÑµªªÅ¶¡¾ð(solution space
tree)¡C
D. ¥HªÅ³æ ®æªº²¾°Ê¤è¦V¬°¤W¤U¥ª¥kªº¦¸§Ç¡A¥H¼s«×Àu¥ý·j
´Mºt ºâªk¤U¸Ñ¨M¥H¤U
ªº¤K«÷¹Ï(8- puzzle)°ÝÃD¡C
°_
©lª¬ºA:
¥Ø¼Ðª¬ºA:
E. ¥HªÅ³æ ®æªº²¾°Ê¤è¦V¬°¤W¤U¥ª¥kªº¦¸§Ç¡A¥H²`«×Àu¥ý·j
´Mºt ºâªk¸Ñ¨MDÃD¤¤
ªº¤K«÷¹Ï(8- puzzle)°ÝÃD¡C
F. ¥HªÅ³æ®æªº²¾°Ê¤è¦V¬°¤W¤U¥ª¥kªº¦¸§Ç¡A¥Hµn¤s·j´Mºtºâªk¸Ñ¨MDÃD¤¤ªº¤K«÷¹Ï(8-puzzle)°ÝÃD¡C¦Óµû¦ô¨ç¼Æ¬°
¤è¶ô¿ù¸mªº¼Æ¥Ø¡AY¦³¬Û¦Pªº ±¡§Î¡A«h¥HªÅ³æ®æ²¾°Ê¤è¦V¤W¤U¥ª¥k¬°¨äÀu¥ý¶¶§Ç¡C
G. ¥HªÅ³æ®æªº²¾°Ê¤è¦V¬°¤W¤U¥ª¥kªº¦¸§Ç¡A¥H³Ì¨ÎÀu¥ý·j
´Mºtºâªk¸Ñ¨MDÃD¤¤ªº¤K«÷¹Ï
(8-puzzle)°ÝÃD¡C¦Óµû¦ô¨ç¼Æ¬°¤è¶ô¿ù¸mªº¼Æ¥Ø¡AY¦³¬Û¦Pªº±¡§Î¡A«h¥HªÅ³æ®æ²¾°Ê¤è
¦V¤W¤U¥ª¥k¬°¨äÀu¥ý¶¶§Ç¡C
- 9. (5/11)
¤À¤ä©w¬É(Branch and
Bound)ºtºâªk (Branch&Bound.zip)
(Youtube video Part1: https://youtu.be/KUlDxRV6fsU)(Youtube video Part2: https://youtu.be/R91wC81n6Yk)
(5/11)
*¤À¤ä©w¬É(branch and bound)¬O¤@Ó«ô ³X»P©Ý®i¸Ñ
µªªÅ¶¡¾ðªº¯S®í¤èªk¡A¥Î©ó§ä¥X°ÝÃDªº³Ì¨Î¸Ñ¡C¨ä°µªk¬Û·í©ó§ä¥X¤@ºØ¤èªk¨Ó¤Á³Î¥X¸ÑµªªÅ¶¡ªº¤À¤ä(branch)¡AµM«á¥H¤W¬É
(upper bound)»P¤U¬É(lower bound)ªº·§©À¨Ó¥[§Ö³Ì¨Î¸Ñªº·j´M¡C
*¹ï©ó´M§ä³Ì¤p¦¨¥»(minimum
cost)¸Ñµªªº³Ì¨Î¤Æ°ÝÃD¦Ó¨¥¡A¤À¤ä©w¬Éºtºâªk·|°w¹ï¨C¤@¤À¤äªº¸Ñµª¹w´ú¨ä¦¨¥»¤U¬É(lower
bound)¡A¨Ã§Q¥Î§ä¥X¥i¦æ¸Ñ¨Ó±o¨ì°ÝÃDªº¦¨¥»¤W¬É(upper
bound)¡C¦pªG¦³¤@Ӹѵªªº¦¨¥»¤U¬É¶W¹L°ÝÃD¦¨¥»¤W¬É¡A«h³oӸѤ£¥i¯à¬O³Ì¨Îªº¡A¦]¦¹ºtºâªk·|¤¤¤î(terminate)»P
³oӸѬÛÃöÁpªº¾ãÓ¤À¤äªº ·j´M¡C
*¦Ó¹ï©ó´M§ä³Ì¤j§Q¯q(maximum
benefit)¸Ñµªªº³Ì¨Î¤Æ°ÝÃD¦Ó¨¥¡A¤À¤ä©w¬Éºtºâªk·|°w¹ï¨C¤@¤À¤äªº¸Ñµª¹w´ú¨ä§Q¯q¤W¬É(upper
bound)¡A¨Ã§Q¥Î§ä¥X¥i¦æ¸Ñ¨Ó±o¨ì°ÝÃDªº§Q¯q¤U¬É(lower
bound)¡C¦pªG¦³¤@Ӹѵªªº§Q¯q¤W¬É§C©ó°ÝÃD§Q¯q¤U¬É¡A«h³oӸѤ£¥i¯à¬O³Ì¨Îªº¡A¦]¦¹ºtºâªk·|¤¤¤î(terminate)»P
³oӸѬÛÃöÁpªº¾ãÓ¤À¤äªº ·j´M¡C
.1 °ò¥»·§©À
.2 ¤À¤ä©w¬Éºtºâªk(°t¦Xµn¤s·j´Mªk)¸Ñ¨M¦h¶¥¹Ï³Ìµu¸ô®|°ÝÃD
.3 ¤À¤ä©w¬Éºtºâªk(°t¦X³Ì¨ÎÀu¥ý·j´M
ªk)¸Ñ¨M®È¦æ±À¾Pû°ÝÃD
.4 ¤À¤ä©w¬Éºtºâªk(°t¦X³Ì¨ÎÀu¥ý·j´M
ªk)¸Ñ¨M0/1I¥]°ÝÃD
.5 ¤@Ó¯S®íªº¤À¤ä©w¬Éºtºâªk: A*ºtºâªk
Homework 9:
A.
¥H¤À¤ä©w¬Éºtºâªk¸Ñ¨M¥H¤U¦h¶¥¹Ï³Ìµu¸ô®|°ÝÃD¡C
B.
µ¹©w¤@0/1I¥]°ÝÃD¡A¨äI¥]¥i¸ü«C=10,¥B¦³¤Tª««~ªº«¶q¤À§O¬°10, 3, 5¡A¦Ó¨ä§Q¼í¤À§O¬°40, 20,
30¡A¨D¥X¥i¥H©ñ¤JI¥]¤¤ª««~§Q¼íªºtȪº³Ì¤p¤Æ¡A¨Ï¥Î¤À¤ä©w¬Éºtºâªk¨Ó¸Ñ¦¹0/1I¥]°ÝÃD¡C ¡]µù:
¥²¶·µe¥X·j´M¾ð¡^(¦¹ÃD¨Ï¥Îtªº¥Ø¼Ð¨ç¼ÆÈ¡A¦]¦¹feasible solution¬O¨D¥Xupper bound¡A¦Ó¥B§Ṳ́£Â_
¦a¹Á¸Õ°§Cupper bound)
C. ¦P¤W ÃD¡A¦ý¥Ø¼Ð§ï¬°¨D ¥X¥i¥H©ñ¤JI
¥]¤¤ª««~§Q¼íªº³Ì¤j¤Æ¡A¨Ï¥Î¤À¤ä©w¬Éºtºâªk¨Ó¸Ñ¦¹0/1I¥]°Ý ÃD¡C ¡]µù:
¥²¶·µe¥X·j´M¾ð¡^(¦¹ÃD¨Ï¥Î¥¿ªº¥Ø¼Ð¨ç¼ÆÈ¡A¦]¦¹feasible solution¬O¨D¥Xlower
bound¡A¦Ó¥B§Ṳ́£Â_¦a¹Á¸Õ´£°ªlower bound)
D.
¨Ï¥ÎA*ºtºâªk¨Ó¸Ñ¥H¤U¤§¦h¶¥¹Ï³Ìµu¸ô®|°ÝÃD¡C¡]µù: ¥²¶·µe¥X·j´M¾ð¡^
E. ±NAÃDªºS»PT¹ï½Õ¡A½bÀY¤Ï¦V¸ÑÃD¡C
F. ±NBÃD©Ò¦³¦¨¥»¼¥H2´î3¸ÑÃD¡C
G. ±NCÃDªºª««~«¶q§ï¬°20, 5, 6¸ÑÃD¡C
H. ±NDÃDªºV0»PV8¹ï½Õ¡A½bÀY¤Ï¦V¸Ñ¥ÑV8¨ìV0ªº³Ì¬q¸ô®|°ÝÃD¡C
- 10.
(5/18)¨Ï¥Î³g°ý(greedy)ºtºâªk¥H
¤Î°ÊºA³W¹º(dynamic programming)ºtºâªk¸Ñ¨M³Ìµu¸ô®|°ÝÃD: (Alg-SP.pptx) (5/18)
¥Ñ¥[Åv¦³¦V¹Ï(weighted digraph)¤¤ªº¬YÓ³»ÂI©Î¸`ÂI
(vertex or
node)v¨ì¹Ï¤¤ªº¥t¤@¸`ÂIu¡AYv¨ìu¤§¶¡¦s¦b¤@±ø¸ô®|(path)¡A«h¸ô®|¤¤©Ò¸g¹LªºÃä(edge)ªºÅvÈ(weight)Á`¦XºÙ¬°¸ô®|ªº¦¨¥»
(cost)©Î¶ZÂ÷(distance)¡A¦Ó©Ò¦³¸ô®|¤¤¨ã¦³³Ì¤p¦¨¥»©Î¶ZÂ÷ªº¸ô®|«hºÙ¬°³Ìµu¸ô®|(shortest
path)¡C
µÛ¦Wªº³Ìµu¸ô®|ºtºâªk¥]¬A¡G
(0) ¥»¦¸½Òµ{·§n»¡©ú(§t³g°ýºtºâªk¤Î°ÊºA³W¹ººtºâªk¤§¤ñ¸û»¡©ú)(¼v¤ùºô§}:https://youtu.be/YYg8iLf1ej4)
(1) ¦h¶¥¹Ï³Ìµu¸ô®|ºtºâªk(¨Ï¥Î°ÊºA³W¹º¸ÑÃDµ¦²¤)(¼v¤ùºô§}:https://youtu.be/GQ4xKH4MpYI)
(2) Dijkstraºtºâªk(¨Ï¥Î³g°ý¸ÑÃDµ¦²¤)(´Á¤¤¦Ò«e¤w¸Ñ»¡¡A¦]¦¹¤£¥]§t¦b¦¹¦¸½Òµ{¼v¤ù¤¤)
(3) Bellman-Fordºtºâªk(¨Ï¥Î°ÊºA³W¹º¸ÑÃDµ¦²¤)(¼v¤ùºô§}:https://youtu.be/jc-NLpcV6vY)
(4) Floyd-Warshallºtºâªk(¨Ï¥Î°ÊºA³W¹º¸ÑÃDµ¦²¤)(¼v¤ùºô§}:https://youtu.be/UdTjmFy7J_E)
Homework 10:
A.
¨Ï¥Î°ÊºA³W¹ººtºâªk¨D¥H¤U¦h¶¥¹Ïªº³Ìµu¸ô®|¡C
B.
§Q¥ÎDijkstraºtºâªk¨D¥H¤U¹Ï(graph)³»ÂI4¨ì¦U³»ÂIªº³Ìµu¸ô®|(shortest
path)¤Î¨ä¶ZÂ÷(¦¨¥»)¡C
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
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
- (¹Ï
§Î¬ÛÃö ºtºâªk½ÆÂø«×¤ñ¸û) (Optional)
- Introduction to Software Defined
Networking (SDN) Multicast (SDN-Multicast.pptx)
(Optional)
Homework 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
R. ÃÒ©úConvex Hull°ÝÃDªº°ÝÃD¤U¬É¬°Omega(n log n)
S. µe¥Xmerge sortºtºâªkªº¤TÓ¤¸¯À(1,2,3)ªºdecision tree
- 12.
¦I¤ú§Qºtºâªk(Hungarian Algorithm)(HungarianAlg.zip)(6/8)
ºtºâªk½Òµ{
_0608(¦I¤ú§Qºtºâªk)¼v¤ù
Homework
12: ¥»¶g¥u¦³¨âÃD¡A¦]¦¹¨CӾǥͳ£n°µ³o¨âÃD§@·~¡A¦ý¥»¶g¤£»Ýú¥æ¼v¤ù»P²³ø¡C
A. ¨Ï¥Î¦I¤ú§Qºtºâªk(Hungarian
algorithm)¨Ó¸Ñ¥H¤Uªº³Ì¤p¦¨¥»«ü¬£°ÝÃD(assignment problem)¡]µù:
¥²¶·¼g¥Xºtºâªk°õ¦æ¹Lµ{¤¤ªº¨CÓ¤¤¶¡µ²ªG¡^
|
Task A
|
Task B
|
Task C
|
Tim
|
$1
|
$2
|
$3
|
Bob
|
$2
|
$3
|
$2
|
Alex
|
$2
|
$2
|
$3
|
B. »¡©ú¦p¦ó¨Ï¥Î¦I¤ú§Qºtºâªk(Hungarian
algorithm)¸Ñ¨M³Ì¤p¼Ú¤ó¥±Åv«°t¹ï(Minimum Euclidean Weighted
Matching)°ÝÃD¡C©Ò¿×³Ì¤p¼Ú¤ó¥±Åv« °t¹ï°ÝÃD´yz¦p¤U:
µ¹©wnÓÂI(n¬°°¸¼Æ)¡A¦p¦ó±N¦¹nÓÂI¤Ç°t§Î¦¨n/2ÓÂI¹ï¡AÅý¨CÓÂI¹ï§Î¦¨¤@±ø½u¬q¡A¦Ó¦¹n/2±ø½u¬q¨ã¦³³Ì¤pªºªø«×Á`©M¡C