1other network modelslesson 6 lecture six other network models

36
1 Other Network Models Lesson 6 LECTURE SIX LECTURE SIX Other Other Network Network Models Models

Upload: weston-weekley

Post on 14-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

1 Other Network Models Lesson 6

LECTURE SIXLECTURE SIX

Other Other Network ModelsNetwork Models

Page 2: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

2 Other Network Models Lesson 6

The Shortest Path ProblemThe Shortest Path Problem

For a given network find For a given network find the path of minimum the path of minimum distance, time, or cost from distance, time, or cost from a starting point, the a starting point, the start start nodenode, to a destination, the , to a destination, the terminal nodeterminal node..

Page 3: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

3 Other Network Models Lesson 6

Problem definitionProblem definition

– There are n nodes, beginning with start There are n nodes, beginning with start node 1 and ending with terminal node n.node 1 and ending with terminal node n.

– Bi-directional arcs connect connected nodes Bi-directional arcs connect connected nodes i and j with nonnegative distances, di and j with nonnegative distances, d i j i j..

– Find the path of minimum total distance Find the path of minimum total distance that connects node 1 to node n.that connects node 1 to node n.

The Shortest Path ProblemThe Shortest Path Problem

Page 4: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

4 Other Network Models Lesson 6

Fairway Van LinesFairway Van Lines

Determine the shortest route from Seattle to El Determine the shortest route from Seattle to El Paso over the following network highways.Paso over the following network highways.

Page 5: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

5 Other Network Models Lesson 6

Salt Lake CitySalt Lake City

11 22

33 44

5566

77 88

99

10101111

12121313 1414

1515

1616

1717 1818 1919

El PasoEl Paso

SeattleSeattle

BoiseBoise

PortlandPortland

ButteButte

CheyenneCheyenne

RenoReno

Sac.Sac.

BakersfieldBakersfield

Las VegasLas VegasDenverDenver

Albuque.Albuque.

KingmanKingmanBarstowBarstow

Los AngelesLos Angeles

San DiegoSan Diego TucsonTucson

PhoenixPhoenix

599599

691691497497180180

432432 345345

440440

102102

452452

621621

420420

526526

138138

291291

280280

432432

108108

469469207207

155155114114

386386403403

118118

425425 314314

Page 6: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

6 Other Network Models Lesson 6

SEA.SEA.Salt Lake City

1 2

3 4

56

7 8

9

1011

1213 14

15

16

17 18 19

El Paso

Seattle

Boise

Portland

Butte

Cheyene

Reno

Sac.

Bakersfield

Las VegasDenver

Albuque.

KingmanBarstow

Los Angeles

San Diego Tucson

Pheonix

599

691497180

432 345

440

102

452

621

420

526

138

291

280

432

108

469207

155114

386403

118

425 314

BUT599

POR

180

497BOI

599

180

497POR.POR.

BOI432

SAC602

+

+

==

= =

612612

782782

BOI

BOIBOI.BOI.

345345SLCSLC++ ==

842842

BUT.BUT.

SLCSLC

420420

CHY.CHY.691691

++

++

==

==

11191119

12901290

SLC.SLC.

SLCSLCSLC.SLC.

SAC.SAC.

An illustration of the Dijkstra’s algorithmAn illustration of the Dijkstra’s algorithm

… … and so on until the and so on until the whole network whole network is covered.is covered.

Page 7: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

7 Other Network Models Lesson 6

Dijkstra’s algorithm Example: Look at the network of routes (diagram below) with distances marked on each link. Find the shortest distance

from node 1 to each of all the other nodes.

7

Page 8: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

8 Other Network Models Lesson 6

The Maximal Flow Problem The Maximal Flow Problem

• The model is designed to reduce or eliminate The model is designed to reduce or eliminate bottlenecks between a certain starting point bottlenecks between a certain starting point and some destination of a given network. and some destination of a given network.

• A flow travels from a single source to a single A flow travels from a single source to a single sink over arcs connecting intermediate nodes.sink over arcs connecting intermediate nodes.

• Each arc has a capacity that cannot be Each arc has a capacity that cannot be exceeded.exceeded.

• Capacities need not be the same in each Capacities need not be the same in each direction on an arc. direction on an arc.

Page 9: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

9 Other Network Models Lesson 6

