Lecture19

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

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

CS2134 Lecture 19 Weighted Graphs and Dijkstra’s Algorithm

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

View Full Document
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”
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.

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/09/2009 for the course CS 2134 taught by Professor Hellerstein during the Spring '07 term at NYU Poly.

### 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
Ask a homework question - tutors are online