0% found this document useful (0 votes)
16 views

Week9

The document discusses network models in operations research, focusing on concepts such as graphs, nodes, arcs, chains, and paths. It introduces Dijkstra’s Algorithm for finding the shortest path in a network and explains its application through examples. Additionally, it covers maximum-flow problems, minimum-cost network flow problems, and minimum spanning trees, including algorithms like Prim’s Algorithm for optimizing network connections.

Uploaded by

senasivrikaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Week9

The document discusses network models in operations research, focusing on concepts such as graphs, nodes, arcs, chains, and paths. It introduces Dijkstra’s Algorithm for finding the shortest path in a network and explains its application through examples. Additionally, it covers maximum-flow problems, minimum-cost network flow problems, and minimum spanning trees, including algorithms like Prim’s Algorithm for optimizing network connections.

Uploaded by

senasivrikaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

EMÜ 222

Deterministic Operations
Research
2023-2024 Spring

Week 9
Network Models

Winston W.L., Operations Research, Chapter 8


Basic Definitions

- A graph (or network) is defined by two sets of symbols:


nodes and arcs.
- Vertices (nodes)
- Arcs: Ordered pair of vertices that represent a possible
direction of motion between vertices.

Example of a network with 4


vertices, 5 arcs
Arc (i,j): starts at node i,
terminates at node j
i: initial node, j: terminal node
Basic Definitions

- Chain: A sequence of arcs, such that every arc has exactly


one vertex in common with the previous arc.
- Path: A chain in which the terminal node of each arc is
identical to the initial node of the next arc.

Which is a chain? Which is a path?

(1,2)-(2,3)-(4,3)
(1,2)-(2,3)-(3,4)
Shortest Path Problems

The problem of finding the shortest path (path of


minimum length) from the initial node to any other node
in the network.

Example. Power is sent


from node 1 to node 6,
through substations 2-5.
The distances are given
next to each arc.
What is the minimum
possible distance?
Dijkstra’s Algorithm

Finds the shortest path between node 1 and other nodes


for a graph with nonnegative arc lengths.

Example 1.
Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞

Node 1 is set permanent.


* indicates a permanent label.
Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* min{∞,0+4} min{∞,0+3} ∞ ∞ ∞
4 3*
Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 4 3* ∞ ∞ ∞
0* 4* 3* ∞ min{∞,3+3} ∞
6
Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 4 3* ∞ ∞ ∞
0* 4* 3* ∞ 6 ∞
0* 4* 3* min{∞,4+3} min{6,4+2} ∞
7 6*
Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 4 3* ∞ ∞ ∞
0* 4* 3* ∞ 6 ∞
0* 4* 3* 7 6* ∞
0* 4* 3* 7* 6* min{∞,6+2}
8
Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 4 3* ∞ ∞ ∞
0* 4* 3* ∞ 6 ∞
0* 4* 3* 7 6* ∞
0* 4* 3* 7* 6* 8
0* 4* 3* 7* 6* min{8,7+2}
8*

Shortest path from node 1 to 2 has length 4.


Shortest path from node 1 to 4 has length 7.
Shortest path from node 1 to 6 has length 8.
Dijkstra’s Algorithm

1 2 3 4 5 6
0* 4* 3* 7* 6* 8*

How to find the nodes passed on the path?


Work backwards.
Going from 1 to 6: Which node precedes 6? 4 or 5?

4 6 Label of 4: 7
Label of 5: 6
If 4 is used, I would reach 6 in (7+2=9).
5 6 If 5 is used, I would reach 6 in (6+2=8).

I reach 6 in 8 units, so 5 is the preceding node.


Dijkstra’s Algorithm

1 2 3 4 5 6
0* 4* 3* 7* 6* 8*

→5 →6
Which node precedes 5?
Label of 2: 4
2 5 Label of 3: 3
If 2 is used, I would reach 5 in (4+2=6).
If 3 is used, I would reach 5 in (3+3=6).
3 5
I reach 5 in 6 units, so either 2 or 3 is the preceding
node.
Dijkstra’s Algorithm

1 2 3 4 5 6
0* 4* 3* 7* 6* 8*

For; For;
→ 3→5 →6 → 2→5 →6
Which node precedes 3? Which node precedes 2?
Node 1. Node 1.

1→ 3→5 →6 1→ 2→5 →6
Example 2.
Example 2.

c12= c23 = c34 = c45 = c56 = 7


c13= c24 = c35 = c46 = 12
c14= c25 = c36 = 21
c15= c26 = 31 c16 = 44
Example 2.

Find the shortest path between nodes 1 and 6.

An example path 1-3-6


