network analysis

26
Engineering Management 12/19/2013 M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 1 Network Analysis MD. MOUDUD HASAN LECTURER,AIE,HSTU. Network Analysis Network Analysis.- OR technique(s) for the solution of problems based on the visual and conceptual representation of the interrelationships between the components of a system. A network consists of a set of points and a set of lines connecting certain points. The points are called nodes. The lines are called arcs (edges, branches). The arcs may have certain flow. If the flow can go in only one direction in the arc, the arc is said to be directed arc, if not the arc is undirected (or links).

Upload: moudud-hasan

Post on 23-Jun-2015

69 views

Category:

Education


4 download

DESCRIPTION

engineering management

TRANSCRIPT

Page 1: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 1

Network Analysis

MD. MOUDUD HASAN

LECTURER,AIE,HSTU.

Network Analysis Network Analysis.- OR technique(s) for the solution of problems based on the visual and conceptual representation of the interrelationships between the components of a system.

A network consists of a set of points and a set of lines connecting certain points.

The points are called nodes.

The lines are called arcs (edges, branches).

The arcs may have certain flow.

If the flow can go in only one direction in the arc, the arc is said to be directed arc,

if not the arc is undirected (or links). •

Page 2: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 2

Examples of Network Applications

Network Terminology

A network that has only directed arcs is said to be a directed network. If all the arcs are undirected, the network is undirected.

A path between two nodes is a sequence of arcs connecting them. A directed path from node i to node j allows flow from node i to j. An undirected path from i to j allows flow in either direction.

Page 3: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 3

Network Terminology A path that begins and ends at the same node is called a cycle. A cycle can be directed or undirected if the path is directed or undirected.

Two nodes are connected if the network contains at least one undirected path between them

A connected network is a network where every pair of nodes is connected.

A tree is a connected network with no cycles. A spanning tree is a tree connecting all the nodes of a network.

Arc capacity is the maximum amount of flow that can be carried on a directed arc.

In a supply node the flow out exceeds the flow in. The opposite occurs in a demand node. In a transshipment node, flow in = flow out.

Directed and Undirected Arcs Directed arcs- used to represent cases when flow is allowed only one direction. Examples: traffic in one-way streets, water flow in channels, etc. They are graphically represented with arrows.

Undirected Arcs (link)- used to represent cases when flow is allowed in both directions. Examples: traffic in two-way streets, pipes allowing flow in both direction, etc. They are graphically represented with a simple straight line.

Page 4: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 4

Directed and Undirected Networks

Directed Network

Undirected Network

1

2

3

4

6

7

5

8

1

2

3

4

6

5

7

Paths

1

2

3

4

6

7

5

8

Directed Path

Undirected Path

Directed Cycle

Undirected Cycle

Page 5: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 5

Network Problems

Some problems typically solved by using network methods: 1. Minimum Spanning Tree

2. Shortest Route

3. Maximum Flow

4. Critical Path

Examples of Network Problems Minimum Spanning Tree- The objective is to connect all of the

nodes of a network with links that minimize the total “cost” (“cost” could be time, distance, etc.)

• Common Examples:

Design of computer networks

Design of a network of roads

Shortest Route- The objective is to minimize the “cost” to go from a Node A (the origin) to a Node B (the destination)

• Common Examples:

Selection of highways to go from City A to City B such that the total traveled distance is minimized.

Deciding what branches of a pipeline to build to connect City A to City B such that the total cost is minimized.

Page 6: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 6

Examples of Network Problems

Maximum Flow- The objective is to maximize the flow that can be sent from one node (the source) to another (the sink)

• Common Examples:

Traffic management

Logistics systems

Critical Path- The objective is to minimize the time it takes to complete the total project

• Common Example:

Project Management (CPM & PERT Networks)

Minimum Spanning Tree

A minimum spanning tree is the set of the arcs of a network that have the shortest total length while providing a route (path) between each pair of nodes.

• For a spanning tree to be a minimum spanning tree, it has to satisfy the path optimality conditions

Page 7: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 7

Applications? Constructing highways or railroads spanning several cities

Laying pipelines connecting offshore drilling sites, refineries, and consumer markets

Designing computer networks

Others?

Algorithm for Minimum Spanning Tree Problem

Procedure:

1. Select any node arbitrarily and then connect it to the nearest distinct node.

2. Identify the unconnected node that is the closest to a connected node, and then connect these two nodes (ties may be broken arbitrarily). Repeat this until all nodes have been connected.

Page 8: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 8

Example1

1

3

2

6

7

8

7

7

8

2

6

4

7

6

8

Select any node

Connect the closest node

Select the closest node to any of the connected nodes

V13, V37, V27, V67, V68,=1 w(T) = 7+6+2+6+4=25

Select the closest node to any of the connected nodes

