




版權(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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- Unit 3 Wrapping Up the Topic-Project 教學(xué)設(shè)計 2024-2025學(xué)年仁愛科普版英語七年級上冊
- 2糖到哪里去了(教學(xué)設(shè)計)-2023-2024學(xué)年一年級下冊科學(xué)冀人版
- 南方科技大學(xué)《環(huán)境資源法》2023-2024學(xué)年第二學(xué)期期末試卷
- 《7 校園綠化設(shè)計》(教學(xué)設(shè)計)-2023-2024學(xué)年六年級下冊綜合實踐活動粵教版
- 冀中職業(yè)學(xué)院《書法藝術(shù)與欣賞》2023-2024學(xué)年第二學(xué)期期末試卷
- 蘇州經(jīng)貿(mào)職業(yè)技術(shù)學(xué)院《安裝工程計量與計價》2023-2024學(xué)年第二學(xué)期期末試卷
- 教科版高中信息技術(shù)必修教學(xué)設(shè)計-5.1 音頻信息的采集與加工
- 四川化工職業(yè)技術(shù)學(xué)院《信號分析與處理C》2023-2024學(xué)年第二學(xué)期期末試卷
- 濮陽醫(yī)學(xué)高等??茖W(xué)校《微波技術(shù)基礎(chǔ)》2023-2024學(xué)年第二學(xué)期期末試卷
- 四川外國語大學(xué)成都學(xué)院《兒科護理學(xué)(實驗)》2023-2024學(xué)年第二學(xué)期期末試卷
- 八年級 下冊《黃河兩岸的歌(1)》課件
- 春季安全教育培訓(xùn)課件
- T-CIAPS 0035-2024 儲能電池液冷散熱器
- 《ZN真空斷路器》課件
- 2024年低壓電工特種作業(yè)證考試題庫模擬考試及答案
- 《山東修繕交底培訓(xùn)》課件
- 2024.8.1十七個崗位安全操作規(guī)程手冊(值得借鑒)
- 幼兒園大班音樂《歌唱春天》課件
- 2024年廣東省廣州市中考數(shù)學(xué)試卷含答案
- 電影《白日夢想家》課件
- 中華人民共和國建筑法
評論
0/150
提交評論