Greedy Method
Last updated
Last updated
在一連串的選擇中做 local optimal decision 會在最終產生 global optimal solution
只有少數 optimization problem 可以使用 Greedy
但大部分問題仍可以用 Greedy 找到近似解 (acceptable solution)
A minimum spanning tree of G is a spanning tree of G with the smallest total weight.
假設
邊數:
滿足 spanning tree (點之間連通 connected)
possible spanning trees for points
Exponential time complexity
Kruskal’s algorithm:
Prim’s algorithm: