You are on page 1of 63

Prepared by: Engr. Romano A.

Gabrillo MEngg-MEM

A network is a set of points, called nodes, and a set of curves, called branches (or arcs or links), that connect certain pairs of nodes.
Only those networks with a given pair of nodes joined by at most one branch will be considered.

The figure below is a network consisting of five nodes, labeled A through E, and six branches defined by the curves AB, AC, AD, BC, CD, and DE.
B

D
3

A branch is oriented if it has a direction associated with it. Schematically, directions are indicated by arrows.
Two branches are connected if they have a common node. In the figure in Example No. 1, branches AB and AC are connected.

A path is a sequence of connected branches such that in the alternation of nodes and branches, no node is repeated.
A network is connected if for each pair of nodes in the network there exists at least one path joining the pair.

If the path is unique for each pair of nodes, the connected network is called a tree. Equivalently, a tree is a connected network having one more node than branch.

In the figure in Example No. 1, {ED, DA, AB} is a path, but the sequence of connected branches {CA, AD, DC, CB} is not a path, as node C occurs in it twice.
The network is connected and remains connected even if branches DA and AB are deleted. If, however, DE were deleted, the network would not be connected, since there would not be a path linking D with E. Because D and C are joined by three paths, the network is not a tree.
7

A minimum-span problem involves a set of nodes and a set of proposed branches, none of them oriented. Each proposed branch has a nonnegative cost associated with it.
The objective is to construct a connected network that contains all the nodes and is such that the sum of the costs associated with those branches actually used is a minimum.

It is not hard to see that a minimum-span problem is always solved by a tree. A minimal-spanning tree may be found by initially selecting any one node and determining which branch incident on the selected node has the smallest cost. This branch is accepted as part of the final network and is completed iteratively.

All branches linking these nodes to unconnected nodes are considered, and the cheapest such branch identified. Ties are broken arbitrarily. This branch is considered as part of the final network. The iterative process terminates when all nodes have been linked.

10

The nodes below represent the location of the houses of the seven professors in the Graduate School of Engineering of Jimma University. They need to know which unique path on the way to each other has the minimum cost of transportation. Solve the network using the Spanning Tree Algorithm. The number on each branches represent the cost in Birr.
E
10 7 2 8 5

B
1 4

10

F
7 3

C Figure 2.1

11

Arbitrarily choose A as the starting node and consider all branches incident on it; they are AE, AB, AD, and AC, with costs 10, 2, 1, and 4, respectively.
Since AD is the cheapest, we add this branch to the solution, as shown in Figure 2.2.

12

B D C Figure 2.2 G F

Nodes A and D are now connected. We now consider all branches incident on either A or D that connect to other nodes. Since DB is the cheapest to include, we adjoin it to Figure 2.2

13

B C

F G

Figure 2.3

The connected nodes are now A, B, and D. We next consider all branches incident on A, B, or D that connect to other nodes and produce the following figures

14

D
C
4

F G

Figure 2.4

B A
1

F
3

Figure 2.5

15

B A
1

D C
4

F
3 3

Figure 2.6

B A
1

D C
4 3

F
3

Figure 2.7

z* = 1 + 1 + 4 + 3 + 3 + 5 = 17

16

The Ethiopian Ministry of Tourism plans to develop a wilderness area for tourists. Four locations in the area are designated for vehicular access. These sites, and the distances (in miles) between them are listed in Table 3.1. To inflict the least harm on the environment, the Ethiopian Road Authority wants to minimize the miles of roadway to provide the desired accessibility. Determine how roads should be built to achieve this objective.
RAG-2012
17

Park Entrance Park Entrance Wild Falls Majestic Rock Sunset Point The Meadow 7.1 19.5 19.1 25.7

Wild Falls 7.1 8.3 16.2 13.2

Majestic Rock 19.5 8.3 18.1 5.2

Sunset Point 19.1 16.2 18.1 17.2

The Meadow 25.7 13.2 5.2 5.2

RAG-2012

18

This is a minimum-span problem. The nodes are the four locations to be developed and the park entrance, while the proposed branches are the possible roadways linking the sites. The cost are the mileages. The complete the network is shown in Fig. 3.1, where each site is represented by the first letter of its name.
RAG-2012

19

W S

13.2

M T

RAG-2012

20

