Shortest Path Problem: October 18, 2009
Shortest Path Problem: October 18, 2009
Outline
• Network Models
• Minimal Spanning Tree Problem
• Shortest Route Problem - TODAY: modeling aspect
• Maximal-flow Problem
The best decision corresponds to the shortest path from node 1 to node 5,
which is 1 → 3 → 5 with the cost of 5400 + 7100 = 12500. This path
corresponds to the decision of purchasing the car in years 1 and 3.
max Π`∈pπ`
p∈P
X
max ln(π`) (1)
p∈P
`∈p
The problems are equivalent in the sense that their solutions are the same
X
min − ln(π`)
p∈P
`∈p
Again, the equivalence is in the sense that their optimal solutions are the
same
Thus the most reliable route can be found by finding the shortest route in
the network, where a link reliability is replaced with − ln of the reliability
(see the network below).
The most reliable route of the original network is the shortest path in this
network
Three-Jug Puzzle
We have an 8-gallon jug filled with water. We also have two empty jugs,
one 5-gallon and one 3-gallon. We want to divide 8 gallons of water into
two 4-gallon parts using the three jugs. No other measuring devices are
available.
What is the smallest number of transfers needed to achieve the result?
We can formulate the problem as shortest path.
• Construct a network with each node representing the amount of water
in the jugs
• a node is an ordered tuple representing the amount of water in
8-gallon, 5-gallon, and 3-gallon jug.
• Place a link from node a to node b when it is possible to move from
node a to node b in one transfer (i.e, by pouring water from one jug to
another jug)
Each link counts for one transfer. Assign cost of 1 to each link, and find
the shortest path from node (8,0,0) to (4,4,0).
The shortest path is shown below. The minimal number of transfers is 7.