NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models...

33
1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation are widely used in: Production, distribution, project planning, facilities location, resource management, financial planning, etc. Algorithms and software are being used to solve huge network problems on a routine basis. Many network problems are special cases of linear programming problems. 141

Transcript of NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models...

Page 1: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

1

NETWORK OPTIMIZATIONMODELS

Network models

Transportation, electrical and communicationnetworks pervade our daily lives.

Network representation are widely used in:Production, distribution, project planning, facilitieslocation, resource management, financial planning, etc.

Algorithms and software are being used to solve hugenetwork problems on a routine basis.

Many network problems are special cases of linearprogramming problems.

141

Page 2: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

2

Prototype example

Seervada Park has a limited amount of sightseeing andbackpack hiking.

O: entrance of the park.

T: station with scenic wonder.

142

Park problems

Determine route from park entrance to station T withsmallest total distance for the operation of trams.

Telephone lines must be installed under the roads toestablish communication among all the stations. Thisshould be accomplished with a minimum totaldistance of lines.

Route the various trips of trams to maximize thenumber of trips per day without violating the limits ofany road.

143

Page 3: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

3

Typical networks

144

Nodes Arcs FlowIntersections Roads Vehicles

Airports Air lanes Aircraft

Switching points Wires, channels Messages

Pumping stations Pipes Fluids

Work centers Material-handling sources Jobs

Terminology of networks

Network is a set of points (nodes or vertices) and a setof lines (arcs or links or edges or branches) connectingcertain pairs of the nodes.

Example: road system of Seervada Park has 7 nodes and12 arcs.

Flow in only one direction is a directed arc.

Flow allowed in either directions: undirected arc orlink.

Network with only directed arcs is a directed network.

145

Page 4: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

4

Terminology of networks

Network with only undirected arcs is an undirectednetwork.

A path between two nodes is a sequence of distinctarcs connecting these nodes.

A directed path from node i to node j is a sequence ofconnecting arcs whose direction is toward node j.

An undirected path from node i to node j is asequence of connecting arcs whose direction (if any)can be either toward or away from node j.

146

Example

Distribution Unlimited Co. produces the same new product attwo different factories. Products must be shipped to twowarehouses (a distribution center is available).

147

Page 5: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

5

Example of a directed network

148

Terminology of networks

A path that begins and ends at the same node is acycle.

Two nodes are connected if the network contains atleast one undirected path between them.

A connected network is a network where every pair ofnodes is connected.

A tree is a connected network (for some subset of then nodes of the original network) that contains noundirected cycles.

149

Page 6: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

6

Terminology of networks

A spanning tree is a connected network for all n nodesof the original network that contains no undirectedcycles. Spanning tree has exactly n – 1 arcs.

The maximum amount of flow that can be carried on adirected arc is the arc capacity.

Supply node: the flow out of the node exceeds theflow into the node. The reverse in a demand node.

Transshipment node: node where the amount of flowout equals the amount of flow in.

150

Growing tree one arc a time

a) Nodes without arcs

b) Tree with one arc

c) Tree with two arcs

d) Tree with three arcs

e) A spanning tree

151

Page 7: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

7

Shortest-path problem

Consider an undirected and connected network withthe special nodes called origin and destination.

Each link (undirected arc) has an associated distance.

Objective: find the shortest path from the origin tothe destination.

Algorithm: starting from the origin, successivelyidentifies the shortest path to each of the nodes in theascending order of their distances from the origin.

The problem is solved when the destination is reached.

152

Algorithm for shortest-path problem

Objective of nth iteration: find the nth nearest nodeto the origin (n = 1, 2, …) until the nth nearest node isreached.

Input for the nth iteration: n – 1 nearest nodes to theorigin, including their shortest path and distance to theorigin (these are the solved nodes).

Candidates for the nth nearest node: each solved thatis directly connected to unsolved nodes provides onecandidate – the unsolved node with the shortestconnecting link.

153

Page 8: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

8

Calculation of the nth nearest node: for each solvedand its candidate, add the distance between them tothe distance of the shortest path from the origin tothis solved node.

The candidate with the smallest total distance is thenth nearest node, and its shortest path is the onegenerating this distance.

154

Algorithm for shortest-path problem

Example: Seervada park

155

n Solved nodesdirectly connectedto unsolved nodes

Closestconnected

unsolved node

Totaldistanceinvolved

nthnearest

node

Minimumdistance

Lastconnection

Page 9: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

9

Example: Seervada park

156

n Solved nodesdirectly connectedto unsolved nodes

Closestconnected

unsolved node

Totaldistanceinvolved

nthnearest

node

Minimumdistance

Lastconnection

1 O A 2 A 2 OA