Example2

Apply the procedure to solve the minimum spanning tree for the graph shown below:

3

8

8

5

9

6 8

2 7

2

1

Page 9: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 9

Kruskal’s Algorithm (a more refined greedy algorithm)

A more efficient algorithm (and also optimal) for obtaining the minimum spanning tree

Sort all the arcs in non-decreasing order of cost

Define a set, LIST, that is the set of arcs chosen as part of a minimum spanning tree

Initially LIST is empty

Examine the arcs in the sorted order one by one and check whether adding the arc we are currently examining to LIST creates a cycle with the arcs already in LIST. If not, add arc to LIST, otherwise discard it.

Terminate procedure when the cardinality of LIST equals the number of vertices less one. The result is minimum spanning tree T*

Example3

1

3

2

6

7

8

7

7

8

2

6

4

7

6

8

V27

From the sorted list, select the least cost arc

V27 ,V68

V27 ,V68 ,V37

V27 ,V68 ,V37 ,V67

Selecting this arc, will create a cyclewe skip it

V27 ,V68 ,V37 ,V67 ,V13

Since the number of arcs is n-1 (number of nodes –1), we stop

From the sorted list select the least cost arc

Page 10: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 10

Shortest Route Problem Objective: To determine the shortest route (path) from the source node to a destination node.

Alternatively, we could define the shortest path problem as determining how to send 1 unit of flow as cheaply as possible from the source node to another node in an incapacitated network.

Corresponding to each arc (i,j), there is a non-negative number dij called the distance from i to j (dij = if we cannot get from i to j directly).

Example: Find the shortest route between Nodes 1 and 8.

1

3

2

5

4

6

7

8

2

1

4

1 2

1

2

5

3

3

7

6

3

5

2

6

Applications

Want to send a truck from a DC to a customer.

Want to send a message across a telecommunications network.

What does “shortest” mean in these cases?

Page 11: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 11

Dijkstra's Algorithm

Dijkstra’s algorithm is an efficient method to find the shortest path between two nodes.

Some of the characteristics of the algorithm:

• Assigns a temporary (unsolved) or permanent (solved) label to each node in the network.

• The temporary (unsolved) label is an upper bound on the shortest distance from the source (origin) node to that node.

• The shortest route from the source to a node is given by the permanent label.

Steps of the Shortest Path (Dikjstra’s) Algorithm Objective of the nth iteration: Find the nth nearest node to the origin.

Input for the nth iteration: n-1 nearest nodes to the origin (solved at the previous iteration), including their shortest path and the distance from the origin (call these solved nodes).

Candidates for the nth nearest node: Each solved node that is directly connected by a link to one or more unsolved nodes provides one candidate - the unsolved node with the shortest connecting link (ties provide additional candidates).

Calculation of the nth nearest node: For each such solved node and its candidate, add the distance between them and the distance of the shortest path from the origin to the solved node. The candidate with the smallest such total distance is the nth nearest node (ties provide additional solved nodes), and its shortest path is the one generating this distance.

Page 12: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 12

The Park management needs to find the shortest path from the park entrance (node O) to the scenic wonder (node T) through the road system shown in Fig.

2 2

4 1

5

3

4

7

1

5

A

7

o

C

B D

E

T 4

EXAMPLE:

n

Solved Nodes Directly

Connected to Unsolved Nodes

Closest Connected Unsolved Node

Total Distance Involved

nth Nearest Node

Minimum Distance

Last connection

1 O A 2 A 2 OA

2

O C 4 C 4 OC

A B 2+2=4 B 4 AB

3

A D 2+7=9

B E 4+3=7 E 7 BE

C E 4+4=8

A D 2+7=9

B D 4+4=8 D 8 BD

E D 7+1=8 D 8 ED

D T 8+5=13 T 13 DT

E T 7+7=14

Possible Shortest paths are i) OA(2) --- AB(2)---BD(4)-----DT(5)=13 ii) OA(2) --- AB(2)---BE(3)--ED(1)-----DT(5)=13

Page 13: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 13

Find the shortest path from the node O to the node T through the road system shown in Fig.

7

1

3

4

4

1

6

1

1

2

A

4

o C

B

D

F

T

3

Problem:

E

5

Flow Network Definition

It is a weighted directed graph G=(V,E) where every edge has a non-negative weight called capacity and receives a flow on each edge.

It has two distinguished vertices s and t (source and sink) such that s has no incoming edges and t has no outgoing edges.

Application:

Flow networks can be used to model traffic in roads, fluids flow in pipes, current flow in electrical systems, etc

Maximum Flow :

Page 14: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 14

2. Flow definition

It is a function f : V x V → R that satisfies

o Capacity constraint

o Flow conservation : for u, v Є V- {s,t}

