Up 2
Up 2
Sets:
A = Set of edges between the nodes.
N = Set of Nodes
Parameters:
dij = Length of the edge from node i to node j. Each length is
nonnegative.
Decision Variables:
xij = decision variable for use of path from node i to node j. If
path is used the decision variable is equal to 1 and if it is not
used the decision variable is equal to 0.
x ij =
{ 1 ,∧xij is part of shortest path
0 ,∧x ij isnot part of shortest path
Constraints:
❑ ❑
∀m ∈ N-{o,d} (enter-exit =
❑ ❑
∑ ( xmj ) - ∑ ( xℑ ) = 0
0)
m, j∈ A i ,m ∈ A
Minimize ∑ ( x ij d ij)
i, j∈ A
Subject to:
❑ ❑
∑ ( x oj) - ∑ ( x io ) = 1
o, j∈ A i ,o ∈ A
❑ ❑
∑ ( x dj ) – ∑ ( x id ) = 1
d ,j∈ A i ,d ∈ A
∀m ∈ N-{o, d}
❑ ❑
∑ ( xmj ) - ∑ ( xℑ ) = 0 (all nodes except origin and
destination)
m, j∈ A i ,m ∈ A
Xij∈ {0,1} ∀ i, j ∈ A
2.
a)
n Solved Closest Total Nth Min Last
nodes connect Distan neare Distan connecti
connect ed ce st ce on
ed to unsolve
unsolve d
d
1 O A 4 A 4 OA
2 O C 5 C 5 OC
3 A B 5 B 5 AB
4 A D 11
B E 9 E 9 BE
C E 10
5 A D 11
B D 10 D 10 BD
E D 10 ED
6 D T 16 T 16 DT
E T 17
3.
SE A B C D E F LN
0* - - - - - - -
0* 4.6 4.7 4.2 - - - -
0* 4.6 4.7 4.2* - 7.7 7.6 -
0* 4.6* 4.7 4.2* 8.1 7.7 7.6 -
0* 4.6* 4.7* 4.2* 8.1 7.7 7.6 -
0* 4.6* 4.7* 4.2* 8.1 7.7 7.6* 11.4
0* 4.6* 4.7* 4.2* 8.1 7.7* 7.6* 11.3
0* 4.6* 4.7* 4.2* 8.1* 7.7* 7.6* 11.3
0* 4.6* 4.7* 4.2* 8.1* 7.7* 7.6* 11.3*
4.
a) This problem fits network description of the MST problem
because we have to connect a phone line to every office just as
we have to visit every node in the MST problem and we have to
minimize total cost of the operation by using a shortest distance
to the node from any other node just as we have to minimize
total length of the arcs in the minimum spanning tree problem
using the minimum distance to the nodes we want to reach. In
both of these problems we do not have to connect directly to
the main office or main node so we can just select the shortest
paths to the nodes as long as they are indirectly connected to
the main office/node.
b)
n Set of MST Set of nodes Selected Cost of
nodes out of MST MST edge selected
MST edge
1 {Main} {B.1, B.2, - 0
B.3, B.4,
B.5}
2 {Main, B.2} {B.1, B.3, Main - B.2 70*10 =
B.4, B.5} $700
3 {Main, B.2, {B.3, B.4, B.2 - B.1 100*10=
B.1} B.5} $1000
4 {Main, B.2, {B.3, B.4} B.1-B.5 50*10=$5
B.1, B.5} 00
5 {Main, B.2, {B.4} B.5- B.3 80*10=$8
B.1, B.5, B.3} 00
6 {Main, B.2, {} B.2-B.4 120*10=
B.1, B.5, B.3, $1200
B.4}
6 {Main, B.2, {} - Total
B.1, B.5, B.3, Cost=
B.4} $4200
MST:
Main
70
120
B.2
100
B.4 B.1
B.5
50
80
5.
n Set of MST Set of nodes Selected Distance
nodes out of MST MST edge of
selected
MST edge
1 {1} {2,3,4,5,6,7, - 0
8}
2 {1, 5} {2,3, 1-5 0.7
4,6,7,8}
3 {1,5,4} {2,3,6,7,8} 5-4 0.7
4 {1,5,4,8} {2,3,6,7} 5-8 0.8
5 {1,5,4,8,7} {2,3,6} 8-7 0.5
6 {1,5,4,8,7,6} {2,3} 7-6 0.6
7 {1,5,4,8,7,6, {2} 8-3 1.0
3}
8 {1,5,4,8,7,6, {} 3-2 0.9
3,2}
8 {1,5,4,8,7,6, {} - Total
3,2} Distance:
5.2 miles
MST:
0.7
0.7
5
0.8
4 8
7
1.0
0.5
3
0.9
0.6
2