Вы находитесь на странице: 1из 19

Shortest Route Problem

SRP Definition
Directed network G = (N, A)
Arc length (cost): arc (i,j) A
Node s as source
Find the shortest length from node s to
node I
The length = sum of the edges on the
path

Example Problem
Problem: Determine the shortest routes from the origin to all destinations.

Shipping Routes from Los Angeles


3

Solution Method
Dijkstras Algorithm
Select the node with the shortest direct route from the
origin.
Establish a permanent set with the origin node and the
node that was selected in step 1.
Determine all nodes directly connected to the permanent
set nodes.
Select the node with the shortest route (branch) from the
group of nodes directly connected to the permanent set
nodes.
Repeat steps 3 and 4 until all nodes have joined the
permanent set.
4

The Shortest Route Problem


Definition and Example Problem Data (2 of 2)

Network of Shipping Routes


5

The Shortest Route Problem


Solution Approach (1 of 8)
Determine the initial shortest route from the origin (node 1) to the closest node
(3).

Network with Node 1 in the Permanent Set


6

The Shortest Route Problem


Solution Approach (2 of 8)
Determine all nodes directly connected to the permanent set.

Network with Nodes 1 and 3 in the Permanent Set


7

The Shortest Route Problem


Solution Approach (3 of 8)
Redefine the permanent set.

Network with Nodes 1, 2, and 3 in the Permanent Set


8

The Shortest Route Problem


Solution Approach (4 of 8)
Continue

Network with Nodes 1, 2, 3, and 4 in the Permanent


Set
9

The Shortest Route Problem


Solution Approach (5 of 8)
Continue

Network with Nodes 1, 2, 3, 4, and 6 in the Permanent Set


10

The Shortest Route Problem


Solution Approach (6 of 8)
Continue

Network with Nodes 1, 2, 3, 4, 5, and 6 in the Permanent Set


11

The Shortest Route Problem


Solution Approach (7 of 8)
Optimal Solution

Network with Optimal Routes from Los Angeles to All Destinations


12

The Shortest Route Problem


Solution Approach (8 of 8)
Solution Summary

Shortest Travel Time from Origin to Each Destination


13

Using LP for SPP


Want to find the shortest path from the
factory to the warehouse
Supply of 1 at factory
Demand of 1 at warehouse

Decision Variables
Xij = flow from node i to node j
Note: flow on arc ij will be 1 if arc ij is
used,
and 0 if not used
Roads are bi-directional, so the 9 roads
require 18 decision variables

Shortest Path Problem


LP Formulation
Minimize Z

m n 1

c
i 1

s.t.

j i 1

j i 1

x ji

ij

xij

j i 1

n 1

x x
i 2

ij

i2

x x
i a

ia

ij

for i 1

ji

for i 1, j n

ji

for j n

j 1

ij

Total Cost

xij 0
( xij is binary, for all i and j )

Example

Objective Function (in distance)


Min 100X12 + 200X13 + 100X21 + 50X23
+ 200X24 + 100X25 + 200X31 +
50X32 + 40X35 + 200X42 + 150X45 +
100X46 + 40X53 + 100X52 + 150X54
+ 100X56 + 100X64 + 100X65
Subject to the constraints:
(see next slide)

Constraints: Flow Balance For Each


Node
Node
(X21 + X31) (X12 + X13)
(X12+X32+X42+X52)
(X21+X23+X24+X25)=0

= -1

(X13 + X23 + X53) (X31 + X32 + X35)


0 3

(X24 + X54 + X64) (X42 + X45 + X46)


0 4

(X25+X35+X45+X65)

Вам также может понравиться