Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology Tran Van Hoai
Products transported from Assembly line to Inspection are for Quality Control Ballston Electric Assembly line - Inspection Tran Van Hoai Which assembly line should be assigned to which inspection area (to minimize a given objective)?
Time to transport a unit of product from assembly line to inspection Inspection Area ABCDE Assembly Line Tran Van Hoai3 Time difference mainly comes from the distance difference among pair
MIN10X X 12 + … + 20X X 55 S.T. X 11 +X 12 +X 13 +X 14 +X 15 =1(Assemble line 1 is assigned) X 21 +X 22 +X 23 +X 24 +X 25 =1(Assemble line 2 is assigned) X 31 +X 32 +X 33 +X 34 +X 35 =1(Assemble line 3 is assigned) X 41 +X 42 +X 43 +X 44 +X 45 =1(Assemble line 4 is assigned) X 51 +X 52 +X 53 +X 54 +X 55 =1(Assemble line 5 is assigned) X 11 +X 21 +X 31 +X 41 +X 51 =1(Inspection area 1 is assigned) X 12 +X 22 +X 32 +X 42 +X 52 =1(Inspection area 2 is assigned) X 13 +X 23 +X 33 +X 43 +X 53 =1(Inspection area 3 is assigned) X 14 +X 24 +X 34 +X 44 +X 54 =1(Inspection area 4 is assigned) X 15 +X 25 +X 35 +X 45 +X 55 =1(Inspection area 5 is assigned) All X ij ’s ≥ 0 Define a set of decision variables X ij, which mean 1if Line i is assigned to Inspection j X ij = 0otherwise Define a set of decision variables X ij, which mean 1if Line i is assigned to Inspection j X ij = 0otherwise Formulation Tran Van Hoai4
Assignment networks Definition Can be solved by – Enumeration – LP – Transportation model – Dynamic programming – Branch-and-bound – Hungarian algorithm Tran Van Hoai5 - m workers are to be assigned to m jobs - Unit cost C ij for worker i performing job j Goal: to minimize total cost of assignment - m workers are to be assigned to m jobs - Unit cost C ij for worker i performing job j Goal: to minimize total cost of assignment
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 X 12 =0 – If Line 1 is assigned to Inspection B, then Line 2 must be assigned to Inspection D Tran Van Hoai6
Advanced issues (2) Additional constraints – If Line 1 is assigned to Inspection B, then Line 2 must be assigned to Inspection D X 12 ≤ X 24 – At least one in Lines {1,3,4} is assigned to Inspection E X 15 +X 35 +X 45 = Tran Van Hoai7
Generalized assignment model Tran Van Hoai8
Marriage service Tran Van Hoai9 ASSIGNMENT Each man only assigned to one woman Pair assignment requires a operational cost Each man only assigned to one woman Pair assignment requires a operational cost GOAL: to find a match having minimum total cost
Shortest path problem Tran Van Hoai n nodes, a starting node (source), an ending node (destination) - Arcs connecting adjacent nodes with non- negative distances d ij GOAL: to find a shortest path from source to destination - n nodes, a starting node (source), an ending node (destination) - Arcs connecting adjacent nodes with non- negative distances d ij GOAL: to find a shortest path from source to destination
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 Tran Van Hoai11 Not easy to include additional constraints (for non-IT users) Not easy to include additional constraints (for non-IT users)
LP-based approach Tran Van Hoai12 Define a set of decision variables X ij, which mean 1if arc ij is utilized X ij = 0otherwise Define a set of decision variables X ij, which mean 1if arc ij is utilized X ij = 0otherwise MIN∑d ij X ij S.T. = 1(for source) - = 0 (for intermediate nodes) - = -1(for destination) X ij = 0 or 1
MIN100X X 13 + … + 52X 78 S.T.X 12 +X 13 =1 -X 12 +X 25 +X 26 =0 -X 13 +X 34 +X 35 =0 -X 34 +X 45 +X 47 =0 -X 25 -X 35 -X 45 +X 57 =0 -X 26 +X 67 +X 68 =0 -X 47 -X 57 -X 67 +X 78 =0 -X 68 -X 78 = X ij = 0 or Tran Van Hoai13
Shortest path Tran Van Hoai
Additional constraints Not go through node 5 X 25 = X 35 = X 45 = X 57 = 0 Don’t have to remove node 5 Node 4 must be on the path X 45 +X 47 = Tran Van Hoai
Additional constraints If node 7 on path, then node 3 must on path X 35 + X 34 – X 78 ≥ 0 … Tran Van Hoai
Maximal flow model Tran Van Hoai17 - one source node, generating flows - one terminal node, depositing flows - flow in = flow out on intermediate nodes - capacity C ij on arc from i to j GOAL: to find maximum flow out of source to terminal, without exceeding arc capacities - one source node, generating flows - one terminal node, depositing flows - flow in = flow out on intermediate nodes - capacity C ij on arc from i to j GOAL: to find maximum flow out of source to terminal, without exceeding arc capacities
Maximal flow problem Tran Van Hoai
LP-based approach X ij : flow from node i to node j (if arc ij exists) Tran Van Hoai19
MAXX 12 + X 13 S.T.-X 12 +X 25 +X 26 =0 -X 13 +X 34 +X 35 =0 -X 34 +X 45 +X 47 =0 -X 25 -X 35 -X 45 +X 57 =0 -X 26 +X 67 +X 68 =0 -X 47 -X 57 -X 67 +X 78 =0 X ij = 0 or 1 X 12 ≤1, X 13 ≤2, X 25 ≤3, X 26 ≤4, X 34 ≤5, X 35 ≤6, X 45 ≤7, X 47 ≤8,X 57 ≤9,X 67 ≤10,X 68 ≤11,X 78 ≤ Tran Van Hoai20
Maximal flow problem Tran Van Hoai
Cuts in maximal flow problem Tran Van Hoai CUT (all flow from 1 → 8 must cross CUT) Maximal flow (12) ≤ C 25 + C 26 + C 35 + C 45 + C 47 (34) Sum of arc capacities on the cut provides upper bound for maximal flow
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 Tran Van Hoai23
Traveling salesman network NP-Hard (cannot be solved in polynomial time) Connectivity network model Tran Van Hoai24 - m nodes - unit cost C ij utilizing arc from i to j GOAL: to find a minimum cost tour (cycle) visiting all nodes (not twice) - m nodes - unit cost C ij utilizing arc from i to j GOAL: to find a minimum cost tour (cycle) visiting all nodes (not twice)
Solution methods Enumerating all possible tour (cycle) (m-1)! tours for m nodes in symmetric TSP LP-based approach Tran Van Hoai25 Define a set of decision variables X ij, which mean 1if arc ij is utilized X ij = 0otherwise Define a set of decision variables X ij, which mean 1if arc ij is utilized X ij = 0otherwise
Federal Emergency Managament Agency Tran Van Hoai H
Assignment constraints Sum of arcs used out of each node is 1 X 11 + X 12 + X 13 + X 14 + X 15 = 1 Sum of arcs used into each node is 1 X 11 + X 21 + X 31 + X 41 + X 51 = Tran Van Hoai H INVALID SOLUTION Need constraints to remove subtours
Subtour constraints One-node subtour constraints X 11, X 22, X 33, X 44, X 55 ≤ 0 Two-node subtour constraints X 12 + X 21 ≤ 1, … Three-node subtour constraints X 12 + X 23 + X 31 ≤ 2, … Four-node subtour constraints X 12 + X 23 + X 34 + X 41 ≤ 3, … Tran Van Hoai28
Vehicle routing problem Generalized TSP Tran Van Hoai29
Minimum spanning tree network Read textbook Tran Van Hoai30