Use the solver in Excel to find the shortest path from node S to node T in an undirected network (less constraints in a directed network).
Formulate the problem
To formulate this shortest path problem, answer the following three questions.
- What are the decisions to be made? For this problem, we need Excel to find out if an arc is on the shortest path or not (Yes=1, No=0). For example, if SB is part of the shortest path, cell F5 equals 1. If not, cell F5 equals 0. (in yellow)
- What are the constraints on these decisions? The Net Flow (Flow Out – Flow In) of each node should be equal to Supply/Demand. Node S should only have one outgoing arc (Net Flow = 1). Node T should only have one ingoing arc (Net Flow = -1). All other nodes should have one outgoing arc and one ingoing arc if the node is on the shortest path (Net Flow = 0) or no flow (Net Flow = 0). (in light blue)
- What is the overall measure of performance for these decisions? The overall measure of performance is the total distance of the shortest path, so the objective is to minimize this quantity. (in dark blue)
Name the following ranges:
And insert the following functions:
Solve the model
Enter the solver parameters:
The optimal solution: