Lecture19

Lecture19 - Lecture 19 Weighted Graphs and Dijkstra's...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CS2134 Lecture 19 Weighted Graphs and Dijkstra’s Algorithm
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS2134 Weighted Graphs For many applications, it’s useful to associate a “weight” (cost) with each edge: Transportation: price of ticket between two cities, or physical distance, or travel tiime, or … Communication: congestion on link between two routers Adjacency list Store weight along with target node for each edge Adjacency matrix Store weight, rather than true/false for each pair of vertices with some default value indicating “no edge”
Background image of page 2
CS2134 Shortest Path Problem in Weighted Graphs The weight of a path is the sum of the weights of its edges Shortest path between vertices v and w is the path connecting v and w with minimal weight Note: shortest path from v to w is not necessarily the path with fewest edges.
Background image of page 3

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

View Full DocumentRight Arrow Icon
For Dijkstra’s algorithm Assume all edge weights are positive Want to find the shortest path from source node s to each node in G. G can be directed or undirected (also
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

Lecture19 - Lecture 19 Weighted Graphs and Dijkstra's...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online