chapter 8 network models. 2 four specific network models shortest path problem( 最短路徑問題 )...

102
Chapter 8 Network Models

Upload: bertram-quinn

Post on 03-Jan-2016

241 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

Chapter 8

Network Models

Page 2: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

2

Four Specific Network Models

Shortest Path Problem( 最短路徑問題 )Maximum Flow Problem ( 最大流量問題 )CPM( 要徑法 ) and PERT ( 計畫評核術 ) Minimum Spanning Tree Problem ( 最小擴張樹問題 )Minimum-Cost Network Flow Problem

( 最小成本網路流量問題 ) The Network Simplex Method( 網路單體法 )

Page 3: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

3

8.1 Basic Definitions

A graph or network is defined by two sets of symbols: nodes and arcs.

A set (call it V) of points, or vertices. The vertices of a graph or network are also called nodes.

An arc consists of an ordered pair of vertices and represents a possible direction of motion that may occur between vertices.

A sequence of arcs such that every arc has exactly one vertex in common with the previous are is called a chain.

p.400

Page 4: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

4

A path is a chain in which the terminal node of each arc is identical to the initial node of next arc.

For example in the figure below: (1,2)-(2,3)-(4,3) is a chain but not a path; (1,2)-(2,3)-(3,4) is a chain and a path,

which represents a way to travel from node 1 to node 4.

2 3

1 4

Page 5: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

5

8.2 Shortest Path Problems

Assume that each arc in the network has a length associated with it.

The problem of finding the shortest path from node 1 to any other node in the network is called a shortest path problem ( 最短路徑 ).

Example 1.

p.414

1 6

5

4

3

24

3

3

2

32

2

City 1Plant 1

Page 6: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

6

Example 2: Equipment Replacement

Assume that a new car (or machine) has been purchased for $12,000 at time 0.

The cost of maintaining the car during a year depends on the age of the car at the beginning of the year, as given in the table below.

Age of Car (Years)

Annual Maintenance

cost

Age of Car (Years)

Trade-in Price

0 $2,000 1 $7,000

1 $4,000 2 $6,000

2 $5,000 3 $2,000

3 $9,000 4 $1,000

4 $12,000 5 $0

p.415

Page 7: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

7

In order to avoid the high maintenance cost associated with an older car, we may trade in the car and purchase a new car.

To simplify the computations we assume that at any time it costs $12,000 to purchase a new car.

The goal is to minimize the net cost incurred during the next five years.

Page 8: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

8

Example 2: Solution It should be formulated as a shortest path problem. The network will have six nodes.

Node i is the beginning of year i and for i<j, an arc (i,j) corresponds to purchasing a new car at the beginning of year i and keeping it until the beginning of year j.

The length of arc (i,j)(call it cij) is the total net cost incurred in owning and operating a car from the beginning of year i to the beginning of year j if a new car is purchased at the beginning of year i and this car is traded in for a new car at the beginning of year j.cij = maintenance cost incurred during years i,i+1,…,j-1 + cost of purchasing a car at beginning of year i - trade-in value received at the beginning of year j

Page 9: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

9

Applying this formula to the information the problem yields

Both path 1-3-5-6 and 1-2-4-6 will give us the shortest path with a value of 31.

c12=2+12-7=7c13=2+4+12-6=12c14=2+4+5+12-2=21c15=2+4+5+9+12-1=31c16=2+4+5+9+12+12-0=44c23=2+12-7=7c24=2+4+12-6=12

c25=2+4+5+12-2=21c26=2+4+5+9+12-1=31c34=2+12-7=7c35=2+4+12-6=12c36=2+4+5+12-2=21c45=2+12-7=7c46=2+4+12-6=12c56=2+12-7=7

1 654327 7 7 7 7

2112

12

21

31

1221

31

44

12

Page 10: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

10

Dijkstra’s algorithm

1.i=0, k0=1 。在節點 1 旁標記 (0,-) ,並加框表示永久標記2. 考慮所有可由節點 ki直接到達且尚未被永久標記的節點 j 。 若節點 j 暫無標記,則暫時標記 (Dj=Dki,j,ki) ; 否則比較是否經由節點 ki會得到離節點 1 更近之距離, 亦即比較 Dj 與 Dj + Dki,j。 若 Dj >Dj + Dki,j,則重新暫時標記 (Dj + Dki,j,ki) ; 否則標記不變。3. 在所有暫時標記中,選擇最小的 Dj,並使 ki+1等於該節點 將該節點的暫時標記加框,代表永久標記。4. 若所有節點已被永久標記,則停止; 否則 i=i+1 ,返回步驟 2

ki :離節點 1 最近的第 i 個節點Dij :由節點 i 至節點 j 的直接距離Dj :至目前為止,由節點 1 至節點 j 的最短距離

Page 11: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

11

The shortest-path problem as a transshipment problem

Table 3

node 2 3 4 5 6 supply

14 3 M M M

11

20 M 3 2 M

11

3M 0 M 3 M

11

4M M 0 M 2

11

5M M M 0 2

11

demand 1 1 1 1 1

p.414

Page 12: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

12