2,3 O C 4 C 4 OC

A B 2 + 2 = 4 B 4 AB

A D 2 + 7 = 9

4 B E 4 + 3 = 7 E 7 BE

C E 4 + 4 = 8

A D 2 + 7 = 9

5 B D 4 + 4 = 8 D 8 BD

E D 7 + 1 = 8 D 8 ED

6 D T 8 + 5 = 13 T 13 DT

E T 7 + 7 = 14

Solution

157

Page 10: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

10

Using simplex to solve the problem

158

Seervada Park Shortest-Path Problem

From To On Route Distance Nodes Net Flow Supply/Demand Range Name CellsO A 1 2 O 1 = 1 Distance F4:F17O B 0 5 A 0 = 0 From B4:B17O C 0 4 B 0 = 0 NetFlow I4:I10A B 1 2 C 0 = 0 Nodes H4:H10A D 0 7 D 0 = 0 OnRoute D4:D17B C 0 1 E 0 = 0 SupplyDemand K4:K10B D 1 4 T -1 = -1 To C4:C17B E 0 3 TotalDistance D19C B 0 1C E 0 4D E 0 1D T 1 5E D 0 1E T 0 7

Total Distance 13

Using simplex to solve the problem

159

Page 11: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

11

Applications of shortest path

Main applications:

1. Minimize the total distance traveled.

2. Minimize the total cost of a sequence of activities.

3. Minimize the total time of a sequence of activities.

4. Combination of the previous three.

What happens if the network is directed?

How to optimize from the source to all other nodes?

How to find the shortest path from every node toevery other node?

160

Minimum spanning tree problem

Also for undirected and connected networks.

A positive length (distance, cost, time, etc.) isassociated with each link.

Both the shortest path problem and the minimumspanning tree choose a set of links that satisfy acertain property.

Objective: find the shortest total length that providea path between each pair of nodes.

161

Page 12: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

12

Minimum spanning tree problem

Definitions:

Nodes of the network are given, as well as potentiallinks and positive length for each if it is inserted in thenetwork.

The network should insert links in order to have a pathbetween each pair of nodes.

These links must minimize the total length of the linksinserted into the network.

162

Properties

163

A network with n nodesrequires n – 1 links toprovide a path betweeneach pair of nodes.

The n – 1 links form aspanning tree.

Which is a spanning tree:(a), (b) or (c)?

Page 13: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

13

Applications

Design of telecommunication networks: fiber-optic,computer, leased-line telephone cable television, etc.

Design of a lightly used transportation network tominimize the total cost of providing the links.

Design of a network of high-voltage electrical powertransmission lines.

Design of a network of wiring on electrical equipmentto minimize the total length of wire.

Design of a network of pipelines to connect locations.

164

Algorithm for minimum spanning tree

Can be solved in a straightforward way using a greedyalgorithm.

1. Select any node, and connect it to the nearestdistinct node.

2. Identify the unconnected node that is closest to aconnected node, and connect the two nodes. Repeatthis step until all nodes have been connected.

Tie breaking: can be done arbitrarily. It can indicatethat more than one optimal solution exist.

165

Page 14: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

14

Application to Seervada park

Total length of the links: 14.

Verify that the choice of the initial node does notaffect the final solution.

166

Maximum flow problems

Third problem in Seervada Park: route the tram tripsfrom the park entrance to the scenic wonder tomaximize the number of trips per day.

Outgoing trips allowed per day:

167

Page 15: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

15

Feasible solution

One solution (not optimal):5 trams using the route O B E T

1 tram using O B C E T

1 tram using O B C E D T

168

Definition of maximum flow problem

All flows through a directed and connected networkfrom the source to the sink.

All remaining nodes are transshipment nodes.

Flow through an arc in only allowed in the directionindicated by the arrowhead. Maximum amount of flowis given by the capacity of that node.

Objective: maximize the total amount of flow fromthe source to the sink.

169

Page 16: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

16

Applications

Maximize the flow through a company’s distributionnetwork from its factories to its costumers.

Maximize the flow through a company’s supplynetwork from its vendors (suppliers) to its factories.

Maximize the flow of oil through a system of pipelines.

Maximize the flow of water through a systemaqueducts.

Maximize the flow of vehicles through a transportationnetwork.

170

Some applications

For some applications, the flow may be originated atmore than one node, and the may also terminate atmore than one node.

More than one source: include a dummy source withcapacity equal to the maximum flow.

More than one sink: include a dummy sink with capacityequal to the maximum flow.

Maximum flow problem is a linear programmingproblem; can be solved by the simplex method.

However, the augmented path algorithm is moreefficient.

171

Page 17: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

17

Augmented path algorithm