We arbitrarily select Park Entrance as the initial node. The costs of the branches incident on this node are listed in the first row of Table 3.1. Since the lowest costs is 7.1, we add the branch from Park Entrance to Wild Falls to the network.
We next consider all branches joining either Park Entrance or Wild Falls to a new site. These are the branches from Park Entrance to Majestic Rock, Sunset Point, and The Meadow, as well as those from Wild Falls to the same three sites.
RAG-2012
21

Of these, the cheapest branch is the one from Wild Falls to Majestic Rock; so we adjoin it to the network.
Continuing in this manner gives us the final network beside:
RAG-2012

W S

M T Z * = 7.1 + 8.3 + 5.2 + 16.2 = 36.8 mi


22

1.

Solve the minimum-span problem shown in the figure below:

RAG-2012

23

RAG-2012

24

A shortest-route problem involves a connected network having a nonnegative cost associated with each branch. One node is designated as the source, and another node is designated as the sink.
The objective is to determine a path joining the source and the sink such that the sum of the costs associated with the branches in the path is a minimum.

25

Shortest-Route Problems are solved by the Cheapest-Path algorithm, in the application of which all ties are to be broken arbitrarily. Step 1 Construct a master list by tabulating under each node, in ascending order of cost, the branches incident on it. Each branch under a given node is written with that node as its first node. Omit from the list any branch having the source as its second node or having the sink as its first node.
26

Step 2 Star the source and assign it the value 0. Locate the cheapest branch incident on the source and circle it. Star the second node of this branch and assign this node a value equal to the cost of the branch. Delete from the master list all other branches that have the newly starred node as second node.

Step 3 If the newly starred node is the sink, go Step 5. If not, go to Step 4.

27

Step 4 Consider all starred nodes having uncircled branches under them in the current master list. For each one, add the value assigned to the node to the cost of the cheapest uncircled branch under it. Denote the smallest of these sums as M, and circle that branch whose cost contributed to M. Star the second node of this branch and assign it the value M. Delete from the master list all other branches having this newly starred node as second node. Go to Step 3.
28

z* is the value assigned to the sink. A minimum-cost path is obtained recursively, beginning with the sink, by including in the path each circled branch whose second node belongs to the path.

29

An individual who lives in Ridgewood, New Jersey, and works in Whippany, seeks a car route that will minimize the morning driving time. This person has recorded driving times (in minutes) along major highways between different intermediate cities; these data are shown in Table 4.1. A blank entry signifies that no major highway directly links the corresponding points. Determine the best commuting route for this individual.
30

Ridgewood Clifton Orange Troy Hills Parsippany Whippany

Ridgewood Clifton Orange Troy Hills Parsippany Whippany 18 32 18 12 28 12 17 32 32 28 17 4 17 4 11 32 17 11

Table 4.1

This situation may be modeled as a shortestroute problem. The nodes are the cities, the branches are the connecting highways, and the costs associated with the branches are the travel times. The source is RidgeWood, and the sink is Whippany.
31

Step 1: Table 4.2 lists each city represented by the first letter in its name. Branches CR and TR are absent under C and T, respectively; these appear as RC and RT, under the source only. Similarly, no branches are listed with the sink as first node.

R RC RT 18 32 CO CT

C 12 28 OC OT OW

O 12 17 32 TP TW TO TC

T 4 17 17 28 PT PW

P 4 11

Table 3.2
32

Step 2: Star the source node R, and assign it the value 0. The cheapest branch leaving R is RC; so we star C and assign it the value 18, the cost or RC. Circle branch RC and then delete from Table 3.2 all other branches whose second node is C, i.e. OC and TC. The new table is Table 4.3

R*(0) RC 18 RT 32

C*(18) CO 12 CT 28

O OT OW 17 32 TP TW TO

T 4 17 17 PT PW

P 4 11

Table 4.3
33

Step 3: The newly starred node is not the sink so proceed to step 4. Step 4: The starred nodes are R and C. The sums of interest are 0 + 32 = 32 under R, obtained by adding the value of R to the cost of RT, and 18 + 12 = 30 under C, obtained by adding the value of C to the cost of CO. Since CO is the smaller sum, we circle CO, start O, assign O the value of 30, and delete from Table 4.3 all other branches having O as second node, i.e. TO. The result is Table 4.4.
34

R*(0) RC 18 RT 32

C*(18) CO 12 CT 28

O*(30) OT OW 17 32 TP TW

T 4 17 PT PW

P 4 11

Table 4.4

Step 4: The starred nodes are R, C, and O. The sums of interest are 0 + 32 = 32 under R, 18 + 28 = 46 under C, and 30 + 17 = 47 under O. The smallest sum is 32, hence we circle RT, star T, assign T the value of 32, and delete from Table 3.4 all other branches with second node T. The result is shown in Table 4.5.
35