Exercise : Find the shortest-path

8

1 7

6

5

3

26

82

1

8

41

6

65

43

8

1 7

6

5

3

26

82

1

8

41

6

65

43

Page 13: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

13

Exercise : p.418 #1

1 654327 7 7 7 7

21

12

12

21

31

12

21

31

44

12

Find the shortest-path from node 1 to node 6.

Page 14: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

14

Exercise : p.418 #2

Find the shortest-path from node 1 to node 5.

1 5

43

22

12

58

6

104

Page 15: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

15

Exercise : p.418 #3

Formulate the shortest-path problem asa transshipment problem.

1 5

43

22

12

58

6

104

Page 16: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

16

Solution:

Node 2 3 4 5 Supply

1 2 8 M M 1

2 0 5 4 12 1

3 M 0 5 M 1

4 M M 0 10 1

Demand 1 1 1 1

1 5

43

22

12

58

6

104

Page 17: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

17

8.3 Maximum Flow Problems

Many situations can be modeled by a network in which the arcs may be thought of as having a capacity that limits the quantity of a product that may be shipped through the arc.

例如:巔峰時間之交通管制。 由市中心至郊區之流動車輛數最多,使交通盡快疏散。

大型活動 ( 演唱會、集會遊行 ) 前後之交通管制。 公司貨物供應鏈系統設計。 In these situations, it is desired to transport the

maximum amount of flow from a starting point (called the source) toa terminal point (called the sink).

These types of problems are called maximum flow problems( 最大流量 ).

p.419

Page 18: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

18

Example 3: Maximum Flow

Sunco Oil wants to ship the maximum possible amount of oil (per hour) via pipeline from node so to node si.

The various arcs represent pipelines of different diameters.

The maximum number of barrels of oil that can be pumped through each arc the arc capacity.

so si21(2)2 (2)3 (2)2

(0)3

a0(2)

3(0)4 (0)1

Arc Capacity(so,1) 2(so,2) 3(1,2) 3(1,3) 4(3,si) 1(2,si) 2

p.420

Page 19: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

19

Let x0 be the flow through the artificial arc, the conservation of flow implies that x0 = total amount of oil entering the sink.

Sunco’s goal is to maximize x0.

The optimal solution to this LP is z=3,xso,1=2, x13=1, x12=1, xso,2=1, x3,si=1, x2,si=2, xo=3.

Max Z= x0

S.t. xso,1 ≤ 2 (Arc Capacity constraints)xso,2 ≤ 3x12 ≤ 3x2,si ≤ 2x13 ≤ 4x3,si ≤ 1x0 = xso,1 + xso,2 (Node so flow constraints)xso,1 = x12 + x13 (Node 1 flow constraints)xso,2 + x12 = x2,si (Node 2 flow constraints)x13 = x3,si (Node 3 flow constraints)

x3,si + x2,si = x0 (Node si flow constraints)xij ≥ 0

Page 20: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

20

Example 3: Solution

An artificial arc called a0 is added from the sink to the source.

First determine the decision variable xij = Millions of barrels of oil per hour that will pass through arc(i,j) of pipeline.

For a flow to be feasible it must have two characteristics:

0 ≤ flow through each arc ≤ arc capacity Flow into node i = Flow out from node i

Page 21: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

21

Example 4: Airline Maximum Flow

Fly-by-Night Airlines determines how many connecting flights daily can be arranged between following cities.

Table 9Arc capacities for Fly-by-Night Airlines

cities Max number of daily flights

Juneau - Seattle (J,S) 3

Seattle - L.A. (S,L) 2Seattle - Denver (S,De) 3L.A. - Dallas (L,D) 1Denver - Dallas(De,D) 2

p.421

Page 22: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

22

Example 4: Airline Maximum Flowp.422

so si213

Denver

Dallas

L.A.

3

Juneau

Seattle

3 2

12

Figure 7

xJ,S = 3, xS,L = 1, xS,De= 2, xl,D = 1, xDe,D = 2

Page 23: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

23

Example 4: Solution

The capacity of arc (i,j) is the max number of daily flights between city i and city j.

The optimal solution z=x0=3, xJ,S = 3, xS,L = 1, xS,De= 2, xl,D = 1, xDe,D = 2

Page 24: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

24

Ford-Fulkerson Method for solving Maximum-Flow problems

Q1:Given a feasible flow, how can we tell if it an optimal flow (that is maximizes x0)?

Q2:If a feasible flow is non-optimal, how can we modify the flow to obtain a new feasible flow that has a larger flow from the source to the sink?

p.424

Page 25: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

25

Choose any set of nodes V’ that contains the sink bet does not contain the source. Then the set of arcs (i,j) with i not in V’ and j a member of V’ is a cut for the network.

The capacity of a cut is the sum of the capacities of the arcs in the cut.

The flow from source to sink for any feasible flow is less than or equal to the capacity of any cut.

If the sink cannot be labeled, thenCapacity of CUT = current flow from source to sink

Page 26: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

26

Definition Choose any set of nodes V’ that contains the

sink but does not contain the source.Then the set of arcs (i,j) with i not in V’ and j a member of V’ is a cut for the network.

