Vous êtes sur la page 1sur 3

IEEM201 Tutorial 10 11/24/04

1.
You need to take a trip by car to another town that you have never visited before.
Therefore, you are studying a map to determine the shortest route to your destination.
Depending on which route you choose, there are five other towns (call them A, B, C, D,
E) that you might pass through on the way. The map shows the mileage along each road
that directly connects two towns without any intervening towns. These numbers are
summarized in the following table, where a dash indicates that there is no road directly
connecting these two twons without going through any other towns.

Miles between Adjacent Towns
Town A B C D E Destination
Origin 40 60 50 --- --- ---
A 10 --- 70 --- ---
B 20 55 40 ---
C --- 50 ---
D 10 60
E 80

(a) Formulate this problem as a shortest-path problem by drawing a network where
nodes represent towns, links represent roads, and number indicate the length of
each link in miles.
(b) Use the algorithm described in class to solve this shortest-path problem.

Ans:

(a)


A
B D T O
C E
70
10
40
50
50
80
60 55 60
20 40
10



(b)
IEEM201 Tutorial 10 11/24/04
n Solved
nodes
connected
to unsolved
nodes
Closest
connected
unsolved
odes
Total
distance
involved
Nth
Nearest
node
Minimum
distance
Last
connection
1 O A 40 A 40 OA
2,3 O
A
C
B
50
40+10=50
C
B
50
50
OC
AB
4 A
B
C
D
E
E
40+70=110
50+40=90
50+50=100

E

90

BE
5 A
B
E
D
D
D
40+70=110
50+55=105
90+10=100


D


100


ED
6 D
E
T
T
100+60=160
90+80=170
T 160 DT

Shortest route: O-A-B-E-D-T Total distance is 160.


2.
A bank is considering to connect all the computer terminals in its branch offices to
the computer in its main office using special phone lines with telecommunication
devices. Every branch office must be connected to the main office. The connection
between a branch office to the main office can be direct or indirect through some
other branch offices. The following table shows the distance between every pair of
offices.
Main Branch 1 Branch 2 Branch
3
Branch
4
Branch
5
Main 190 70 115 270 160
Branch 1 190 100 240 215 50
Branch 2 70 100 140 120 220
Branch 3 115 240 140 175 80
Branch 4 270 215 120 175 310
Branch 5 160 50 220 80 310
The problem is to determine which pairs of offices should be directly connected by
special phone lines so as to minimize the total length of the phone lines.
a) Which network problem discussed in the lecture note best fits this situation?
b) Solve the problem using an appropriate algorithm.

Ans:

a)
Minimize spanning tree problem


IEEM201 Tutorial 10 11/24/04
b)
Iteration Node connected Link added
1 M, 2 M-2
2 1 2-1
3 5 1-5
4 3 5-3
5 4 2-4

The total length is 420

Vous aimerez peut-être aussi