UNITED CHEMICAL COMPANYUNITED CHEMICAL COMPANY• United Chemical produces pesticides and lawn United Chemical produces pesticides and lawn

care products.care products.

• Poisonous chemicals needed for the production Poisonous chemicals needed for the production process are held in a huge drum.process are held in a huge drum.

• A network of pipes and valves regulates the A network of pipes and valves regulates the chemical flow from the drum to different chemical flow from the drum to different production areas.production areas.

Page 10: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

10 Other Network Models Lesson 6

UNITED CHEMICAL COMPANYUNITED CHEMICAL COMPANY

• The safety division must plan a procedure to The safety division must plan a procedure to empty the drum as fast as possible into a safety empty the drum as fast as possible into a safety tub in the disposal area, using the same network tub in the disposal area, using the same network of pipes and valves.of pipes and valves.

• The plan must determineThe plan must determine

– which valves to open and shutwhich valves to open and shut

– the estimated time for total dischargethe estimated time for total discharge

Page 11: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

11 Other Network Models Lesson 6

Chemical Chemical DrumDrum Safe TubSafe Tub

11 77

44

22

33

66

55

1010

00

8800

00

00

00

00

00

00

1010

66

11

1212

1144

4422

22 88

33

33

77

22

Maximum flow from 2 to 4 is 8Maximum flow from 2 to 4 is 8

No flow is allowed from 4 to 2.No flow is allowed from 4 to 2.

Page 12: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

12 Other Network Models Lesson 6

Linear Programming ApproachLinear Programming Approach

– Decision variablesDecision variables

XXijij - the flow from node i to node j on the arc that - the flow from node i to node j on the arc that

connects these two nodesconnects these two nodes

– Objective functionObjective function

- Maximize the flow out of node 1- Maximize the flow out of node 1

Max X12 + X13Max X12 + X13

Page 13: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

13 Other Network Models Lesson 6

ConstraintsConstraints

[Total flow Out of node 1] = [Total flow entering node 7][Total flow Out of node 1] = [Total flow entering node 7]

X12 +X13 = X47 + X57 + X67X12 +X13 = X47 + X57 + X67

[For each intermediate node: Flow into = flow out from][For each intermediate node: Flow into = flow out from]

Node 2: X12 + X32Node 2: X12 + X32 = X23 +X24 + X26 = X23 +X24 + X26

Node 3:X13 +X23 + 63Node 3:X13 +X23 + 63 = X32 +X35 + X36 = X32 +X35 + X36

Node 4:Node 4: X24 +X64X24 +X64 = X46 + X47 = X46 + X47

Node 5:Node 5: X35 +X65X35 +X65 = X56 + X57 = X56 + X57Node 6:X26 +X36 + X46 +X56= X63 +X64 +X65 + X67Node 6:X26 +X36 + X46 +X56= X63 +X64 +X65 + X67

Page 14: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

14 Other Network Models Lesson 6

Constraints (con’t)Constraints (con’t)

[Flow cannot exceed arc capacities][Flow cannot exceed arc capacities]

X12 10; X13 10; X23 1; X24 8; X26 6; X12 10; X13 10; X23 1; X24 8; X26 6;

X32 1; X35 15; X36 4; X46 3; X47 7; X32 1; X35 15; X36 4; X46 3; X47 7;

X56 2; X57 8; X63 4; X64 3; X65 2; X56 2; X57 8; X63 4; X64 3; X65 2;

X67 2; X67 2;

[Flow cannot be negative][Flow cannot be negative]

All XAll Xijij 0 0

Page 15: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

15 Other Network Models Lesson 6

• This problem is relatively small and a This problem is relatively small and a solution can be obtained rather quickly solution can be obtained rather quickly by a linear programming model. by a linear programming model.

• However, for large network problems, However, for large network problems, there is a more efficient approachthere is a more efficient approach

Page 16: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

16 Other Network Models Lesson 6

The WINQSB Maximum Flow Optimal SolutionThe WINQSB Maximum Flow Optimal Solution

Chemical Chemical DrumDrum

Safe TubSafe Tub

1 7

4

2

3

6

5

8

88

22

7777

1010

77

88

22

Maximum Flow= 17Maximum Flow= 17

Page 17: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

17 Other Network Models Lesson 6

Solving Maximal Flow Networks Solving Maximal Flow Networks ManuallyManually