Purchase at the beginning of 1.
Sell & purchase at the beginning of 3.
Sell at the beginning of 6.
Example 2.

Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
Example 2.

Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 7* 12 21 31 44
Example 2.

Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 7* 12 21 31 44
0* 7* min{12,7+7} min{21,7+12} min{31,7+21} min{44,7+31}
12* 19 28 38
Example 2.

Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 7* 12 21 31 44
0* 7* min{12,7+7} min{21,7+12} min{31,7+21} min{44,7+31}
12* 19 28 38
0* 7* 12* min{19, 12+7} min{28,12+12} min{38,12+21}
19* 24 33
Example 2.

Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 7* 12 21 31 44
0* 7* min{12,7+7} min{21,7+12} min{31,7+21} min{44,7+31}
12* 19 28 38
0* 7* 12* min{19, 12+7} min{28,12+12} min{38,12+21}
19* 24 33
0* 7* 12* 19* min{24,19+7} min{33,19+12}
24* 31
Example 2.

Dijkstra’s Algorithm

1 2 3 4 5 6
0* ∞ ∞ ∞ ∞ ∞
0* 7* 12 21 31 44
0* 7* min{12,7+7} min{21,7+12} min{31,7+21} min{44,7+31}
12* 19 28 38
0* 7* 12* min{19, 12+7} min{28,12+12} min{38,12+21}
19* 24 33
0* 7* 12* 19* min{24,19+7} min{33,19+12}
24* 31
0* 7* 12* 19* 24* min{31,24+7}
31*

Shortest paths: 1-3-5-6 or 1-2-4-6


Shortest Path Problem as a Transshipment Problem

Demand point: Node 6


Supply point: Node 1
Other points: Transshipment points
Shortest Path Problem as a Transshipment Problem
Maximum-Flow Problems

In some networks, arcs may be thought of as having a capacity that


limits the quantity of a product that may be shipped through
the arc.
We then maximize the amount transported from the source
(starting point) to the sink (terminal point).
This problem is a maximum-flow problem.

26
Example

Maximize the amount sent from node so to node si.

3
4 1

2 3 2
so 1 2 si

Capacity of
arc (i,j)
i j

27
Example
Maximize the amount sent from node so to node si.
3
4 1

2 3 2
so 1 2 si

3 Add an artificial arc: a0

Mathematical Model

28
3
4 1

2 3 2
so 1 2 si

3 a0

Mathematical Model

29
Optimal Solution:

3
4 (1) 1 (1)

2 (2) 3 (1) 2 (2) Capacities on arcs


so 1 2 si
(Flow on arcs)
3 (1) (3)

30
Example
There are 5 men and 5 women at a Tango dance lesson. Not
everybody wants to dance with everybody, the table below
shows the pairs that both men and women agree on. We
want to maximize the number of pairs dancing. Draw a
network to represent this problem as a maximum-flow
problem.

Men/Women LA MS KH LE VP
KC √
BR √
TS √ √
MJ √ √ √
TC √ √ √

31
Men/Wom LA MS KH LE VP
en
KC √
BR √
TS √ √
MJ √ √ √
TC √ √ √

Network:

Optimal Solution:
Minimum-Cost Network Flow Problems (MCNF)

The transportation, assignment, transshipment, shortest-


path, maximum-flow problems are all special cases of MCNF
problems.

Notation:
𝑥𝑖𝑗 : number of units sent from node i to node j through arc
(i,j).
𝑐𝑖𝑗 : cost of transporting 1 unit from node i to node j through
arc (i,j).
𝑏𝑖 : net supply at node i.
𝑙𝑖𝑗 : lower bound on flow through arc (i,j) (if none, =0)
𝑢𝑖𝑗 : upper bound on flow through arc (i,j) (if none, =∞)

33
Minimum-Cost Network Flow Problems (MCNF)

Formulation:

(1)

(2)

(1): Flow balance equations

34
Formulating a Transportation Problem as a MCNFP

Supply
1 2
4

3 4
5

Demand 6 3

35
Formulating a Max-Flow Problem as a MCNFP

max

36
Example
Minimum Spanning Tree (MST)

Determine the set of arcs in a network that connects all nodes


in such a way that the sum of the lengths of the arcs used
is minimized.
A spanning tree: A group of (n-1) arcs that connects all n
nodes of the network and contains no loops.

39
Use the following algorithm to find the optimal
spanning tree.

Prim’s Algorithm
1. Choose an initial node i, and join node j that is
closest to node i to the network with arc (i,j).
C: set of connected nodes, C={i,j}
C’: set of unconnected nodes
2. Choose a node (say k) in C’ that is closest to some
node (say m) in C. Add arc (k,m) to the network.
Update C and C’.
3. Repeat Step 2 until a minimum spanning tree is
found.

40
Example
The State University campus has 5 minicomputers. The
distance between each pair of computers is given in the
following figure. The computers must be interconnected by
underground cable. What is the minimum length of cable
required?
1
1 2
4 2 3
5 3
2
6
4
5
4

41
Start with node 1.
As an exercise, start with another node and develop the
MST.
(It should have the same total length with the tree found
above.)

43

You might also like