Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of...

30
Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology 2010-2011 1 Tran Van Hoai

Transcript of Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of...

Tran Van Hoai 1

Network Models (2)

Tran Van HoaiFaculty of Computer Science & Engineering

HCMC University of Technology

2010-2011

Tran Van Hoai 2

Products transported from Assembly line to

Inspection are for Quality Control

Ballston ElectricAssembly line - Inspection

2010-2011

Which assembly line should be assigned to which inspection area (to minimize a given objective)?

Tran Van Hoai 3

Time to transport a unit of product from assembly line to inspection

Inspection AreaA B C D E

AssemblyLine

1 10 4 6 10 122 11 7 7 9 143 13 8 8 14 154 14 16 16 17 175 19 11 17 20 19

2010-2011

Time difference mainly comes from the distance difference among pair <assembly line-inspection area>

Tran Van Hoai 4

MIN 10X11 + 4X12 + … + 20X54 + 19X55

S.T.

X11 + X12 + X13 + X14 + X15 = 1 (Assemble line 1 is assigned)

X21 + X22 + X23 + X24 + X25 = 1 (Assemble line 2 is assigned)

X31 + X32 + X33 + X34 + X35 = 1 (Assemble line 3 is assigned)

X41 + X42 + X43 + X44 + X45 = 1 (Assemble line 4 is assigned)

X51 + X52 + X53 + X54 + X55 = 1 (Assemble line 5 is assigned)

X11 + X21 + X31 + X41 + X51 = 1 (Inspection area 1 is assigned)

X12 + X22 + X32 + X42 + X52 = 1 (Inspection area 2 is assigned)

X13 + X23 + X33 + X43 + X53 = 1 (Inspection area 3 is assigned)

X14 + X24 + X34 + X44 + X54 = 1 (Inspection area 4 is assigned)

X15 + X25 + X35 + X45 + X55 = 1 (Inspection area 5 is assigned)

All Xij’s ≥ 0

Define a set of decision variables Xij, which mean1 if Line i is assigned to Inspection j

Xij =0 otherwise

Formulation

2010-2011

Tran Van Hoai 5

Assignment networksDefinition

• Can be solved by– Enumeration– LP– Transportation model– Dynamic programming– Branch-and-bound– Hungarian algorithm

2010-2011

- m workers are to be assigned to m jobs- Unit cost Cij for worker i performing job jGoal: to minimize total cost of assignment

Tran Van Hoai 6

Advanced issues (1)

• Number of workers ≥ number of jobs– Worker constraint changed from “=” to “≤”

• A worker can perform ≥ 1 jobs• Minimization changed to maximization• Additional constraints– Line 1 cannot be assigned to Inspection B• X12=0

– If Line 1 is assigned to Inspection B, then Line 2 must be assigned to Inspection D

2010-2011

Tran Van Hoai 7

Advanced issues (2)

• Additional constraints– If Line 1 is assigned to Inspection B, then Line 2

must be assigned to Inspection D• X12 ≤ X24

– At least one in Lines {1,3,4} is assigned to Inspection E• X15+X35+X45=1

2010-2011

Tran Van Hoai 8

Generalized assignment model

2010-2011

njmix

njx

miwxw

ts

xp

ij

m

iij

i

n

jijij

m

i

n

jijij

,,1 ,,,1 ,1,0

,,1 ,1

,,1 ,

..

max

1

1

1 1

Tran Van Hoai 9

Marriage service

2010-2011

ASSIGNMENT

Each man only assigned to one womanPair assignment requires a operational cost

GOAL: to find a match having minimum total cost

Tran Van Hoai 10

Shortest path problem

2010-2011

1 2

3

4

5

6

87

100

151

42

67

150

75

22

8952

2571

11

- n nodes, a starting node (source), an ending node (destination)

- Arcs connecting adjacent nodes with non-negative distances dij

GOAL: to find a shortest path from source to destination

Tran Van Hoai 11

Solution methods

• Dijkstra– Only works for non-negative arc weight

• Bellman-Ford– To find shortest path from a source to all other

nodes– Works with non-negative arc weight (provided

that there is no negative weighted cycle)• Floyd–Warshall– To find shortest path between all node pairs

2010-2011

Not easy to include additional constraints(for non-IT users)

Tran Van Hoai 12

LP-based approach

2010-2011

Define a set of decision variables Xij, which mean1 if arc ij is utilized

Xij =0 otherwise

MIN ∑dijXij

S.T. <number of out-arcs used> = 1 (for source)

<number of in-arcs used> - <number of out-arcs used> = 0

(for intermediate nodes)

-<number of in-arcs used> = -1 (for destination)

Xij = 0 or 1

Tran Van Hoai 13