Every arc is changed from a directed to an undirectedarc:

172

O B7 O B7 0

Residual network shows the residual capacities forassigning additional flows:

O B2 5

Seervada Park residual network

Augmenting path is a directed path from the source tothe sink, such that every path has strictly positiveresidual capacity.

173

Page 18: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

18

Iteration of augmented path algorithm

1. Identify an augmenting path (directed path fromsource to sink with positive residual capacity).

2. Residual capacity c* is the minimum of residualcapacities of the arcs. Increase the flow by c*.

3. Decrease c* the residual capacity of each arc on thisaugmented path. Increase c* the residual capacity ofeach arc in the opposite direction. Return to Step 1.

Several augmented paths can be chosen. Its choice isimportant for the efficiency of large-scale networks.

174

Application to Seervada Park

Initial residual network:

175

Page 19: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

19

Iteration 1

Iteration 1: one of several augmenting paths is O BE T residual capacity is min{7, 6, 5} = 5.

176

5 25

5

5

0

1

5

Iteration 2

Iteration 2: assign a flow of 3 to the augmenting pathO A D T

177

8 28

5

5

0

1

52

3 0

3 36

Page 20: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

20

Iterations 3 and 4

Iteration 3: assign flow of 1 to augmenting pathO A B D T

Iteration 4: assign flow of 2 to augmenting pathO B D T

178

11 011

7

5

0

1

51

4 0

3 63

01

31

Iterations 5 and 6

Iteration 5: assign flow of 1 to augmenting pathO C E D T

Iteration 6: assign flow of 1 to augmenting pathO C E T

179

13 013

7

5

0

0

61

4 0

3 72

01

31

2

222

0

1

Page 21: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

21

Iteration 7

Iteration 7: assign flow of 1 to augmenting pathO C E B D T

180

14 014

7

4

1

0

61

4 0

3 81

01

40

1

331

0

1

Optimal solution

After iteration 7 there are no more augmenting paths.Optimal flow pattern is:

181

Page 22: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

22

Finding an augmenting path

This can be difficult, especially for large networks.

Procedure:Find all nodes that can be reached from the sourcealong a single arc with strictly positive residual capacity.

For each reached node, find all new nodes from thisnode that can be reached along an arc with strictlypositive residual capacity.

Repeat this successively with the new nodes as they arereached.

182

Example in Seervada Park

Residual network after Iteration 6 is given, as well asthe possible augmenting path.

183

Page 23: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

23

How to recognize the optimal?

Using the maximum-flow min-cut theorem.

Cut: any set of directed arcs containing at least one arcfrom every directed path from the source to the sink.

Cut value: sum of the arc capacities of the arcs (in thespecified direction) of the cut.

Maximum-flow min-cut theorem: for any networkwith a single source and sink, the maximum feasibleflow from the source to the sink equals the minimumcut value for all cuts of the network.

184

Maximum-flow min-cut theorem

F is the amount of flow from the source to the sink forany feasible flow pattern.

Example: value of cut is 3 + 4 + 1 + 6 = 14. This is themaximum value of F, so this is the minimum cut.

185

Page 24: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

24

Using simplex to solve the problem

186

Seervada Park Maximum Flow Problem

From To Flow Capacity Nodes Net Flow Supply/Demand Range Name CellsO A 3 <= 5 O 14 Capacity F4:F15O B 7 <= 7 A 0 = 0 Flow D4:D15O C 4 <= 4 B 0 = 0 From B4:B15A B 0 <= 1 C 0 = 0 MaximumFlow D17A D 3 <= 3 D 0 = 0 NetFlow I4:I10B C 0 <= 2 E 0 = 0 Nodes H4:H10B D 4 <= 4 T -14 SupplyDemand K5:K9B E 3 <= 5 To C4:C15C E 4 <= 4D T 8 <= 9E D 1 <= 1E T 6 <= 6

Maximum Flow 14

Using simplex to solve the problem

187

Page 25: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

25

Minimum cost flow problem

It contains a large number of applications and it can besolved extremely efficiently.

Like the maximum flow problem, it considers flowthrough a network with limited arc capacities.

Like the shortest-path problem, it considers a cost (ordistance) for flow through an arc.

Like the transportation problem or assignmentproblem, it can consider multiple sources (supplynodes) and multiple destinations (demand nodes) forthe flow, again with associated costs.

188

Minimum cost flow problem

The four previous problems are all special cases of theminimum cost flow problem.

This problem can be formulated as a linearprogramming problem, solved using a streamlinedversion of the simplex method:

network simplex method

189

Page 26: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

26

Definition of minimum cost flow problem

