0% found this document useful (0 votes)
14 views7 pages

Up 2

Uploaded by

tolgaaksoydan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views7 pages

Up 2

Uploaded by

tolgaaksoydan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1.

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

Objective Function: Minimize ∑ ( x ij d ij)


i, j∈ A

Constraints:
❑ ❑

Origin: ∑ ( x oj) - ∑ ( x io ) = 1 (Origin, 1 edge has to move to


o, j∈ A i ,o ∈ A

start. Exit – enter = 1)


❑ ❑

Destination: ∑ ( x dj ) – ∑ ( x id ) = 1 (Destination, 1 edge has to


d ,j∈ A i ,d ∈ A

come to destination at the end. Enter – exit =1)

∀m ∈ N-{o,d} (enter-exit =
❑ ❑
∑ ( xmj ) - ∑ ( xℑ ) = 0

0)
m, j∈ A i ,m ∈ A

Xij∈ {0,1} ∀ i,j ∈ A


Linear Programming Model:

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

Shortest path is O-A-B-D-T or O-A-B-E-D-T and the min


distance is 16.
b)
n Solve Closest Total Nth Min Last
d connect Distan neare Distan connecti
nodes ed ce st ce on
conne unsolve
cted d
to
unsol
ved
1 O B 3 B 3 OB
2 O A 4 A 4 OA
B C 7
3 O C 6 C 6 OC
A D 7
B C 7
4 A D 7 D 7 AD
B E 9
C D 8
5 B E 9
C F 8 F 8 CF
D F 9
6 B E 9 E 9 BE
C E 11
D G 11
F E 10
7 D G 11
F G 10 G 10 FG
E H 11
8 E H 11 H 11 EH
F H 13
G H 12
9 E I 14 EI
G T 17 I 14
H I 14 HI
10 G T 17
H T 19 T
I T 18 18 IT
Shortest path is O-B-E-I-T or O-B-E-H-I-T and the min
distance is 18.

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*

Shortest path is SE-C-E-LN and length of the path is


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

The total distance is 420 miles, and total cost is


420*$10= $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

Total distance of MST = 5.2 miles.

MST:

0.7

0.7
5
0.8

4 8

7
1.0
0.5
3

0.9
0.6
2

You might also like