R*(0) RC 18 RT 32

C*(18) CO 12

O*(30)

T*(32) TP 4 TW 17

P PW 11

OW

32

Table 4.5

Step 4: The only starred nodes having uncircled branches under them in the current table are O and T. For these nodes, the sums of interest are 30 + 32 = 62 and 32 + 4 = 36, respectively. Therefore, we circle TP, star P, assign P the value of 36, and delete all other branches with second node P, of which there are none. The new table is shown in Table 4.6.
36

R*(0) RC 18 RT 32

C*(18) CO 12

O*(30)

T*(32) TP 4 TW 17

P*(36) PW 11

OW

32

Table 4.6

Step 4: The only starred nodes having uncircled branches under them in the new table are O, T and P. The sums of interest are, respectively, 30 + 32 = 62, 32 + 17 = 49, and 36 + 11 = 47. Since 47 is the smallest, we circle PW, star W (the sink), assign W the value of 47, and delete from Table 3.6 all other branches having W as second node. The result is shown in Table 4.7.
37

R*(0) RC 18 RT 32

C*(18) CO 12

O*(30)

T*(32) TP 4

P*(36) PW 11

W*(47)

Table 4.7

Step 5: The minimum driving time from Ridgewood to Whippany is z* = 47 min. To identify the optimal path, we search Table 4.7 for a circled branch having W as second node; its PW. Next we search for a circled branch having P as second node; it is TP. Then we search for a circled branch having T as second node; it is RT. Since R is the source, the desired path is {RT, TP, PW}. Meaning the shortest-route with the cheapest-path is from RidgeWood (the source), then Troy Hills, to Parsippany, and finally arriving to the sink which is Whippany.
38

Apply the Shortest-Route Problem in your own way from your house as the source, and Jimma University as the sink. Assign at least 6 stations on your way to JU and record the time it takes for you to arrive there. You can specify a blank entry signifying a nonroute path from stations.
Use the Cheapest-Path Algorithm to solve the problem and be ready to present it in class next meeting.
RAG-2012
39

A Maximal-Flow Problem is a network with source, sink, and junctions represented by nodes, while the branches represent the conduits through material is transported.
The point of origin is called the source; the destination is called the sink. Various shipping lanes exist which link the source and sink directly or via intermediate locations called junctions.

40

It is assumed that junctions cannot store materials; that is, any material arriving at a junction is shipped immediately to another location.
Associated with each node N and each branch NM emanating from N is a nonnegative number, or capacity, representing the maximum amount of material that can be shipped through NM from N.

41

Its objective is to develop a shipping schedule that maximizes the amount of material sent between two points.
A Maximal-Flow Problem can be solved through a Maximal-Flow Algorithm.

RAG-2012

42

Step 1 Find a path from source to sink that can accommodate a positive flow of material. If none exists, go to Step 5.
Step 2 Determine the maximum flow that can be shipped along this path and denote it by k.

43

Step 3 Decrease the direct capacity (i.e., the capacity in the direction of flow of the k units) of each branch of this path by k and increase the reverse capacity by k. Add k units to the amount delivered to the sink. Step 4 Go to Step 1.

44

The maximal flow is the amount of material delivered to the sink. The optimal shipping schedule is determined by comparing the original network with the final network. Any reduction in capacity signifies a shipment.

45

Determine the maximal flow of material that can be sent from Jimma to Addis Ababa through the network shown below:

0 8 10

B
5 5

Jimma

A
7

D
0

Addis Ababa

10

Figure 5.1
46

Figure 5.1 is a network having A as the source, D as the sink, and B and C as junctions. The capacities of each branch for flows in the two directions are indicated near the ends of the branch.
Note that 7 units can be shipped from A to C along AC, but 0 units can be shipped in the opposite direction; this asymmetry allows us, if we wish, to define an orientation of AC. In contrast, flows along BC can move in either direction, with a capacity of 5 units either way.
47

Step 1: One path from source to sink is the branch AD linking these two nodes directly. It can accommodate 8 units.
Step 2: Shipping this amount, we deliver 8 units to D. Step 3: Decrease the capacity of AD by 8, and increase the capacity of DA by 8 as shown in Figure 5.2.

0 0 10

B
5 5

Source (-8)

A
7

D
0

Sink (+8)

10

Figure 5.2
48