1. The network is a directed and connected network.2. At least one of the nodes is a supply node.3. At least one of the other nodes is a demand node.4. All the remaining nodes are transshipment nodes.5. Flow through an arc is in the direction of the arrow. Maximum

amount of flow is the capacity of the arc.6. Network has enough arcs with sufficient capacity such that all

flow generated at supply nodes reach the demand nodes.7. Cost of flow through each arc is proportional to the amount of

that flow.8. Objective: minimize the total cost (profit) of sending the

available supply through the network to satisfy the demand.

190

Applications

191

Kind of application Supply nodes Transshipment nodes Demand nodes

Operation of adistributed network

Sources of goods Intermediate storagefacilities

Customers

Solid wastemanagement

Sources of solidwaste

Processing facilities Landfill locations

Operation of a supplynetwork

Vendors Intermediate warehouses Processingfacilities

Coordinating productmixes at plants

Plants Production of a specificproduct

Market for aspecific product

Cash flowmanagement

Sources of cashat a specific time

Short-term investmentoptions

Needs for cash ata specific time

Page 27: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

27

Formulation of the model

Decision variables:xij = flow through arc i j

Given information:cij = cost per unit flow through arc i juij = arc capacity for arc i jbi = net flow generated at node i

Value of bi depends on nature of node i:bi > 0 if node i is a supply nodebi < 0 if node i is a demand nodebi = 0 if node i is a transshipment node

192

Formulation of the model

193

node constraints1 1

minimize ,n n

ij iji j

Z c x

1 1

subject to

, for each node ,n n

ij ji ij j

x x b i

and 0 , for each arcij ijx u i j

Page 28: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

28

Minimum cost flow problem

Feasible solutions property: necessary condition for aminimum flow problem to have feasible solutions:

If this condition does not hold, a dummy source or adummy destination is needed.

Integer solutions property: when every bi and uij haveinteger values, al the basic variables in every basicfeasible (BF) solution also have integer values.

194

10

n

ii

b

Example

Distribution network for the Distribution Unlimited Co.

195

Page 29: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

29

Example

Linear programming problem:

196

minimize 2 4 9 3 3 2 ,AB AC AD BC CE DE EDZ x x x x x x xsubject to

50400

3060

AB AC AD

AB BC

AC BC CE

AD DE ED

CE DE ED

x x xx x

x x xx x xx x x

and 10, 80, all 0.AB CE ijx x x

Using simplex to solve the problem

197

Distribution Unlimited Co. Minimum Cost Flow Problem

From To Ship Capacity Unit Cost Nodes Net Flow Supply/Demand Range Name CellsA B 0 <= 10 2 A 50 = 50 From B4:B10A C 40 4 B 40 = 40 NetFlow J4:J8A D 10 9 C 0 = 0 Nodes I4:I8B C 40 3 D -30 = -30 Ship D4:D10C E 80 <= 80 1 E -60 = -60 SupplyDemand L4:L8D E 0 3 To C4:C10E D 20 2 TotalCost D12

UnitCost G4:G10Total Cost 490

Page 30: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

30

Using simplex to solve the problem

198

Special cases

Transportation problem. A supply node is provided foreach source and a demand node for each destination.No transshipment nodes are included.

Assignment problem. As in the transportationproblem and

Number of supply nodes equal to number of demandnodes

bi = 1 for supply nodes and bi = –1 for demand nodes.

Transshipment problem. A minimum cost flowproblem with unlimited arc capacities: uij = .

199

Page 31: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

31

Special cases

Shortest-path problemA supply node with the supply of 1 is provided for theorigin

A demand node with the demand of 1 is provided forthe destination.

Rest of nodes are transshipment nodes.

Each undirected link is replaced by a pair of directedarcs in opposite directions (cij = cji).

No arc capacities are imposed: uij = + .

200

Example of shortest-path problem

201

Page 32: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

32

Special cases

Maximum flow problemAlready provided with one supply node (source) andone demand node (sink).

Set cij = 0 for all existing arcs (absence of costs).

Select F, which is a safe upper bound of the maximumfeasible flow through the network, and assign it as asupply and a demand.

Add an arc from the supply node to the demand nodeand assign a cost, cij = M, as well as unlimited capacity,uij = .

202

Example of maximum flow problem

203

Page 33: NETWORK OPTIMIZATION MODELS - ULisboa · 1 NETWORK OPTIMIZATION MODELS Network models Transportation, electrical and communication networks pervade our daily lives. Network representation

33

Network simplex method

Highly streamlined version of the simplex method forsolving minimum cost flow problems.

Goes from one BF solution to another one using thenetwork itself (without using the simplex tableau).

There is a correspondence between BF solutions andfeasible spanning trees.

See example in Hillier’s book, OR and IOR examples,and computational implementations.

204