Lemma 1 The flow from source to sink for any feasible

flow is less than or equal to the capacity of any cut.

Lemma 2 if the sink cannot be labeled, then capacity of cut

= current flow from source to sink.

p.427

Page 27: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

27

Ford-Fulkerson Method

Step 1:Find a feasible flow. (setting each arc’s flow to zero will do)

Step 2: Using the labeling procedure, try to label the

sink.If the sink can not be labeled, then the current feasible flow is a maximum; if the sink is labeled, then go to step 3.

Step 3: Adjusting the feasible flow and increase the

flow from the source to the sink.Return to step 2.

p.428

Page 28: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

28

Ford-Fulkerson 法

採用剩餘流量網路 (residual network capacity)和遞增路徑的觀念

首先一開始先將所有路徑上的流量設為 0 。 然後,嘗試在剩餘網路上尋找任意遞增路徑。 沿著路徑增加邊線上的流量。

持續重複這個流程,直到沒有遞增路徑為止。數學家 Edmonds 和 Karp 建議使用廣度優先搜尋法選擇遞增路徑。採用廣度優先其目的在於找到路徑最短的遞增路徑。加上選擇最大容量的邊線作為輔助條件,就能夠避免做白工的問題。

Page 29: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

29

Maximal flow problem algorithm

1. 找出一條由起點至終點仍具有正剩餘流動容量 (positive remaining flow capacity; PRFC) 的路徑 ( 在此路徑上的所有弧,仍有剩餘的流動容量 ) 。

若無法找到,則停止。2. 在路徑上,選擇最小 PRFC 弧,並使 f=min{PRFC} 。3. 更新路徑上各弧的 PRFC 如下: (1) 對於與路徑方向相同的弧,將其容量減去 f 。 (2) 對於與路徑方向相反的弧,將其容量加上 f 。4. 返回步驟 1 。

Page 30: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

30

Example of Ford-Fulkerson Method

1

2

3

siso

2

8

53

2

2

7

1

2

3

siso

(0)2

(0)8

(3)5(3)3

(0)2

(0)2

(0)7+3

1

2

3

siso

(0)2

(2)8

(5)5(3)3

(0)2

(2)2

(0)7+3+2

1

2

3

siso

(2)2

(2)8

(5)5(3)3

(2)2

(2)2

(0)7+3+2+2

Figure 17

p.429

Page 31: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

31

Example of Ford-Fulkerson Method

1

2

3

siso

2

2

53

2

2

1

2

3

siso

(2)2

(2)8

(5)5(3)3

(2)2

(2)2

(0)7+3+2+2

p.429

7 7

Page 32: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

32

Exercise : p.429 #1

so si

4

3

2

16

2

31

7 7

3

3

so si

4

3

2

1

6

2

3

1

7 7

3

30

0

0

0

0 0

00

最大流量問題求解之前先將網路改為無向的殘餘網路( residual network )

Page 33: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

33

(so,1)-(1,3)-(3,2)-(2,4)-(4,si) feasible arcs by 3 (so,2) - (2,4) - (4, si) feasible arcs by 2 (so-1) - (1, 2) - (2, 3) - (3, si) feasible arcs by 1

capacity=3+2+1=6

Exercise : p.429 #1

55

so si

4

3

2

14

2

1

24

3

6 6

Page 34: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

34

Exercise : p.429 #2

Figure 19

1

2

3

siso

2

21

3

1

4

2

MF=?

Page 35: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

35

Exercise : p.430 #4

Min Cut Set = {1, 3, si}.

Capacity of Cut Set

= 20 + 15 + 10 = 45

Page 36: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

36

Exercise : p.430 #5

Min Cut Set = {2, 3, si}.Capacity of Cut Set = 3+ 1 + 2 + 3= 9

Page 37: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

37

8.4 CPM and PERT

Network models can be used as an aid in the scheduling of large complex projects that consist of many activities.

If the duration of each activity is known with certainty( 確定 ), the critical path method (CPM, 要徑法 ) can be used to determine the length of time required to complete a project. 杜邦公司為了安排維修停機等生產作業所發展之技術。

If the duration of activities is not known with certainty, the program evaluation and review technique (PERT, 計畫評核術 ) can be used to estimate the probability that the project will be completed by a given deadline. 美國海軍為北極星飛彈而發展之技術,該項計畫從未執行過。

PERT/CPM

p.431

Page 38: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

38

CPM and PERT are used in many applications including the following: Scheduling construction projects such as office buildings, highways and swimming pools

Developing countdown and “hold” procedure for the launching of space crafts

Installing new computer systemsDesigning and marketing new productsCompleting corporate mergersBuilding ships

Page 39: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

39

To apply CPM and PERT, we need a list of activities that make up the project.

The project is considered to be completed when all activities have been completed.

For each activity there is a set of activities (called the predecessors of the activity) that must be completed before the activity begins.

A project network is used to represent the precedence relationships between activities.

For each activity there is a set of activities (called predecessors) that must be completed before the activity begins.

Page 40: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

40

