Sie sind auf Seite 1von 10

Solutions to OR Exercise Set 8

2014300950050
December 3, 2016

Ex. 1 Problem (b) in Ex. 10.3-3 of the textbook


Hillier & Lieberman.

With general analysis presented in previous Exercise Set (Exercise Set 7),
we simply give our weighted-graph below without repetition. And now we
turn to solve it by Dijkstras algorithm.

1.1

Initialization and Step 1

Choose one k V /P with smallest L (k ), here, k = O


1. Pnew = {O}
2. L(O) = L (O) = 0
3. Wnew =
4. Lnew (A) = 8000; Lnew (B) = 18000; Lnew (T ) = 31000;

1.2

Step 2

Choose one k V /P with smallest L (k ), here, k = A


1. Pnew = {O, A}
2. L(A) = L (A) = 8000
3. Wnew = {OA}
4. Lnew (B) = 18000; Lnew (T ) = 29000;

1.3

Step 3

Choose one k V /P with smallest L (k ), here, k = B


1. Pnew = {O, A, B}
2. L(B) = L (B) = 18000
3. Wnew = {OA, OB, AB}
4. Lnew (T ) = 29000;

1.4

Step 4

Choose one k V /P with smallest L (k ), here, k = T


1. Pnew = {O, A, B, T }
2. L(T ) = L (T ) = 29000
3. Wnew = {OA, OB, AB, AT }
4. Theres no other k and L (k).
Notice now T P , so we finish our algorithm, and draw the conclusion:
The shortest-path is OA AT , with its total cost to be L(T ) = 29000.

Ex. 2 Problem (b) in Ex. 10.3-7 of the textbook


Hillier & Lieberman.

With general analysis presented in previous Exercise Set (Exercise Set 7),
we simply give our weighted-graph below without repetition. And now we
turn to solve it by Dijkstras algorithm.
Notice that we connect vertices L,M,N,R to T with a cost of 0, since it
doesnt need time between the end of the last phase and marketing the
product. We may set L,M,N,R to be the termination, but for perspicuity,
we dont perform in that way.
2

2.1

Initialization and Step 1

Choose one k V /P with smallest L (k ), here, k = O


1. Pnew = {O}
2. L(O) = L (O) = 0
3. Wnew =
4. Lnew (A) = 5; Lnew (B) = 4; Lnew (C) = 2;

2.2

Step 2

Choose one k V /P with smallest L (k ), here, k = C


1. Pnew = {O, C}
2. L(C) = L (C) = 2
3. Wnew = {OC}
4. Lnew (F ) = 5; Lnew (G) = 4;

2.3

Step 3

Choose one k V /P with smallest L (k ), here, k = G


1. Pnew = {O, C, G}
2. L(G) = L (G) = 4
3. Wnew = {OC, CG}
4. Lnew (K) = 9;

2.4

Step 4

Choose one k V /P with smallest L (k ), here, k = B


1. Pnew = {O, C, G, B}
2. L(B) = L (B) = 4
3. Wnew = {OC, CG, OB}
4. Lnew (E) = 7;

2.5

Step 5

Choose one k V /P with smallest L (k ), here, k = A


1. Pnew = {O, C, G, B, A}
2. L(A) = L (A) = 5
3. Wnew = {OC, CG, OB, OA}
4. Lnew (D) = 8;

2.6

Step 6

Choose one k V /P with smallest L (k ), here, k = F


1. Pnew = {O, C, G, B, A, F }
2. L(F ) = L (F ) = 5
3. Wnew = {OC, CG, OB, OA, CF }
4. Lnew (K) = 8; Lnew (J) = 10

2.7

Step 7

Choose one k V /P with smallest L (k ), here, k = E


1. Pnew = {O, C, G, B, A, F, E}
2. L(E) = L (E) = 7
3. Wnew = {OC, CG, OB, OA, CF, AE, BE}
4. Lnew (I) = 12;

2.8

Step 8

Choose one k V /P with smallest L (k ), here, k = K


1. Pnew = {O, C, G, B, A, F, E, K}
2. L(K) = L (K) = 8
3. Wnew = {OC, CG, OB, OA, CF, AE, BE, F K}
4. Lnew (R) = 10;

2.9

Step 9

Choose one k V /P with smallest L (k ), here, k = D


1. Pnew = {O, C, G, B, A, F, E, K, D}
2. L(D) = L (D) = 8
3. Wnew = {OC, CG, OB, OA, CF, AE, BE, F K, AD}
4. Lnew (I) = 11; Lnew (H) = 13

2.10

Step 10

Choose one k V /P with smallest L (k ), here, k = R


1. Pnew = {O, C, G, B, A, F, E, K, D, R}
2. L(R) = L (R) = 10
3. Wnew = {OC, CG, OB, OA, CF, AE, BE, F K, AD, KR}
4. Lnew (T ) = 10;

2.11

Step 11

Choose one k V /P with smallest L (k ), here, k = T


1. Pnew = {O, C, G, B, A, F, E, K, D, R, T }
2. L(T ) = L (T ) = 10
3. Wnew = {OC, CG, OB, OA, CF, AE, BE, F K, AD, KR, RT }
4. NO Lnew .
Notice now T P , so we finish our algorithm, and draw the conclusion:
The only shortest-path is OC CF F K KR RT , with its total cost
to be L(T ) = 10.

