競賽及點評圖論與網(wǎng)絡(luò)最優(yōu)化lecture_第1頁
競賽及點評圖論與網(wǎng)絡(luò)最優(yōu)化lecture_第2頁
競賽及點評圖論與網(wǎng)絡(luò)最優(yōu)化lecture_第3頁
競賽及點評圖論與網(wǎng)絡(luò)最優(yōu)化lecture_第4頁
競賽及點評圖論與網(wǎng)絡(luò)最優(yōu)化lecture_第5頁
已閱讀5頁,還剩11頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、Dijkstras Algorithm 單源最短路問題Problem Solved by DijkstrasSingle-source shortest-paths problem Edge weight =0Input: A graph G=(V, E) and a source s, and a nonnegative function w: ER+Output: For each vertex v, shortest path weight d(s,v), and a shortest path if exists.The Dijkstra AlgorithmDIJKSTRA(G,w,s

2、)Initialize-Single-Source(G,s)S QVG while Qdo uEXTRACT-MIN(Q)SSu for each v Adju do RElAX(u,v,w)Dijkstras Algorithm - exampleInitial GraphDistance to all nodes marked SourceMark 0 Dijkstras Algorithm - OperationInitial GraphSourceRelax edges leaving sourceS= S=sDijkstras Algorithm - OperationRed arr

3、ows show predecessorsSort vertices and choose closestRelax u and a shorter path via xexistsRelax yDijkstras Algorithm - OperationS is now s, x Sort vertices and choose closestRelax v and a shorter path via yexistsDijkstras Algorithm - OperationS is now s, x, y Sort vertices and choose closest, uUpda

4、te dvDijkstras Algorithm - OperationS is now s, x, y, u Finally add vDijkstras Algorithm - OperationS is now s, x, y, u Pre-decessors show shortest paths sub-graph Correctness of DijkstrasTheorem 24.6Dijkstras algorithm, run on a weighted,directed graph G=(V, E), with non-negative weight function w

5、and source s, terminates with du= d(s,u) for all vertices uV.Proof (by contradiction)Since S=V in the end, we only need to prove that for each vertex v added to S, there holds dv= d(s, v) when v is added to S.Suppose that u is the first vertex for which du d(s, u) when it was added to S Noteu is not

6、 s because ds = 0= d(s, s)There must be a path s.u, since otherwise du= d(s, u) = .Since theres a path, there must be a shortest path (note there is no negative cycle). Dijkstras Algorithm - ProofLet sxyu be a shortest pathfrom s to u, where at the moment u is chosen to S, x is in S and y is the fir

7、st outside S When x was added to S, dx = d(s, x)Edge xy was relaxed at that time, so at time u is chosen, dy = d(s, y)Applications-1最大可靠路給定一個通訊網(wǎng)絡(luò)N ,設(shè)弧aij 的完好概率為pij . 設(shè)路P 由若干條弧組成, 則定義路P的完好概率為:從頂點v0 到頂點vi 之間完好概率最大的路, 稱為從v0 到vi的最大可靠路.方法:定義每條弧的權(quán)重為wij=-log pij。則每條路的長度與其完好概率的關(guān)系為:w(P)=-logp(P).Applications

8、-2最大容量路給定一個運輸網(wǎng)絡(luò)N , 對N 的每條弧aij , 都有一個表示通過能力的參數(shù)cij 0,cij 一般稱為容量. 它的實際意義可以是道路所能通過車輛的最大高度, 或者是所能通過車輛的最大重量, 或者是單位時間內(nèi)所能通過的最大車流量等等. N 的每一條路P 的容量定義為P 的所有弧的最小容量, 即求v0 到其它各點最大容量路的算法可以通過對Dijkstra 算法進行修改得到, 只要將算法中弧權(quán)改為弧容量, 加法運算改為求最小的運算, 并將原來求最小的運算改為求最大的運算就可以得到求最大容量的算法.Applications-3最大期望容量路給定一個通訊網(wǎng)絡(luò)N = (V;A), N 的每條弧(可視為一

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論