Activities are represented by arcs and the nodes will be used to represent completion of a set of activities This type of project network is called an activity on arc (AOA) network.

activity on node (AON) network.Given a list of activities, predecessors, and

AOS representation of a project (called a project network or project diagram) can be constructed by using the following rules.

Page 41: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

41

Presenting Activities

Figure 26 Figure 27 Figure 28

Figure 29 Figure 30

1

23

A

B

1 2 3A B

1 2C

AB

1 2

A

B

C

A

B Dummy3

1 2C

p.432

C

Page 42: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

42

Figure 28

1 2C

AB

Figure 27

1

23

A

B

C

ET(3) 表示A 與 B 兩者均完成之最早時間同時也是 C 最早開始時間

LT(3) 表示B 與 C 兩者必須有一個開始之最晚時間同時也是 A 最晚完成時間

Page 43: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

43

Node 1 = starting nodeNode 6 = finish node

AON

AOA

Figure 31

AON Network / AOA Network

Start Finish

C

D

B

A4

3

3

3

1

65

42

3

A 6

B 9

Dummy

C 8

D 7

E 10

F 12

Page 44: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

44

Given a list of activities, predecessors, and AOS

representation of a project (called a project network or project diagram) can be constructed by using the following rules.

1. Node 1 represents the start of the project. An arc should lead from node 1 to represent each activity that has no predecessors.

2. A node (called the finish node) representing the completion of the project should be included in the network.

3. Number the nodes in the network so that the node representing the completion time of an activity always has a larger number than the node representing the beginning of an activity.

4. An activity should not be represented by more than one arc in the network

5. Two nodes can be connected by at most one arc. To avoid violating rules 4 and 5, it can be sometimes

necessary to utilize a dummy activity that takes zero time.

Page 45: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

45

Example 6: Drawing a Project Network

Widgetco is about to introduce a new product. A list of activities and their predecessors and of the duration of each activity is given.

Draw a project diagram for this project.

Table 12

Activity Predecessors Duration(days)

A:train workers - 6

B:purchase raw materials - 9

C:produce product 1 A, B 8

D:produce product 2 A, B 7

E:test product 2 D 10

F:assemble products 1&2 C, E 12

Page 46: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

46

Example 6: Solutionp.433

1

65

42

3A 6

B 9

Dummy

C 8

D 7

E 10

F 12

Table 12

Activity Predecessors Duration(days)

A:train workers - 6

B:purchase raw materials - 9

C:produce product 1 A, B 8

D:produce product 2 A, B 7

E:test product 2 D 10

F:assemble products 1&2 C, E 12

Page 47: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

47

Early Event Time & Late Event TimeThe early event time ( 最早時間 ) for node i,

represented by ET(i), is the earliest time at which the event corresponding to node i can occur. (P.434)

The late event time ( 最晚時間 ) for node i, represented by LT(i), is the latest time at which the event corresponding to node i can occur without delaying the completion of the project. (P.435)

Page 48: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

48

To find the early event time for each node in the project network ,following the steps :

Find each prior event to node i that is connected by an arc to node i.

To the ET for each immediate predecessor of the node i, add the duration of the activity connecting the immediate predecessor to node i.

ET(i) equals the maximum of the sums computed in previous step.

Page 49: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

49

To compute LT(i) we begin with the finish node and go backwards ,following the steps : Find each node that occurs after node i

and is connected to node i by an arc. These events are immediate successors of node i.

From the LT for each immediate successor to node i subtract the duration of the activity joining the successor the node i.

LT(i) is the smallest of the differences determined in previous step.

Page 50: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

50

Compute ET & LT

6

5

38

4 4

3

Figure 32

ET(3)=6, ET(4)=8, ET(5)=10

ET(6)=max{ET(3)+8, ET(4)+4, ET(5)+3} =14

4

7

53

64

5

Figure 33LT(5)=24, LT(6)=26, LT(7)=28

LT(4)=min{LT(5)-3, LT(6)-4, LT(7)-5} =21

p.434

Page 51: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

51

Example 6: Computation of ET

ET(1)=0ET(2)=ET(1)+9=9ET(3)=max{ET(1)+6=6, ET(2)+0=9}=9ET(4)=ET(3)+7=16ET(5)={ET(3)+8=17, ET(4)+10=26}=26ET(6)=ET(5)+12=38

1

65

42

3

A 6

B 9

Dummy

C 8

D 7

E 10

F 12

Page 52: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

52

Example 6: Computation of LT

LT(6)=38LT(5)=LT(6)-12=26LT(4)=LT(5)-10=16LT(3)=min{LT(4)-7=9, LT(5)-8=18}=9LT(2)=LT(3)-0=9LT(1)=min{LT(3)-6=3, LT(2)-9=0}=0

1

65

42

3

A 6

B 9

Dummy

C 8

D 7

E 10

F 12

Page 53: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

53

Table 13

Node ET(i)max

LT(i)min

1 0 0

2 9 9

3 9 9

4 16 16

5 26 26

6 38 38

Example 6:

1

65

42

3

A 6

B 9

Dummy

C 8

D 7

E 10

F 12

Page 54: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

54

