Tables 2.1 - Single-Source(Weighted Shortest Paths CSE 2011...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Single-Source (Weighted) Shortest Paths CSE 2011 Prof. J. Elder - 166 - Last Updated: 4/1/10 10:16 AM Shortest Path on Weighted Graphs BFS finds the shortest paths from a source node s to every vertex v in the graph. Here, the length of a path is simply the number of edges on the path. But what if edges have different ‘costs’? 7 1 v s s CSE 2011 Prof. J. Elder - 167 - 5 2 v 2 3 Last Updated: 4/1/10 10:16 AM Weighted Graphs In a weighted graph, each edge has an associated numerical value, called the weight of the edge Edge weights may represent, distances, costs, etc. Example: In a flight route graph, the weight of an edge represents the distance in miles between the endpoint airports LAX 1233 DFW PVD 1205 2555 337 HNL ORD 849 802 SFO 1843 LGA 1120 MIA CSE 2011 Prof. J. Elder - 168 - Last Updated: 4/1/10 10:16 AM Shortest Paths Given a weighted graph and two vertices u and v, we want to find a path of minimum total weight between u and v. Length of a path is the sum of the weights of its edges. Example: Shortest path between Providence and Honolulu Applications Internet packet routing Flight reservations SFO LAX 849 1233 DFW PVD 1205 2555 ORD 337 HNL 1843 802 Driving directions LGA 1120 MIA CSE 2011 Prof. J. Elder - 169 - Last Updated: 4/1/10 10:16 AM Shortest Path: Notation Input: CSE 2011 Prof. J. Elder - 170 - Last Updated: 4/1/10 10:16 AM ...
View Full Document

This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

Page1 / 5

Tables 2.1 - Single-Source(Weighted Shortest Paths CSE 2011...

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