Worked example 5.14 (page 185 – 189 ) Worked example 5.14 (page 185 – 189 )

See demonstration by LecturerSee demonstration by Lecturer

Page 18: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

18 Other Network Models Lesson 6

The Minimal Spanning TreeThe Minimal Spanning Tree

• This problem arises when all the nodes of a This problem arises when all the nodes of a given network must be connected to one given network must be connected to one another, without any loop.another, without any loop.

• The minimal spanning tree approach is The minimal spanning tree approach is appropriate for problems for which appropriate for problems for which redundancy is expensive, or the flow along redundancy is expensive, or the flow along the arcs is considered instantaneous. the arcs is considered instantaneous.

Page 19: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

19 Other Network Models Lesson 6

THE METROPOLITAN TRANSIT THE METROPOLITAN TRANSIT DISTRICTDISTRICT

• The City of Vancouver is planning the The City of Vancouver is planning the

development of a new light rail transportation development of a new light rail transportation

system.system.

• The system should link 8 residential and The system should link 8 residential and commercial centers.commercial centers.

Page 20: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

20 Other Network Models Lesson 6

THE METROPOLITAN TRANSIT THE METROPOLITAN TRANSIT DISTRICTDISTRICT

• The Metropolitan transit district needs to select The Metropolitan transit district needs to select the set of lines that will connect all the centers at the set of lines that will connect all the centers at a minimum total cost.a minimum total cost.

• The network describes:The network describes:

– feasible lines that have been drafted,feasible lines that have been drafted,

– minimum possible cost for taxpayers per line.minimum possible cost for taxpayers per line.

Page 21: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

21 Other Network Models Lesson 6

55

22 66

44

77

8811

33

West SideWest Side

North SideNorth Side UniversityUniversity

BusinessBusinessDistrictDistrict

East SideEast SideShoppingShoppingCenterCenter

South SideSouth Side

City City CenterCenter

3333

5050

3030

5555

3434

2828

3232

3535

3939

4545

3838

4343

4444

4141

37373636

4040SPANNING TREE

SPANNING TREE

NETWORK PRESENTATION

NETWORK PRESENTATION

Page 22: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

22 Other Network Models Lesson 622

• Solution - a network approach (See Textbook)• The algorithm that solves this problem is a very

trivial greedy procedure. Two versions of the algorithm are described.

• The algorithm – version 1:– Start by selecting the smallest arc, and adding it to a set of

selected arcs (currently contains only the first arc).

– At each iteration, add the next smallest arc to the set ofselected arcs, unless it forms a cycle.

– Finish when all nodes are connected.

THE METROPOLITAN TRANSIT DISTRICT

Page 23: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

23 Other Network Models Lesson 623

• The algorithm – version 2:– Start by selecting the smallest arc creating the

set of connected arcs.– At each iteration add the smallest unselected

arc that has a connection to the connected set, but do not create a cycle.

– Finish when all nodes are connected

• See demonstration of version 2 next

THE METROPOLITAN TRANSIT DISTRICT

Page 24: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

24 Other Network Models Lesson 624

ShoppingCenter

Loop

2 6

4

7

8

West Side

North Side

University

BusinessDistrict

East Side

South Side

City Center

50

30

55

34

28

32

35

39

45

38

43

44

41

3736

40

Total Cost = $236 million

OPTIMAL SOLUTIONNETWORKREPRESENTATION 5

LoopLoopLoopLoopLoopL

oop

LoopLo

op LoopLoop Loop LoopLoopLoopLoop

1

3

33

28

32

30

33

Page 25: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

25 Other Network Models Lesson 625

ShoppingCenter

4

7

8

West Side

North Side

University

BusinessDistrict

East Side

South Side

City Center

50

30

55

34

28

32

35

39

45

38

43

44

41

3736

40

Total Cost = $236 million

OPTIMAL SOLUTIONNETWORKREPRESENTATION 53

33Loop

1

62

Page 26: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

26 Other Network Models Lesson 6

WINQSB Optimal Solution

Page 27: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

27 Other Network Models Lesson 6

Minimal Spanning Tree Example

27

Page 28: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

28 Other Network Models Lesson 6

• A tour begins at a home city, visits every city (node) in a given network exactly once, and returns to the home city.