Step 4: Go to Step 1.
Steps 1-3: Another path from source that can accommodate positive flow is {AC, CB, BD}. The maximum amount of material that can be sent along this path is 4 units, the capacity of BD. Making such shipment, increases the capacity of D by 4 units, 8 + 4 = 12 and decreasing the capacities of BD, CB, and AC by 4 units and increasing the amount of DB, BC, and CA as shown in Figure 5.3.

0 0 10

B
9 1

Source (-12)

A
3

D
0

Sink (+12)

10

Figure 5.3
49

Step 4: Go Step 1. Steps 1-3: Path {AC, CD} in Figure 5.3 can accommodate 3 units from A to D. Making this shipment, we increase the supply at D by 3 units to 12 + 3 = 15, and decrease the capacities of CD and AC by 3. We also increase by 3 units the capacities of DC and CA. The new network is shown in Figure 5.4.

0 0 10

B
9 1

Source (-15)

A
0

D
3

Sink (+15)

Figure 5.4
50

Step 4: Go to Step 1. Steps 1-3: Path {AB, BC, CD} in Figure 5.4 can accommodate 7 units from source to sink. Making this shipment, we increase the supply at D to 15 + 7 = 22 units, an decrease the capacities of CD, BC, and AB by 7. We also increase by 7 units the capacities of DC, CB, and BA. The result is shown in Figure 5.5.

7 0 3

B
2 8

Source (-22)

A
0

D
10

Sink (+22)

Figure 5.5
51

Step 4: Go to Step 1. Step 1: There is no path from source to sink in Figure 5.5 that permits a positive flow. Step 5: Therefore, the maximum amount of material that can be sent from A to D is 22 units. To determine the optimal shipping schedule, we compare Figure 5.5 with Figure 5.1. Note the following reductions in capacity; 7 units from A to B, 8 units form A to D, 7 units from A to C, 4 units from B to D, 3 units from B to C, and 10 units from C to D. These reductions, considered as shipments, constitute the optimal shipping schedule.
52

The difficult aspect of the maximal-flow algorithm is Step 1 identifying a path from source to sink with positive flow capacity.
To discover such a path, first connect to the source all nodes that can be reached by a single branch having positive flow capacity in the forward direction (the direction out of the source)

53

Connect these nodes to all new nodes that can be reached by single branches having positive forward capacities.
Continue these process until either the sink is reached-in which case an appropriate path has been identified-or no new nodes can be reached from existing ones and the sink has not been reached-in which case no appropriate path exists.

54

In the figure below, identify a path from source A to sink G that can accommodate positive flow.
0 2

B
0

0 7 1

E
2

3 0 1

A
0

1 0 5 4 0 5

5 2 3

C
2 0

Figure 6.1
4

0 1

D
55

We begin with the source and find all nodes that can be reached directly from along branches allowing positive flow out of A. They are B, E, and F as shown in Figure 6.1.
0 2

B
0

0 7 1

E
2

3 0 1

A
0

1 0 5 4 0 5

5 2 3

C
2 0

Figure 6.2
4

0 1

D
56

Focusing on B first, we identify all nodes not shown in Figure 6.2 that can be reached from B along branches allowing positive flow out of B. There are none such. Focusing on E, we see that A, B, and C can be reached along branches allowing positive flow out of E; but since A and B already appear in Figure 6.2, only C is added.

From F, nodes A and D can be reached along branches allowing positive flow; but since A already appears in Figure 6.2, we add only D. The result is shown in Figure 6.3.
57

0
2

B
0

0 7 1

E
2

0 2

3 0 1

A
0

1 0 5 0 5

5 2 3

C
2

Figure 6.3
4

0 1

We now consider nodes C and D successively. Focusing on C first, we determine that A, B, E, and D, can be reached directly from C along branches with positive flow out of C.
58

Since each of these nodes already appears in Figure 6.3, we make no adjustments to it and consider next node D.
From D, we can reach A and G along branches allowing positive flow. Since only G is new, we adjoin it to Figure 6.3 obtaining Figure 6.4.

59

0
2

B
0

0 7 1

E
2

0 2

3 0 1

A
0

1 0 5 0 5

5 2 3

C
2

Figure 5.4
4

0 1

If follows from this last figure that {AF, FD, DG} is a path from source to sink that can accommodate a positive flow (of 1 unit).
60

1.

Determine the maximum amount of material that can be shipped from A to H through the network shown below: (assuming that the numbers on the branches represent the flow capacities in both direction)

RAG-2012

61

RAG-2012

62

Insert Calendar of May 2012 here.

RAG-2012

63

You might also like