Ex. 10.4-1 of the textbook Hillier & Lieberman

Figure 1: (a)

Figure 2: (b)

1. Identify OA P V /P such that h(OA) is minimized, i.e. h(OA)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OA} and P = {O, A}.
3.0.1

Step 2

1. Identify AB P V /P such that h(AB) is minimized, i.e. h(AB)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OA, AB} and P = {O, A, B}.
3.0.2

Step 3

1. Identify BC P V /P such that h(BC) is minimized, i.e. h(BC)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OA, AB, BC} and P = {O, A, B, C}.
3.0.3

Step 4

1. Identify BE P V /P such that h(BE) is minimized, i.e. h(BE)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OA, AB, BC, BE} and P = {O, A, B, C, E}.
3.0.4

Step 5

1. Identify ED P V /P such that h(ED) is minimized, i.e. h(ED)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OA, AB, BC, BE, ED} and P = {O, A, B, C, E, D}.
3.0.5

Step 6

1. Identify DT P V /P such that h(DT ) is minimized, i.e. h(DT )


h(k k ) for all (k , k ) P V /P .
2. Update W = {OA, AB, BC, BE, ED, DT } and P = {O, A, B, C, E, D, T }.
Conclusion Notice that T P now, thus we stop iteration.
And draw our conclusion: The minimum spanning tree is

Wf inal = {OA, AB, BC, BE, ED, DT } and the minimal cost is eW h(e) =
h(OA)+h(AB)+h(BC)+h(BE)+h(ED)+h(DT ) = 4+1+2+4+1+6 = 18.

3.1

(b)

We again follows Kruskals Algorithm to solve this minimum spanning


tree problem.
Initialization
3.1.1

We simply begin with W = , P = {O}.

Step 1

1. Identify OB P V /P such that h(OB) is minimized, i.e. h(OB)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB} and P = {O, B}.
3.1.2

Step 2

1. Identify BC P V /P such that h(BC) is minimized, i.e. h(BC)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC} and P = {O, B, C}.
3.1.3

Step 3

1. Identify CD P V /P such that h(CD) is minimized, i.e. h(CD)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD} and P = {O, B, C, D}.
3.1.4

Step 4

1. Identify DF P V /P such that h(DF ) is minimized, i.e. h(DF )


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD, DF } and P = {O, B, C, D, F }.
3.1.5

Step 5

1. Identify F E P V /P such that h(F E) is minimized, i.e. h(F E)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD, DF, F E} and P = {O, B, C, D, F, E}.
3.1.6

Step 6

1. Identify EH P V /P such that h(EH) is minimized, i.e. h(EH)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD, DF, F E, EH} and P = {O, B, C, D, F, E, H}.
8

3.1.7

Step 7

1. Identify HG P V /P such that h(HG) is minimized, i.e. h(HG)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD, DF, F E, EH, HG} and P = {O, B, C, D, F, E, H, G}.
3.1.8

Step 8

1. Identify DA P V /P such that h(DA) is minimized, i.e. h(DA)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD, DF, F E, EH, HG, DA} and P = {O, B, C, D, F, E, H, G, A}.
3.1.9

Step 9

1. Identify HI P V /P such that h(HI) is minimized, i.e. h(HI)


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD, DF, F E, EH, HG, DA, HI} and P =
{O, B, C, D, F, E, H, G, A, I}.
3.1.10

Step 10

1. Identify IT P V /P such that h(IT ) is minimized, i.e. h(IT )


h(k k ) for all (k , k ) P V /P .
2. Update W = {OB, BC, CD, DF, F E, EH, HG, DA, HI, IT } and P =
{O, B, C, D, F, E, H, G, A, I, T }.

3.2

Termination

Since P = {O, A, B, C, D, E, F, G, H, I, T } = V now, we stop iteration.


The minimum spanning tree
is Wf inal , i.e.,{OB, BC, CD, DF, F E, EH, HG, DA, HI, IT }
and the minimal cost is eW h(e) = 26.

Ex. 10.4-2 (a) Describe how this problem fits


the network description of the minimum spanning tree problem.

To begin with, we know that management wishes to determine between


which pairs of groves the roads should be constructed to connect all groves
with a minimum total length of road.
It has some crucial information such as between pairs of groves, connect all
groves and minimum total length.
Now recall that the minimum spanning tree problem can be summarized as
follows:
9

1. We are given the nodes of a network but not the links. Instead, we
are given the potential links and the positive length for each if it is
inserted into the network.
2. We wish to design the network by inserting enough links to satisfy the
requirement that there be a path between every pair of nodes.
3. The objective is to satisfy this requirement in a way that minimizes
the total length of the links inserted into the network
Lets see how this problem accords with these characteristics of minimum
spanning tree problem.
1. We are given the 8 groves of trees as nodes to connect, and the potential
roads with positive length.
2. We wish to design the network by inserting enough dirt roads to satisfy
the requirement that each grove is accessible from every other grove.
3. Our objective is to satisfy this requirement in a way that minimizes
the total length of the road to construct.
From these aspects we can see clearly management are facing a minimum
spanning tree problem.
Let me put it another way:
First, we are looking for a spanning tree,that every pair of groves
are connected by a unique path.
Second, we are looking for a spanning tree with minimum total cost.

10

Das könnte Ihnen auch gefallen