For an arbitrary arc representing activity (i,j), the Fotal Float (TF), represented by TF(i,j), of the activity represented by (i,j) is the amount by which the starting time of activity (i,j), could be delayed beyond its earliest possible starting time without delaying the completion of the project.

Free Float(FF) is the amount by which the starting time of the activity corresponding to arc(i,j) can be delayed without delaying the start of any later activity beyond the earliest possible starting time.

Page 55: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

55

An activity with a total float of zero is a critical activity.

A path from node 1 to the finish node that consists entirely of critical activities is called a critical path.

Widgetco critical path is 1-2-3-4-5-6.

Page 56: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

56

Linear programming can be used to determine the length of the critical path.

Decision variable xij: the time that the event corresponding to node j occurs

Goal is to minimize the time required to complete the project, we use an objective function of: Z=xF-x1

for each activity (i,j), before j occurs, i must occur and activity (i,j) must be completed.

A critical path for this project network consists of a path from the start of the project to the finish in which each arc in the path corresponds to a constraint having a dual price critical path.

Page 57: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

57

Total Float (TF)

ij

ij

ij

ij

t)i(ET)j(LT)j,i(TF

t)i(ET)j(LTk

)j(LTtk)i(ET

time delayed:k

)j,i(activity of duration:t

Page 58: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

58

Free Float (FF)

ij

ij

ij

ij

t)i(ET)j(ET)j,i(FF

t)i(ET)j(ETk

)j(ETtk)i(ET

time delayed:k

)j,i(activity of duration:t

Page 59: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

59

Node ET(i) LT(i)

1 0 0

2 9 9

3 9 9

4 16 16

5 26 26

6 38 38

Activity TF(i,j) FF(i,j)

B TF(1,2)=LT(2)-ET(1)-9=0 FF(1,2)=ET(2)-ET(1)-9=0

A TF(1,3)=LT(3)-ET(1)-6=3 FF(1,3)=ET(3)-ET(1)-6=3

D TF(3,4)=LT(4)-ET(2)-7=0 FF(3,4)=ET(4)-ET(2)-7=0

C TF(3,5)=LT(5)-ET(3)-8=9 FF(3,5)=ET(5)-ET(3)-8=9

E TF(4,5)=LT(5)-ET(4)-10=0 FF(4,5)=ET(5)-ET(4)-10=0

F TF(5,6)=LT(6)-ET(5)-12=0 FF(5,6)=ET(6)-ET(5)-12=0

dummy TF(2,3)=LT(3)-ET(2)-0=0 FF(2,3)=ET(3)-ET(2)-0=0

k : delayed time

ET(i)= k + tij ≤ LT(j)

k ≤ LT(j) – ET(i) – tij

TF(i,j) = LT(j) – ET(i) – tij

FF(i,j) = ET(j) – ET(i) – tij

Page 60: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

60

Exercise : p.446 #2

Activity PredecessorsDuration

(wks.)

A = Design - 5

B = Make Part A A 4

C = Make Part B A 5

D = Make Part C A 3

E = Test Part A B 2

F = Assemble A and B C,E 2

G = Attach C D,F 1

H = Test Final Product G 1

Page 61: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

61

1 65

3

2

4

A5B4

C5

D3 G1

F2

7

E2

H1

Solution : p.446 #2

Page 62: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

62

Solution p.446 #2

ET(1) = 0 LT(1) = 0 TF(1,2) = 0 FF(1,2) = 0

ET(2) = 5 LT(2) = 5 TF(2,3) = 0 FF(2,3) = 0

ET(3) = 9 LT(3) = 9 TF(3,4) = 0 FF(3,4) = 0

ET(4) = 11 LT(4) = 11 TF(2,4) = 1 FF(2,4) = 1

ET(5) = 13 LT(5) = 13 TF(4,5) = 0 FF(4,5) = 0

ET(6) = 14 LT(6) = 14 TF(2,5) = 5 FF(2,5) = 5

ET(7) = 15 LT(7) = 15 TF(5,6) = 0 FF(5,6) = 0

TF(6,7) = 0 FF(6,7) = 0

The critical path is 1-2-3-4-5-6-7 (length 15 days).

Page 63: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

63

XYZ專案的相關作業及資料如下表。(1) 以 AOA 建立專案的網路圖 (2) 找出要徑(3) 若作業 G 開始時,因故延誤 10周,則會影響完成時間嗎 ?

作業 前置作業 預估週數 關鍵作業 ()

A ─ 4B A 12C ─ 6D C 10E D 8F A,D 17G E 50H B,G 15I B,H 5J H,I 3

Page 64: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

64

Page 65: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

65

成本與時間之取捨 (time-cost trade-off)

1.以各作業之正常時間尋找最長的一條或數條路徑。2. 在路徑上,以增加最少成本之方式縮短一項或數項作業,使得最長路徑降低一單位時間 ; 若無法降低,則停止。

3. 若最長路徑之時間符合要求,則停止 ; 否則繼續。4.以各作業目前之最長時間尋找最長的一條或數條路徑,然後返回 2 。

Page 66: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

66

教育訓練專案的相關作業及資料如下表。以 AOA 建立此專案的網路圖

作業 前置作業時間 成本

最大減少時間

單位壓縮成本正常 壓縮 正常 壓縮

A ─ 5 3 10 18 2 4

B ─ 7 5 15 20 2 2.5

C A 4 3 30 45 1 15

D A 3 2 10 15 1 5

E C 4 3 20 30 1 10

F E 5 3 32 48 2 8

G B,D 3 2 10 12 1 2

H G 6 2 15 24 4 2.25

I F,H 4 3 10 12 1 2

J F 2 2 28 28 0 ─

Page 67: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

67

Solution:

1

6

5

3

2

4

A5

B7

C4

D3

G3

F5

7

E4

H68

9

I4

J3(0,0)

(5,5)

(9,9) (13,13)

(18,18)

(22,22)

(8,9) (11,12)

(18,18)

Page 68: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

68

Solution:

1

4

3

2A3

B8

D4

C2

E5

F66

G4

H77

9I3

(0,0)

(13,13)

(20,20)

(8,8) (13,13)

5 8

(3,3) (7,7)

(23,23)

(8,16)

Page 69: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

69

要徑長度 要徑 壓縮時間 增加成本22 A-2, C-1, E-1, F-2, I-1 1 2

21 A-2, C-1, E-1, F-2, I-0

A-2, D-1, G-1 ,H-4, I-0 A 4

20 A-1, C-1, E-1, F-2, I-0

A-1, C-1, E-1, F-2, J-0

A-1, D-1, G-1, H-4, I-0 A,G 6

19 A-0, C-1, E-1, F-2, I-0

A-0, C-1, E-1, F-2, J-0

A-0, D-1, G-0, H-4, I-0

B-2, G-0, H-4, I-0 F,H 10.25

18 A-0, C-1, E-0, F-1, I-0

A-0, C-1, E-0, F-1, J-0

A-0, D-1, G-0, H-3, I-0

B-2, G-0, H-3, I-0

( 數字為可壓縮時間 )

Page 70: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

70

作業 A B C D E F G H I J

剩餘可壓縮時間 0 2 1 1 0 1 0 3 0 0

時間 3 7 4 3 3 4 2 5 3 2

專案時間由 22天縮短至 18天所增加之總成本為

2+4+6+10.25=22.25

取自上表長度 18之要徑

Page 71: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

71

PERT

CPM assumes that the duration of each activity is known with certainty. For many projects, this is clearly not applicable.

PERT is an attempt to correct shortcoming of CPM by modeling the duration of each activity as a random variable.

For each activity, PERT requires that the project manager estimate three quantities:

a = estimate of the activity’s duration under the most favorable conditions (optimistic time)

b = estimate of the activity’s duration under the least favorable conditions (pessimistic time)

m = most likely value for the activity’s duration

Page 72: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

72

Let Tij be the duration of activity (i,j). PERT requires the assumption that Tij follows a beta distribution. According to this assumption, it can be shown that the mean and variance of Tij may be approximated by

36

)(var

6

4)(

22 ab

T

bmaTE

ijij

ijij

Page 73: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

73

5 6 4 (node 1)

7 8 5 (node 2)

6(node 3)

3 (node 4)

1

42

3Supply 1

Supply 2

Demand 1

Demand 2

Min z=5x13+6x14+7x23+8x24

x13 x14 x23 x24 rhs node

0 1 0 0 = 4 10 0 1 1 = 5 2-1 0 -1 0 = -6 31 -1 0 -1 = -3 4

All variables non-negative

b1=4,b2=5,b3=-6,b4=-3

MCNFP Representation of Transportation Problem

Page 74: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

74

PERT requires the assumption that the durations of all activities are independent.

Let CP be the random variable denoting the total duration of the activities on a critical path found by CPM. PERT assumes that the critical path found by CPM contains enough activities to allow us to invoke the Central Limit Theorem and conclude that the following is normally distributed:

pathji

ijcp TE),(

)( : expected duration of activities on any path

pathji

ijcp T),(

2 var : variance of duration of activities on any path

thcriticalpaji

ijTCP),(

Page 75: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

75

8.5 Minimum Cost Network Flow Problems

The transportation, assignment, transshipment, shortest path, maximum flow, and CPM problems are all special cases of min cost network flow problems(MCNFP, 最小成本流量問題 ).

Any MCNFP can be solved by a generalization of the transportation simplex called the network simplex method( 網路單體法 ) .

p.450

Page 76: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

76

8.5 Minimum Cost Network Flow Problems

xij=number of units of flow sent from node i to node j through arc (i,j)

bi=net supply (outflow-inflow) at node i

cij=cost of transporting 1 unit of flow from node i to node j via arc (i,j)

Lij=lower bound on flow through arc (i,j)

Uij=upper bound on flow through arc (i,j)

MCNFP can be written as

network) the in arc each(for UXL

network) the in i node each(for b=X-X.t.s

Xcmin

ijijij

j k

ikiij

allarcs

ijij

≤≤

∑ ∑

p.450

Page 77: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

77

Special Case

轉運問題各弧無容量限制 (i.e. uij=∞)

運輸問題無轉運節點各弧無容量限制 (i.e. uij=∞)

指派問題無轉運節點各弧無容量限制 (i.e. uij=∞)供給點之 bi=1,需求點之 bi=-1

Page 78: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

78

Special Case最短路徑問題

只有一個供給節點 ( 起點 )及一個需求節點 ( 終點 )其餘均為轉運節點

供給節點之 bi=1,需求節點之 bi=-1,轉運節點之 bi=0

各弧無容量限制 (i.e. uij=∞)最大流量問題

只有一個供給節點 ( 起點 )及一個需求節點 ( 終點 )其餘均為轉運節點

供給節點之 bi=f,需求節點之 bi=-f, f 為任意節點之最大流量上限

加上弧 (1,n), u1n=∞ 所有 cij=0, 除 c1n=M

Page 79: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

79

8.6 Minimum Spanning Tree Problems

Suppose that each arc (i,j) in a network has a length associated with it and that arc (i,j) represents a way of connecting node i to node j.

In many applications it must be determined that the set of arcs in a network that connects all nodes such that the sum of the length of the arcs is minimized. Such a group of arcs contain no loop.

For a network with n nodes, a spanning tree is a group of n-1 arcs that connects all nodes of the network and contains no loops.

A spanning tree of min length in a network is a minimum spanning tree (MST, 最小擴張樹 ).

p.456

Page 80: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

80

The MST Algorithm

The MST Algorithm may be used to find a min spanning tree.Begin at any node i, and join node i to the node in the

network (call it node j) that is closest to node i.The two nodes i and j now form a connected set of

nodes C={i,j}, and arc (i,j) will be in the minimum spanning tree. The remaining nodes in the network (call them Ć) are referred to as the unconnected set of nodes.

Now choose a member of C’ (call it n) that is closest to some node in C. Let m represent the node in C that is closest to n. Then the arc(m,n) will be in the minimum spanning tree. Now update C and C’. Since n is now connected to {i,j}, C now equals {i,j,n} and we must eliminate node n from C’.

Repeat this process until a minimum spanning tree is found. Ties for closest node and arc to be included in the minimum spanning tree may be broken arbitrarily.

Page 81: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

81

Example 8: MST Algorithm

The State University campus has five computers. The distances between each pair os computers are given.

What is the minimum length of cable required to interconnect the computers?

Note that if two computers are not connected this is because of underground rock formations.

4

2

5

3

1

6

4

5

1

3

2

2

2

4

Page 82: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

82

Example 8: Solution

We want to find the minimum spanning tree. Iteration 1: Following the MST algorithm

discussed before, arbitrarily choose node 1 to begin. The closest node is node 2. Now C={1,2}, Ć={3,4,5}, and arc(1,2) will be in the minimum spanning tree.

4

2

5

3

1

6

4

5

1

3

2

2

2

4

Page 83: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

83

Iteration 2: Node 5 is closest to C. since node 5 is two blocks from node 1 and node 2, we may include either arc(2,5) or arc(1,5) in the minimum spanning tree. We arbitrarily choose to include arc(2,5). Then C={1,2,5} and Ć={3,4}.

4

2

5

3

1

6

4

5

1

3

2

2

2

4

Page 84: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

84

Iteration 3: Since node 3 is two blocks from node 5, we may include arc(5,3) in the minimum spanning tree. Now C={1,2,5,3} and Ć={4}.

4

2

5

3

1

6

4

5

1

3

2

2

2

4

Page 85: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

85

Iteration 4: Node 5 is the closest node to node 4. Thus, we add arc(5,4) to the minimum spanning tree.

The minimum spanning tree consists of arcs(1,2), (2,5), (5,3), and (5,4). The length of the minimum spanning tree is 1+2+2+4=9 blocks.

4

2

5

3

1

6

4

5

1

3

2

2

2

4

Page 86: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

86

Exercise : p.459 #1

begin at Gary and include the Gary‑South Bend arc.

add the South Bend‑Fort Wayne arc. add the Gary‑Terre Haute arc. add the Terre Haute‑Evansville arc. This MST has a total length of 58 + 79 + 164 + 113 = 414 miles.

Page 87: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

87

xij=number of units of flow sent from node i to node j through arc (i,j)

bi=net supply (outflow-inflow) at node i flo

cij=cost of transporting 1 unit of flow from node I to node j via arc (i,j)

Lij=lower bound on flow through arc (i,j)

Uij=upper bound on flow through arc (i,j)

network) the in arc each(for UXL

network) the in i node each(for b=X-X.t.s

Xcmin

ijijij

j k

ikiij

allarcs

ijij

≤≤

∑ ∑

p.450

MCNFP

Page 88: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

88

(4)

c12=5, c25=2, c13=4, c35=8, c14=7, c34=10, c45=5

b1=10, b2=4, b3=-3, b4=-4, b5=-7

U12=4, U25=10, U13=10, U35=2, U14=4, U34=5, U45=5

Lij=0

∑bi=0 adding a dummy node

4

(-3)

1 53

2

4 $7

10 $24 $5

5 $8

5 $5

10 $4

(-4)

(-7)(10)

5 $10

p.460Figure 51

Page 89: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

89

8.7 The Network Simplex Method

step1: ( 起始解 ) Determine a starting bfs. The n-1 BV will correspond to a spanning tree. Indicate NBV at their upper bounds by dashed arcs.

step2: (進入變數 ) Find y1, y2,…yn by solving y1=0, yi-yj= cij for all BV xij.For all NBV, determine the row 0 coefficient from =yi–yj–cij. The current bfs is optimal if ≤0 for all xij=Lij and ≥0 for all xij=Uij. If the bfs is not optimal, choose the NBV that most violates the optimality conditions as the entering BV.

ijcijc

ijc

p.459

Page 90: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

90

step3: ( 離開變數 )Identify the cycle (there will be exactly one!) created by adding the arc corresponding to the entering variable to the current spanning tree of the current bfs. Use conservation of slow to determine the new values of the variables in the cycle. The variable that exits the basis will be the variable that first hits its upper or lower bound as the value of the entering BV is changed.

step4: Find the new bfs by changing the flows of the arcs in the cycle found in step 3. Now go to Step 2.

Page 91: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

91

Basic feasible Solution for MCNFP

MCNFP contains 3 types of variable:1. BV : Lij < xij < Uij Indicated by

2. NBV1 : xij = Uij Indicated by

3. NBV2 : 0= Lij = xij

p.460

Page 92: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

92

p.460

Figure 52

4

1 53

2

4 $6

6 $65 $10

5 $7

6 $3

3 $12 (-10)

(10)

5 $3

2 $2

4

1 53

2

4

55

1

4

1 (-10)

(10)

Figure 53

BV={x13,x25,x35,x45}

NBV1={x12,x14}

NBV2={x32,x34}

起始解

Page 93: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

934

1 53

2

4

55

1

4

1

(-10)

(10)

1. y1=0, y1-y3=12,y2-y5=6,y3-y5=7,y4-y5=3

2. NBV1 : c12=3, c14=10

NBV2 : c32=-1, c34=1

4

1 53

2

4 $6

6 $65 $10

5 $7

6 $3

3 $125 $3

2 $2

進入變數1. Let y1=0, cij=yi-yj for each BV, solving yi .

2. Compute cij=yi-yj-cij for each NBV

Choose entering variable: (1) NBV1 (xij=Uij): cij<0

(2) NBV2 (xij=Lij) : cij>0

entering variable : x34

Page 94: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

94

4

1 53

2

4

55

1-θ

4+θ

1 (-10)

(10)

0+θ0+θ ≤ 5 1–θ ≥ 0 θ ≤ 14+θ ≤ 6

4

1 53

2

4

55

5

1 (-10)

(10)

1

離開變數

set θ =1 x35 leaves

Page 95: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

954

1 53

2

4

55

15

1

(-10)

(10)

1. y1=0, y1-y3=12,y2-y5=6,y3-y4=3,y4-y5=3

2. NBV1 : c12=2, c14=9

NBV2 : c32=-2, c35=-1

4

1 53

2

4 $6

6 $65 $10

5 $7

6 $3

3 $125 $3

2 $2

進入變數1. Let y1=0, cij=yi-yj for each BV, solving yi .

2. Compute cij=yi-y j for each NBV

Choose entering variable: (1) NBV1 (xij=Uij): cij<0

(2) NBV2 (xij=Lij) : cij>0

No entering variable

Page 96: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

96

Exampe 9 :p.463

Use the network simple to solve the MCNFP in Figure 56

3

1 4

2

7 $3

8 $37 $4

6 $2

5 $6

(-10)(10) 6 $1

Figure 56

Page 97: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

97

Figure 57

3

1 4

2

5

55

5

(-10)(10)

5

起始解

Page 98: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

98

Figure 58

3

1 4

2

5-θ≥0

5+θ≤85+θ≤7

5

(-10)(10)

5-θ≥0

進入變數 -- x34 離開變數 -- x12

Set θ=2 x12 leaves

Page 99: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

99

3

1 4

2

3

77

5

(-10)(10)

3

Figure 59

Page 100: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

100

3

4

27+θ≤8

5

(-10)

3-θ≥0

0+θ≤6

Figure 60

進入變數 -- x32 離開變數 -- x24

Set θ=2 x24 leaves

Page 101: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

101

3

1 4

2

3$3

8$37$4

5

(-10)(10)

2$6

1$2

Figure 61

BV: x13=3,x32=1,x34=2

NBV1:x12=7,x24=8

NBV2:x23=0

Z=7(4)+3(3)+1(2)+ 8(3)+ 2(6)=$75

最佳解

Page 102: Chapter 8 Network Models. 2 Four Specific Network Models Shortest Path Problem( 最短路徑問題 ) Maximum Flow Problem ( 最大流量問題 ) CPM( 要徑法 ) and PERT ( 計畫評核術

102

p.466

4

1

5

3

225$15

(-10)

(32)

30$5

12$11

∞$5

20$10

12$4

(-22)

∞$14

∞$5

4

1

5

3

220

10

1210

12