Chapter 4 -- Greedy algorithms ( 3 )
Shortest Paths ( DijKstra’s Algorithm )
Scenario
$G=(V,E)\ is\ a\ directed\ graph\ and\ I(e)=lenth\ of\ edge\ e\in E,\ where\ I(e)\geq0\ can\ be\ distance,time\ or\ cost.$
$Find\ the\ shortest\ path\ P(v)\ from\ s\ to\ each\ other\ v\in V-{s},\ where\ I(P)=lenth\ of\ P=\sum_{e\in P} I(e)$
給定一個有向圖以及每個 edge 的 “長度”( 可以是距離、花費時間、花費成本…),試圖找出從 s 出發距離最短的路徑。