Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
演算法方式總覽 • The Divide-and-Conquer Strategy (個各擊破) • binary Searching、Quick Sort…. • The Greedy Method(貪婪演算法) • Prim MST、Kruskal MST、Djikstra's algorithm • Dynamic Programming(動態演算法) • 二項是係數、矩陣連乘、最佳二元搜尋樹… • Trace Back(回溯) • 圖形著色、漢米爾迴路問題…. • Tree Searching Strategy(樹的追蹤)
費氏數列(Fibonacci sequence) • Fibonacci sequence: 0 , 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 , … Fi = i if i 1 Fi = Fi-1 + Fi-2 if i 2 • Solved by a recursive program: • Much replicated computation is done. • It should be solved by a simple loop.
Dynamic Programming Dynamic Programming is an algorithm design method that can be used when the solution to a problem may be viewed as the result of a sequence of decisions 動態規劃是一種演算法的設計於當ㄧ個問題的解決方式是可以視為根據ㄧ連續的結果而得到。
最短路徑(The shortest path) • To find a shortest path in a multi-stage graph • Apply the greedy method : the shortest path from S to T : 1 + 2 + 5 = 8
The shortest path in multistage graphs • e.g. • The greedy method can not be applied to this case: (S, A, D, T) 1+4+18 = 23. • The real shortest path is: (S, C, F, T) 5+2+2 = 9.
資源分配問題 • The resource allocation problem • m resources, n projects profit Pi, j : j resources are allocated to project i. maximize the total profit.
The multistage graph solution • The resource allocation problem can be described as a multistage graph. • (i, j) : i resources allocated to projects 1, 2, …, j e.g. node H=(3, 2) : 3 resources allocated to projects 1, 2.
Find the longest path from S to T : (S, C, H, L, T), 8+5+0+0=13 2 resources allocated to project 1. 1 resource allocated to project 2. 0 resource allocated to projects 3, 4.