CSE331 Lecture 24

# CSE331 Lecture 24 - 2 3 4 y y d(y = 3 z z d(z = 4 Shortest...

This preview shows pages 1–11. Sign up to view the full content.

Lecture 23 CSE 331 Oct 24, 2011

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Online Office Hr @ 10:00- 10:30pm
Shortest Path Problem http://xkcd.com/85/

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Another more important application Is BGP a known acronym for you? Routing uses shortest path algorithm
Shortest Path problem Input: Directed graph G=(V,E) Edge lengths, l e for e in E “start” vertex s in V Output: All shortest paths from s to all nodes in V 100 15 5 s u w 5 s u 15 5 s u w

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Dijkstra’s shortest path algorithm E. W. Dijkstra (1930-2002)
Dijkstra’s shortest path algorithm Input: Directed G=(V,E) , l e ≥ 0 , s in V R = {s} , d(s) =0 While there is a x not in R with (u,x) in E , u in R d’(w) = min e=(u,w) in E , u in R d(u)+l e Pick w that minimizes d’(w) Add w to R d(w) = d’(w) s s w w u u z z x x y y 1 2 4 3 3 1 2 1 2 d(s) = 0 1 4 2 s s u u d(u) = 1 4 2 w w d(w) = 2 5 x x d(x) =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2 3 4 y y d(y) = 3 z z d(z) = 4 Shortest paths Shortest paths Couple of remarks The Dijkstra’s algo does not explicitly compute the shortest path Can maintain “shortest path tree” separately Dijkstra’s algorithm does not work with negative weights Left as an exercise Rest of Today’s agenda Prove the correctness of Dijkstra’s Algorithm Runtime analysis of Dijkstra’s Algorithm Reading Assignment Sec 4.4 of [KT] Building a fiber network Lay down fibers to connect n locations All n locations should be connected Laying down a fiber costs money What is the cheapest way to lay down the fibers?...
View Full Document

## This note was uploaded on 12/11/2011 for the course CSE 331 taught by Professor Rudra during the Fall '11 term at SUNY Buffalo.

### Page1 / 11

CSE331 Lecture 24 - 2 3 4 y y d(y = 3 z z d(z = 4 Shortest...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online