Lecturer: ¦¿®¶·ç
Teaching Assistants (TAs):
¤ý¬R³Ç ÃCÝ¿« °ª¤l»¨
Time: ¶g¤G 14:00~16:50
Place: ¶g¤G ¤u¤À](E6) A207
TA Class:
¶g¤G 13:00~13:50
¤u¤À](E6)A207
Sign-In Form (Y±Ä½u¤W±Â½Ò¤§Ã±
¨ì³æ): https://forms.gle/BJjEWro4hF3jG4yb8
(½Ð¦P¾Ç©ó13:45-14:15¶i¦æñ¨ì)
Online Course Link (Y±Ä½u¤W±Â½Ò¤§½Ò
µ{Ãìµ²)¡Ghttps://ncu-edu.webex.com/meet/pr110522039
Offline Video List: Link
½Ð¤j®a¥ýÆ[¬Ý¤§«eªº½Òµ{¤¶²Ð¼v¤ù:
https://youtu.be/1muNkALTSr8
*½Ð¥[¿ïªº¦P¾Ç·V«ä¡A¦]¬°¥»½Òµ{¬°¸ê¤u¨t¥²×½Ò¡A½Òµ{¤£¤Î®æ¤ñ²v¬°15%+-5%¡C×Ū¥»½Ò
µ{»Ýnú¥æmidterm project¡Bterm project¥H¤Î¨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 (2019¶}©l·s¼W)
- Few Quantum Algorithms (2021¶}©l·s¼W)
Scoring¡G
- ´Á¤¤¦Ò(¤ÀªR»P³]p·§©À)(25%)
- ´Á¥½¦Ò(¤ÀªR»P³]p·§©À)(30%)
- ´Á¤¤±MÃD¡B´Á¥½±MÃD¡B§@·~¡Bµ{¦¡³]p§@·~¡B³ø§i¡B½Òµ{°Ñ»P«×(45%)
Textbooks:
- My Book's Manuscript: (»´ÃP¾Çºtºâªk -- ±q¥j¨å¨ì¶q¤lºtºâªk) AlgBook-2023-0325.zip
(¦¹±Ð¬ì®Ñ°É»~¥[¤À¥Ñ2023¦~3¤ë
25¤é
11:45¶}©l¡A°É»~½d³ò¬°0-8³¹¡A´Á¤¤¦Ò¥H¦¹ª©¥»¬°¼Ð·Çµª®×)¡FAlgBook(Ch0-7+App1-2)(2023-0213).zip
(2023/02/13§ó·sª©)(¦¹±Ð¬ì®Ñ°É»~¥[¤À¥Ñ2023¦~2¤ë14¤é
21:00¶}©l¡A °É»~½d³ò¬°0-7³¹¡C³ø§i°É»~½Ð¦C¥X
AlgBook¯ó½Zª©¥»¤é´Á¡B¿ù»~¶½X¤Î¿ù»~³B¡A¨Ã½Ð¥ý½T»{¬O§_¤w
¦³¥L¤H¦CÁ|¹L¡C)(®ÑÄy§Y±N¥Xª©¡Aª©Åv
©Ò¦³¡A¯ó½Z¶È¨Ñ×½Ò¦P¾Ç°Ñ¦Ò¡A½Ð¤Å´²¼½¬y¥X:)
- My Another Book: (»´ÃP¾Ç¶q¤lµ{
¦¡³]p -- ±q¶q¤l¦ì¤¸¨ì¶q¤lºtºâªk)
- 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:
- ²Ä¤Q¤G©¡¥þ°ê¤j±M°|®Õ AI ´¼°Ê¤Æ³]³Æ³Ð§@¼ú: (png)(pdf); AR: (png); AR Paper: (pdf)
- (2/14)(2/21)1. »{ÃѺtºâªk --
±q¹ÃШ찪¶¥µ{¦¡»y¨¥: (AlgSmallTalk.pptx)
(Alg-Intro.pptx) (CPSforIndustry4.0.zip) (ACM-ICPC&EPC.ppt)(CPSProject.zip)
.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 2/21; Due day:
before next class or TA's class on 3/7)
A. ¨Ï¥ÎµêÀÀ½X(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. ¨Ï¥ÎµêÀÀ½X(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. ¨Ï¥ÎµêÀÀ½X
(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. ¨Ï¥ÎµêÀÀ½X(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. ¨Ï¥ÎµêÀÀ½X(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. ¨Ï¥ÎµêÀÀ½X(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.
(3/7)ºtºâªk½ÆÂø«×¤ÀªR½d¨Ò(¥H±Æ§Çºtºâªk¬°¨Ò)(Alg-Analysis.pptx)
.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: (2023-ICCE-4-Papers.zip)
(Select one problem out of A, B, ..., and
H to handwrite its solution, and one of the 4 papers to
handwrite a report; Due day: before next TA's class on
3/14)
A. ¨Ï¥ÎµêÀÀ½X(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
B. ¨Ï¥ÎµêÀÀ½X(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
C. ¨Ï¥ÎµêÀÀ½X(pseudo
code)¼g¤@Ӯɶ¡½ÆÂø«×¬°O(sqrt(n))ªººtºâªk¡A¿é¤J¤@Ó¾ã¼Æ(n>2)¨Ã§PÂ_n¬O§_¬°§¹¬ü¼Æ
(perfect number)¡A§A¥²¶·¤ÀªRºtºâªkªº³Ì®t¤Î³Ì¨Î®É¶¡½ÆÂø«×¡C
D. ¨Ï¥ÎµêÀÀ½X(pseudo
code)¼g¤@Óºtºâªk¡A¥H¿é¤J¤@Ө㦳nÓ¤¸¯Àªº¶°¦XS¨Ã¿é¥XSªº幂¶°(power
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.)
E. ¤ÀªR¶O§B¯Ç¦è¼Æ¦Cºtºâªk»P»¼°j¶O§B¯Ç¦è¼Æ¦Cºtºâªk¤§ªÅ¶¡
½ÆÂø«×
F. µe¥Xn log n¡Bn log2
n¡Bn2¤În3¹Ï §Î(for n=2, 4, 8, ...,
128)¨Ã¤ñ¸û¤§¡C
G. 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¤Ö®É¶¡§¹¦¨?
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§¹
¦¨?
I.
(¦¹ÃD¶È¨Ñ°Ñ¦Ò¡A¤£¦C¤J¤â¼g§@·~¤Î¹ê²ß½Ò¤fÀY³ø§i½d³ò¡A¤]¤£¦C¤J¦Ò¸Õ½d³ò)
¨Ï ¥ÎµêÀÀ½X¼g¥X°ï¿n±Æ§Ç(heap
sort)ºtºâªk¡A¤ÀªR¨ä®É¶¡»PªÅ¶¡½ÆÂø«×¡C
J. (¦¹
ÃD¶È¨Ñ°Ñ¦Ò¡A¤£¦C¤J¤â¼g§@·~¤Î
¹ê²ß½Ò¤fÀY³ø§i½d³ò¡A¤]¤£¦C¤J
¦Ò¸Õ½d³ò)
¨Ï
¥ÎµêÀÀ½X¼g¥X¥H¤U¾Þ§@:
¥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;
¥H¤W¾Þ§@³£¨ã¦³O(log n)ªºtime
complexity¡F¦ÓgetMax(): Returns
an element with maximum
priority; «h¨ã¦³O(1) time
complexity¡C
-
13.
(5/30) ¾ð·j´M(tree
search)»P¦^·¹(backtracking)ºtºâªk: (TreeSearch.pptx)
- Slides and Videos: (Alg4-1203(NoMark).pptx)
(§ó¥¿: §ë¼v¤ù²Ä36©M37¶ ¾ð²Ä¤T¼h¥kÃ䪺¤TÓ¸`ÂI¥Ñ¥ª¦Ó¥k¨Ì§Ç¬°"2' "4' "5")
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 13:
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
- 14. (6/6) ¤À¤ä©w¬É(Branch and Bound)ºtºâªk (Branch&Bound.zip)
(Youtube video Part1: https://youtu.be/KUlDxRV6fsU)(Youtube video Part2: https://youtu.be/R91wC81n6Yk)
*¤À¤ä©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 14: (A-
G¿ï2ÃD)
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
- 5/30 ºtÁ¿: "AIÛ²z" by ³¯¥°°a
±Ð±Â (»Ýñ¨ì)
- 6/6 ºtÁ¿: "¶q¤lªÈÄñ¥Ñõ¾Ç¡A¬ì¾Ç¡A¨ì¬ì§Þ" by ±i¼y·ç ±Ð±Â (»Ýñ¨ì)
- 6/13
Final Examination
14:00-16:30(®Ñ±µ§¸Õ¡A½d³ò¬°´Á¤¤¦Ò¤§«á±Ð±Âªº¤º®e¡A§t¶q¤lºtºâªk¡B°Ý
ÃD¤U¬É»P°ÝÃD¤ÀÃþ¡B§R´Mºtºâªk¡B
³g°ýºtºâªk¡B
³Ìµu¸ô®|ºtºâªk¡B¾ð·j´M»P¦^·¹ºtºâªk¡B
¤À¤ä©w¬Éºtºâªk)
(30%)
- Term
Project (Deadline 6/20 12:00PM) (12%)
³]p¶q¤lµ{¦¡«Øºc¨Ï¥Î c (2 <= c <= 8)Ó¶q
¤lp¼Æ¦ì¤¸(counting bits)¡A¹ïÀ³𝑓(𝑥) = a𝑥 (mod
15)
ªº¶q¤l¬Û¦ì¦ô´ú½u¸ô¡A¨Ã¨Ï¥Î¶q¤l¹q¸£¼ÒÀÀ¾¹°õ¦æ¶q¤l½u¸ô¡AÀò±o¶q¤lp¼Æ¦ì¤¸ªº´ú¶qµ²ªG¡A¥H¨D¥X𝑓(𝑥)
ªº¶g´Á¡Cµ{¦¡¥i¥Hª½±µ©I¥s¨Ã¯Ç¤J²Ä¤C³¹´£¨Ñªº qc_mod15 ¤Î iqft
¨ç¼Æ«Øºc¶q¤l¼Ò¾½u¸ô¤Î°f¶q¤l³Å¥ß¸ÅÜ´«½u¸ô¡A¨Ã¥B¥H¶q¤l¹hªº§Î¦¡¥[¤J¶q¤l½u¸ô¤¤¡Cµ{¦¡ªº¿é¤J¬°c¤Îa(¤¤¶¡¥HªÅ¥Õ¹j¶})¡A¿é¥Xµ²ªG¬°°w¹ï
counting bits¥Ñ¤p¦Ó¤j±Æ§Ç¡A¨Ã¤À¦æ¦C¥Xcounting bits¥H
¤Î¨ä¹ïÀ³ªº¶g´Á(¤¤¶¡¥HªÅ¥Õ¹j¶})¡C
¨Ò¦p¡AY¸I¨ìtest caseªº¿é¤J¬°3 13¡A«h¿é¥X¬°:
000 1
010 4
100 2
110 4
- 15.
¦I¤ú§Qºtºâªk(Hungarian Algorithm)(HungarianAlg.zip)(Optional)
ºtºâªk½Òµ{
_0608(¦I¤ú§Qºtºâªk)¼v¤ù
Homework
15: ¥»¶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