{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 6

# Lecture 6 - Shortest Path The shortest path problem...

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

1 Shortest Path The shortest path problem Unweighted shortest path Weighted shortest path Summary Applications

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

View Full Document
2 The Shortest Path Problem You are going from Central to HKUST by taxi. The driver needs to choose the best route, i.e., the shortest or the quickest Tom lives in the Central. He can choose from the following three routes to go to HKUST: Central by MTR (change at Mong Kok) to Choi Hung, then by minibus to HKUST Central by MTR (change at North Point and Yau Tong) to Choi Hong, then by minibus to HKUST Central by MTR (change at North Point) to Hang Hau, then by minibus to HKUST
3 Shortest Path: Distance If Tom wants to minimize the total travel time from home to HKUST, he can construct a shortest path problem, with the weight of an edge as the travel time between the two nodes (mean waiting time plus travel time); e.g., 16 minutes from Choi Hung to UST 1 2 3 4 5 Central Choi Hung Yau Tong Hang Hau HKUST 16 12 * * * * 6 North Point *

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

View Full Document
4 Shortest Path: Cost If Tom wants to minimize the transportation cost from home to HKUST, he can construct a shortest path problem, with the weight of an edge as the ticket fair between the two nodes; e.g., \$5.5 from Choi Hung to UST 1 2 3 4 5 Central Choi Hung Yau Tong Hang Hau HKUST 5.5 4 * * * 6 North Point *
5 Which Route Will You Choose? The above problem can be easily solved. When there is a large number of nodes, the problem can be much harder If Tom has a car and drives from Central to HKUST. There are more routes to choose from Many problems can be formulated as shortest path problems and may have much more options to consider

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

View Full Document
6 Terminology Node (vertex): usually assigned an index, e.g., node i Arc (edge): an arc ( i , j ) exists if and only if there is a direct connection from node i to node j Weight: each arc ( i , j ) is associated with a cost – the cost to traverse the edge – may represent distance, cost Source node (node s ): the node from which we start Destination node (node d ) , i j c v 1 v 2 v 5 v 3 v 6 v 7 v 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 37

Lecture 6 - Shortest Path The shortest path problem...

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

View Full Document
Ask a homework question - tutors are online