• The objective is to minimize the travel time/distance.

The Traveling Salesman ProblemThe Traveling Salesman Problem

• Problem definitionProblem definition

– There are m nodes.There are m nodes.

– Unit cost CUnit cost Cijij is associated with utilizing arc (i,j) is associated with utilizing arc (i,j)

– Find the cycle that minimizes the total cost Find the cycle that minimizes the total cost required to visit all the nodes exactly once.required to visit all the nodes exactly once.

Page 29: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

29 Other Network Models Lesson 6

• Importance:

– Variety of scheduling application can be solved as a traveling salesmen problem.

– Examples:

• Ordering drill position on a drill press. • School bus routing. • Military bombing sorties.

– The problem has theoretical importance because it represents a class of difficult problems known as NP-hard problems.

• ComplexityComplexity

Writing the mathematical model Writing the mathematical model and solving this problem are both and solving this problem are both cumbersome (a problem with 20 cumbersome (a problem with 20 cities requires over 500,000 linear cities requires over 500,000 linear constraints.)constraints.)

Page 30: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

30 Other Network Models Lesson 6

THE FEDERAL EMERGENCY THE FEDERAL EMERGENCY MANAGEMENT AGENCYMANAGEMENT AGENCY

A visit must be made to four local offices of A visit must be made to four local offices of FEMA, going out from and returning to the FEMA, going out from and returning to the same main office in Northridge, Southern same main office in Northridge, Southern California.California.

Travel time between offices (minutes)Travel time between offices (minutes)

To officeH 1 2 3 4

F Home office 30 45 65 80r Office 1 30 25 50 50o Office 2 45 25 40 40m Office 3 65 50 40 35

Office 4 80 50 40 35

To officeH 1 2 3 4

F Home office 30 45 65 80r Office 1 30 25 50 50o Office 2 45 25 40 40m Office 3 65 50 40 35

Office 4 80 50 40 35

Page 31: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

31 Other Network Models Lesson 6

3030

2525

4040

3535

8080

65654545

5050

5050

4040

HomeHome

11

22 33

44

FEMA traveling salesman network representationFEMA traveling salesman network representation

Page 32: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

32 Other Network Models Lesson 6

The FEMA problem - A full enumerationThe FEMA problem - A full enumeration

Possible cyclesPossible cycles

CycleCycle Total CostTotal Cost 1. H-O1-O2-O3-O4-H1. H-O1-O2-O3-O4-H 210210

2.2. H-O1-O2-O4-O3-H H-O1-O2-O4-O3-H 195195

3.3. H-O1-O3-O2-O3-H H-O1-O3-O2-O3-H 240240

4.4. H-O1-O3-O4-O2-H H-O1-O3-O4-O2-H 200200

5.5. H-O1-O4-O2-O3-H H-O1-O4-O2-O3-H 225225

6. H-O1-O4-O3-O2-H 6. H-O1-O4-O3-O2-H 200200

7. H-O2-O3-O1-O4-H 7. H-O2-O3-O1-O4-H 265265

8. H-O2-O1-O3-O4-H 8. H-O2-O1-O3-O4-H 235235

9. H-O2-O4-O1-O3-H 9. H-O2-O4-O1-O3-H 250250

10. H-O2-O1-O4-O3-H 10. H-O2-O1-O4-O3-H 220220

11. H-O3-O1-O2-O4-H 11. H-O3-O1-O2-O4-H 260260

12. H-O3-O1-O2-O4-H12. H-O3-O1-O2-O4-H 260260

Minimum

For this problem we have (5-1)! / 2 = 12 cycles. Symmetrical problems have (m-1)! / 2 cycles to enumerate

Page 33: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

33 Other Network Models Lesson 6

WINQSB input data for the Traveling Salesman problemWINQSB input data for the Traveling Salesman problem

Page 34: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

34 Other Network Models Lesson 6

WINQSB Solution - by the combination of the Assignment problem and the Branch and Bound technique

WINQSB Solution - by the combination of the Assignment problem and the Branch and Bound technique

Page 35: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

35 Other Network Models Lesson 6

3030

2525

4040

3535

808065654545

5050

505040

Home

1

2 3

4

Page 36: 1Other Network ModelsLesson 6 LECTURE SIX Other Network Models

36 Other Network Models Lesson 6

QUESTIONS