The value of the flow, denoted |f|, is the total flow from the source s; and in the same way, to the sink t.

Max Flow Problem

Given a network G, a flow is said to be maximum if |f| is the largest of all flows in G.

The Max Flow Problem consists of finding the maximum feasible flow from s to t without violating any capacity constraints.

| f | max = 4 + 3 + 3 = 10

Page 15: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 15

29

Residual networks:

• Given a flow network and a flow, the residual network consists of edges that can admit more net flow.

• G=(V,E) --a flow network with source s and sink t

• f: a flow in G.

• The amount of additional net flow from u to v before exceeding the capacity c(u,v) is the residual capacity of (u,v), given by: cf(u,v)=c(u,v)-f(u,v)

in the other direction: cf(v, u)=c(v, u)+f(u, v).

30

s

20

7 9

v2 v4

t

v3 v1 16

13

12

10 4

4

14

4/9 s

v2 v4

t

v3 v1 4/16

13

4/12

10 4

20

4/4

7

4/14

(a)

Example of residual network

Page 16: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 16

31

5

s

v2 v4

t

v3 v1 12

13

8

10 4

20

4

7

4

4 4

4

10

(b)

Example of Residual network (continued)

32

Augmenting paths:

• Given a flow network G=(V,E) and a flow f, an augmenting path is a simple path from s to t in the residual network Gf.

• Residual capacity of p : the maximum amount of net flow that we can ship along the edges of an augmenting path p, i.e., cf(p)=min{cf(u,v):(u,v) is on p}.

2 3 1

The residual capacity is 1.

Page 17: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 17

33

5

s

v2 v4

t

v3 v1 12

13

8

10 4

20

4

7

4

4 4

4

10

(b)

Example of an augment path (bold edges)

Determine the maximum flow in the network of Determine the maximum flow in the network of this figure. Source 1 to sink 5.

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Page 18: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 18

Steps: • Step 1: start from source node (S1)

• Step 2: find connection with that node where flow is possible. e.g – t2, t3, t4

• Step3: identify maximum flow capacity among these node. e.g- t3

• Step 4: connect source node (S1) to maximum capacity node (t3) .

• Step 5: now find connection with t3 where flow is possible. e.g. – t4 , t5

• Step 6: identify maximum flow capacity among these node. e.g- t5

• Step 6: connect source node (t3) to maximum capacity node (t5) .

• Step 7: continue this until reach at sink node.

• Step 8: find minimum flow capacity along the augmenting path and that is the assign flow fi.

• Step 9: draw residual network.

• Step 10: repeat step 1 to 9 until there are no more augmenting paths.

• Step 11: find maximum flow capacity, � = ∑��

Step-1

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Page 19: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 19

Step-2

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Step-3

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Page 20: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 20

Step-4

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Step-5

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Page 21: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 21

Step-6

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Step-7

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Page 22: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 22

Step-8

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

Step-9

1

5

0

0

0

20

20

0

0

0

10

2

4

3

5

10

30

20

0

30

40

f1=20

Page 23: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 23

Iteration-1 Step-10

1

5

0

20

20

0

20

0

0

0

10

2

4

3

5

10

10

20

0

30

40

f1=20 Cr13=(30-20)=10 Cr35=(20-20)=0

Augmenting path: 1-3-5

Iteration-2 Step-10

1

15

10

20

20

0

10

10

10

0

10

2

4

3

5

0

10

10

0

30

30

f2=10

Augmenting path: 1-2-3-4-5

Page 24: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 24

Iteration-3 Step-10

1

15

10

20

20

0

10

10

20

0

10

2

4

3

5

0

10

0

10

20

30

f3=10

Augmenting path: 1-2-5

Iteration-4 Step-10

1

15

0

30

20

0

10

10

20

0

10

2

4

3

5

0

0

0

20

10

40

f4=10

Augmenting path: 1-3-2-5

Page 25: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 25

Iteration-5 Step-10

1

15

0

30

20

0

0

20

20

10

0

2

4

3

5

0

0

0

20

10

40

f5=10

Augmenting path: 1-3-2-5

Iteration-6 Step-10

1

15

0

30

20

0

0

20

20

10

0

2

4

3

5

0

0

0

20

10

40

Augmenting path: no more path

Page 26: Network analysis

Engineering Management 12/19/2013

M M Hasan, Lecturer, AIE, HSTU, Dinajpur. 26

Step:11 Iteration Augmenting path Flow amount

1 1 -ᗒ3 -ᗒ5 20

2 1 -ᗒ2 -ᗒ3 -ᗒ4 -ᗒ5 10

3 1 -ᗒ2 -ᗒ5 10

4 1 -ᗒ3 -ᗒ2-ᗒ5 10

5 1 -ᗒ4 -ᗒ5 10

Maximum flow: 60