MIN 100X12 + 151X13 + … + 52X78

S.T. X12 + X13 = 1-X12 + X25 + X26 = 0-X13 + X34 + X35 = 0-X34 + X45 + X47 = 0-X25 - X35 - X45 + X57 = 0-X26 + X67 + X68 = 0-X47 - X57 - X67 + X78 = 0-X68 - X78 = -1

Xij = 0 or 1

2010-2011

Tran Van Hoai 14

Shortest path

2010-2011

1 2

3

4

5

6

87

100

151

42

67

150

75

22

8952

2571

9

Tran Van Hoai 15

Additional constraints

• Not go through node 5X25 = X35 = X45 = X57 = 0

Don’t have to remove node 5

• Node 4 must be on the pathX45+X47= 1

2010-2011

1 2

3

4

5

6

87

100

15142

67

15075

2289 52

2571

9

1 2

3

4

5

6

87

100151

42

67

15075

2289 52

2571

9

Tran Van Hoai 16

Additional constraints

• If node 7 on path, then node 3 must on pathX35 + X34 – X78 ≥ 0

• …

2010-2011

1 2

3

4

5

6

87

100

15142

67

15075

2289 52

2571

9

Tran Van Hoai 17

Maximal flow model

2010-2011

- one source node, generating flows- one terminal node, depositing flows- flow in = flow out on intermediate nodes- capacity Cij on arc from i to j

GOAL: to find maximum flow out of source to terminal, without exceeding arc capacities

Tran Van Hoai 18

Maximal flow problem

2010-2011

1 2

3

4

5

6

87

10

15

5

6

12

7

2

85

47

3

Tran Van Hoai 19

LP-based approach

• Xij: flow from node i to node j (if arc ij exists)

2010-2011

Tran Van Hoai 20

MAX X12 + X13

S.T. -X12 + X25 + X26 = 0-X13 + X34 + X35 = 0-X34 + X45 + X47 = 0-X25 - X35 - X45 + X57 = 0-X26 + X67 + X68 = 0-X47 - X57 - X67 + X78 = 0

Xij = 0 or 1X12≤1, X13≤2, X25≤3, X26≤4, X34≤5, X35≤6, X45≤7,

X47≤8,X57≤9,X67≤10,X68≤11,X78≤12

2010-2011

Tran Van Hoai 21

Maximal flow problem

2010-2011

1 2

3

4

5

6

87

10

15

5

6

12

7

2

85

47

3

7

5 7

5

57

5

Tran Van Hoai 22

Cuts in maximal flow problem

2010-2011

1 2

3

4

5

6

87

10

15

5

6

12

7

2

85

47

3

7

5 7

5

57

5

CUT(all flow from 1 → 8 must cross CUT)

Maximal flow (12) ≤ C25 + C26 + C35 + C45 + C47 (34)

Sum of arc capacities on the cut provides upper bound for maximal flow

Tran Van Hoai 23

Max flow/Min cut theorem

1. The value of max flow = the sum of capacities of min cut

2. The flow of all arcs on min cut will be at their upper bound

2010-2011

Tran Van Hoai 24

Traveling salesman network

• NP-Hard (cannot be solved in polynomial time)

• Connectivity network model

2010-2011

- m nodes- unit cost Cij utilizing arc from i to jGOAL: to find a minimum cost tour (cycle) visiting all nodes (not twice)

Tran Van Hoai 25

Solution methods

• Enumerating all possible tour (cycle)(m-1)! tours for m nodes in symmetric TSP

• LP-based approach

2010-2011

Define a set of decision variables Xij, which mean1 if arc ij is utilized

Xij =0 otherwise

Tran Van Hoai 26

Federal Emergency Managament Agency

2010-2011

12

3

4

H

3050

35

45

65

80

40

50

2540

Tran Van Hoai 27

Assignment constraints• Sum of arcs used out of each node is 1

X11 + X12 + X13 + X14 + X15 = 1

• Sum of arcs used into each node is 1X11 + X21 + X31 + X41 + X51 = 1

2010-2011

12

3

4

H

3050

35

45

65

80

40

50

2540INVALID

SOLUTION

Need constraints to remove subtours

Tran Van Hoai 28

Subtour constraints

• One-node subtour constraintsX11, X22, X33, X44, X55 ≤ 0

• Two-node subtour constraintsX12 + X21 ≤ 1, …

• Three-node subtour constraintsX12 + X23 + X31 ≤ 2, …

• Four-node subtour constraintsX12 + X23 + X34 + X41 ≤ 3, …

2010-2011

Tran Van Hoai 29

Vehicle routing problem

• Generalized TSP

2010-2011

Tran Van Hoai 30

Minimum spanning tree network

• Read textbook

2010-2011