Date post: | 27-Mar-2015 |
Category: |
Documents |
Upload: | abigail-dalton |
View: | 214 times |
Download: | 1 times |
1
15053 Thursday March 14
bull Introduction to Network Flows
bull Handouts Lecture Notes
2
Network Models
bull Linear Programming models that exhibit a very special structure
bull Can use this structure to dramatically reduce computational complexity
bull First widespread application of LP to problems of industrial logistics1048698bull Addresses huge number of diverse applications
3
Notation and Terminology
Note Network terminology is not (and never will be)standardized The same concept may be denoted inmany different ways
Called bull NETWORK bull directed graph bull digraph bull graphClass Handouts (AhujaMagnanti Orlin)Network G = (NA)Node set N = 1234Arc Set (12)(13)(32)(34)(24)
Also SeenGraph G = (VE)Vertex set V = 1234Edge set A=1-21-33-23-42-4
4
Directed and Undirected Networks
An Undirected Graph A Directed Graph
bull Networks are used to transport commodities bull physical goods (products liquids) bull communication bull electricity etc
bull The field of Network Optimization concerns optimization problems on networks
5
An Overview of Some Applications ofNetwork Optimization
Pipelines
Applications Physical analogof nodes
Physical analogof arcs Flow
Communicationsystems
phone exchangescomputers
transmissionfacilities satellites
Cables fiber opticlinks microwave
relay links
Voice messages
Data
Video transmissions
Hydraulic systemsPumping stationsReservoirs Lakes
Water Gas OilHydraulic fluids
Integratedcomputer circuits
Gates registersprocessors Wires Electrical current
Mechanical systems JointsRods Beams
Springs Heat Energy
Transportationsystems
IntersectionsAirports
Rail yards
HighwaysAirline routes
Railbeds
Passengersfreight
vehiclesoperators
6
Examples ofterms
Path Example 5 2 3 4(or 5 c 2 b 3 e 4)Note that directions are ignored
Directed Path Example 1 2 3 4 (or 1 a 2 b 3 e) Directions are important
Two paths a-b-e (or 1-2-3-4)and a-c-d-e (or 1-2-5-3-4)
a-b-c-d (or 1-2-3-4-1)b-a-d-c (or 3-2-1-4-3)e-b-a (or 1-3-2-1)c-d-e (or 3-4-1-3)
Cycles (loops)
Cycle or circuit (or loop) 1 2 3 1 (or 1 a 2 b 3 e)Note that directions are ignored
Directed Cycle (1 2 3 4 1) or 1 a 2 b 3 c 4 d 1Directions are important
7
More Definitions
A network is connected if every nodecan be reached from every othernode by following a sequence ofarcs in which direction is ignored
A spanning tree is a connected subset of a networkincluding all nodes but containing no loops
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
2
Network Models
bull Linear Programming models that exhibit a very special structure
bull Can use this structure to dramatically reduce computational complexity
bull First widespread application of LP to problems of industrial logistics1048698bull Addresses huge number of diverse applications
3
Notation and Terminology
Note Network terminology is not (and never will be)standardized The same concept may be denoted inmany different ways
Called bull NETWORK bull directed graph bull digraph bull graphClass Handouts (AhujaMagnanti Orlin)Network G = (NA)Node set N = 1234Arc Set (12)(13)(32)(34)(24)
Also SeenGraph G = (VE)Vertex set V = 1234Edge set A=1-21-33-23-42-4
4
Directed and Undirected Networks
An Undirected Graph A Directed Graph
bull Networks are used to transport commodities bull physical goods (products liquids) bull communication bull electricity etc
bull The field of Network Optimization concerns optimization problems on networks
5
An Overview of Some Applications ofNetwork Optimization
Pipelines
Applications Physical analogof nodes
Physical analogof arcs Flow
Communicationsystems
phone exchangescomputers
transmissionfacilities satellites
Cables fiber opticlinks microwave
relay links
Voice messages
Data
Video transmissions
Hydraulic systemsPumping stationsReservoirs Lakes
Water Gas OilHydraulic fluids
Integratedcomputer circuits
Gates registersprocessors Wires Electrical current
Mechanical systems JointsRods Beams
Springs Heat Energy
Transportationsystems
IntersectionsAirports
Rail yards
HighwaysAirline routes
Railbeds
Passengersfreight
vehiclesoperators
6
Examples ofterms
Path Example 5 2 3 4(or 5 c 2 b 3 e 4)Note that directions are ignored
Directed Path Example 1 2 3 4 (or 1 a 2 b 3 e) Directions are important
Two paths a-b-e (or 1-2-3-4)and a-c-d-e (or 1-2-5-3-4)
a-b-c-d (or 1-2-3-4-1)b-a-d-c (or 3-2-1-4-3)e-b-a (or 1-3-2-1)c-d-e (or 3-4-1-3)
Cycles (loops)
Cycle or circuit (or loop) 1 2 3 1 (or 1 a 2 b 3 e)Note that directions are ignored
Directed Cycle (1 2 3 4 1) or 1 a 2 b 3 c 4 d 1Directions are important
7
More Definitions
A network is connected if every nodecan be reached from every othernode by following a sequence ofarcs in which direction is ignored
A spanning tree is a connected subset of a networkincluding all nodes but containing no loops
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
3
Notation and Terminology
Note Network terminology is not (and never will be)standardized The same concept may be denoted inmany different ways
Called bull NETWORK bull directed graph bull digraph bull graphClass Handouts (AhujaMagnanti Orlin)Network G = (NA)Node set N = 1234Arc Set (12)(13)(32)(34)(24)
Also SeenGraph G = (VE)Vertex set V = 1234Edge set A=1-21-33-23-42-4
4
Directed and Undirected Networks
An Undirected Graph A Directed Graph
bull Networks are used to transport commodities bull physical goods (products liquids) bull communication bull electricity etc
bull The field of Network Optimization concerns optimization problems on networks
5
An Overview of Some Applications ofNetwork Optimization
Pipelines
Applications Physical analogof nodes
Physical analogof arcs Flow
Communicationsystems
phone exchangescomputers
transmissionfacilities satellites
Cables fiber opticlinks microwave
relay links
Voice messages
Data
Video transmissions
Hydraulic systemsPumping stationsReservoirs Lakes
Water Gas OilHydraulic fluids
Integratedcomputer circuits
Gates registersprocessors Wires Electrical current
Mechanical systems JointsRods Beams
Springs Heat Energy
Transportationsystems
IntersectionsAirports
Rail yards
HighwaysAirline routes
Railbeds
Passengersfreight
vehiclesoperators
6
Examples ofterms
Path Example 5 2 3 4(or 5 c 2 b 3 e 4)Note that directions are ignored
Directed Path Example 1 2 3 4 (or 1 a 2 b 3 e) Directions are important
Two paths a-b-e (or 1-2-3-4)and a-c-d-e (or 1-2-5-3-4)
a-b-c-d (or 1-2-3-4-1)b-a-d-c (or 3-2-1-4-3)e-b-a (or 1-3-2-1)c-d-e (or 3-4-1-3)
Cycles (loops)
Cycle or circuit (or loop) 1 2 3 1 (or 1 a 2 b 3 e)Note that directions are ignored
Directed Cycle (1 2 3 4 1) or 1 a 2 b 3 c 4 d 1Directions are important
7
More Definitions
A network is connected if every nodecan be reached from every othernode by following a sequence ofarcs in which direction is ignored
A spanning tree is a connected subset of a networkincluding all nodes but containing no loops
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
4
Directed and Undirected Networks
An Undirected Graph A Directed Graph
bull Networks are used to transport commodities bull physical goods (products liquids) bull communication bull electricity etc
bull The field of Network Optimization concerns optimization problems on networks
5
An Overview of Some Applications ofNetwork Optimization
Pipelines
Applications Physical analogof nodes
Physical analogof arcs Flow
Communicationsystems
phone exchangescomputers
transmissionfacilities satellites
Cables fiber opticlinks microwave
relay links
Voice messages
Data
Video transmissions
Hydraulic systemsPumping stationsReservoirs Lakes
Water Gas OilHydraulic fluids
Integratedcomputer circuits
Gates registersprocessors Wires Electrical current
Mechanical systems JointsRods Beams
Springs Heat Energy
Transportationsystems
IntersectionsAirports
Rail yards
HighwaysAirline routes
Railbeds
Passengersfreight
vehiclesoperators
6
Examples ofterms
Path Example 5 2 3 4(or 5 c 2 b 3 e 4)Note that directions are ignored
Directed Path Example 1 2 3 4 (or 1 a 2 b 3 e) Directions are important
Two paths a-b-e (or 1-2-3-4)and a-c-d-e (or 1-2-5-3-4)
a-b-c-d (or 1-2-3-4-1)b-a-d-c (or 3-2-1-4-3)e-b-a (or 1-3-2-1)c-d-e (or 3-4-1-3)
Cycles (loops)
Cycle or circuit (or loop) 1 2 3 1 (or 1 a 2 b 3 e)Note that directions are ignored
Directed Cycle (1 2 3 4 1) or 1 a 2 b 3 c 4 d 1Directions are important
7
More Definitions
A network is connected if every nodecan be reached from every othernode by following a sequence ofarcs in which direction is ignored
A spanning tree is a connected subset of a networkincluding all nodes but containing no loops
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
5
An Overview of Some Applications ofNetwork Optimization
Pipelines
Applications Physical analogof nodes
Physical analogof arcs Flow
Communicationsystems
phone exchangescomputers
transmissionfacilities satellites
Cables fiber opticlinks microwave
relay links
Voice messages
Data
Video transmissions
Hydraulic systemsPumping stationsReservoirs Lakes
Water Gas OilHydraulic fluids
Integratedcomputer circuits
Gates registersprocessors Wires Electrical current
Mechanical systems JointsRods Beams
Springs Heat Energy
Transportationsystems
IntersectionsAirports
Rail yards
HighwaysAirline routes
Railbeds
Passengersfreight
vehiclesoperators
6
Examples ofterms
Path Example 5 2 3 4(or 5 c 2 b 3 e 4)Note that directions are ignored
Directed Path Example 1 2 3 4 (or 1 a 2 b 3 e) Directions are important
Two paths a-b-e (or 1-2-3-4)and a-c-d-e (or 1-2-5-3-4)
a-b-c-d (or 1-2-3-4-1)b-a-d-c (or 3-2-1-4-3)e-b-a (or 1-3-2-1)c-d-e (or 3-4-1-3)
Cycles (loops)
Cycle or circuit (or loop) 1 2 3 1 (or 1 a 2 b 3 e)Note that directions are ignored
Directed Cycle (1 2 3 4 1) or 1 a 2 b 3 c 4 d 1Directions are important
7
More Definitions
A network is connected if every nodecan be reached from every othernode by following a sequence ofarcs in which direction is ignored
A spanning tree is a connected subset of a networkincluding all nodes but containing no loops
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
6
Examples ofterms
Path Example 5 2 3 4(or 5 c 2 b 3 e 4)Note that directions are ignored
Directed Path Example 1 2 3 4 (or 1 a 2 b 3 e) Directions are important
Two paths a-b-e (or 1-2-3-4)and a-c-d-e (or 1-2-5-3-4)
a-b-c-d (or 1-2-3-4-1)b-a-d-c (or 3-2-1-4-3)e-b-a (or 1-3-2-1)c-d-e (or 3-4-1-3)
Cycles (loops)
Cycle or circuit (or loop) 1 2 3 1 (or 1 a 2 b 3 e)Note that directions are ignored
Directed Cycle (1 2 3 4 1) or 1 a 2 b 3 c 4 d 1Directions are important
7
More Definitions
A network is connected if every nodecan be reached from every othernode by following a sequence ofarcs in which direction is ignored
A spanning tree is a connected subset of a networkincluding all nodes but containing no loops
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
7
More Definitions
A network is connected if every nodecan be reached from every othernode by following a sequence ofarcs in which direction is ignored
A spanning tree is a connected subset of a networkincluding all nodes but containing no loops
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
8
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flow st Flow out of i - Flow into i = bi Flow on arc (ij) le uij
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
9
The Minimum Cost Flow Problem
Let xij be the flow on arc (ij)
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 le xij le uij
Minimizest for all i
for all i-j
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
10
Example Formulation
Min -3 x12 + 8 x13 + 7 x23 + 3 x24 + 2 x34
st x12 + x13 = 4 x23+ x24 - x12 = 3 x34 - x13 - x23 = -5 - x24 - x34 = -2 0 le x12 le 6 0 le x13 le 5 0 le x23 le 2 0 le x24 le 4 0 le x34 le 7
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
11
An Application of the Minimum CostFlow Problem
Ship from suppliers to customers possibly throughwarehouses at minimum cost to meet demands
Warehouses
Customers
Demands
PlantsSupplies
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
12
Useful Facts About The MinimumCost Flow Problem
bull Suppose the following properties of the constraint matrix A (ignoring simple upper and lower variable bounds such as x le 7) hold (1) all entries of A are 0 or 1 or -1 (2) there is at most one 1 in any column and at most one -1bull Then this is a minimum cost flow problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
13
Useful Facts (contrsquod)
Theorem If one carries out the simplex algorithm on the minimum cost flow problem with integer valued capacities and RHS then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1
Corollary The optimal LP solution is integer valued
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
14
The Minimum Cost Flow Problem
Network G = (N A) ndash Node set N arc set A ndash Capacities uij on arc (ij) ndash Cost cij on arc (ij) ndash Supplydemand bi for node i (Positive indicates supply)
A network with costscapacities supplies demands
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
Flow on arc (ij) le uij
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
15
The Transportation Problem
Suppose that one wants to ship from warehouses toretailers
In this example 3 warehouses 4 retailersai is the supply at warehouse ibj is the demand at retailer jcij is the cost of shipping from i to jThere are no capacities on the arcs
Let xij be the amount of flow shippedfrom warehouse i to retailer jHow do we formulate an LP
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
16
The Transportation Problem is a MinCost Flow Problem
Minimize the cost of sending flowst Flow out of i - Flow into i = bi
0 lexij leuij
Flow out occurs at the supply nodesFlow in occurs at demand nodesCapacities are infinite uij= infin
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
17
The Transportation Problem
In general the LP formulation is given as
Minimize
All arcs arefrom a node inS to a node inD anduncapacitated
S Supply nodes
D Demand nodes
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
18
Useful Facts About TransportationProblem
Suppose that (1) the constraint matrix can be partitioned into A1x = b1 and A2x = b2 (2) all entries of A1 and A2 are 0 or 1 (3) there is at most one 1 in any column of A1 or A2Then this is a transportation problemTheorem If one carries out the simplex algorithm on the transportation problem then at every iteration of the simplex algorithm each coefficient in the tableau (except for costs and RHS) is either 0 or -1 or 1 The costs and RHS are both integer valuedCorollary The optimal solution to the LP is integer valued
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
19
The Assignment Problem
Suppose that one wants to assign tasks to persons
Tasks Persons
In this example 4 tasks 3 personsNo two tasks to the same personEach person gets a taskcij is the ldquocostrdquo of assigning task ito person j
Let xij = 1 if task i is assigned to jLet xij = 0 otherwiseHow do we formulate an LP
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
20
The Assignment Problem
In general the LP formulation is given as
Minimize
Each supply is 1
Each demand is 1
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
21
More on the Assignment Problem
Tasks PersonsThe assignment problem isa special case of thetransportation problem
The simplex algorithm cansolve the LP relaxation andit will give integer answersthat is it will solve theassignment problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
22
An Application of the AssignmentProblem
Suppose that there are moving targets in space You can identifyeach target as a pixel on a radar screen Given two successivepictures identify how the targets have moved
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
23
The Maximum Flow Problem
Network G = (N A)
ndash Source s and sink t
ndash Capacities uij on arc (ij)
ndash Variable Flow xij on arc (ij) Graph with capacities
Maximize the flow leaving sst Flow out of i - Flow into i = 0 for i ne s t
0 le xij le uij
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
24
The Max Flow Problem
In general the LP formulation is given as
Minimize v
otherwise
This is not formulated as a special case of aminimum cost flow formulationCan we reformulate it in this way
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
25
More on the maximum flow problem
Is the current flow optimal
An s-t cut is a separation ofthe nodes into two parts Sand T with s in S and t in T
The capacity of the cut isthe sum of the capacitiesfrom S to T
The max flow from s to t isat most the capacity of anys-t cut
Graph with capacitiesand flows (underlined)
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
26
The Shortest Path Problem
What is the shortest path from an origin or sourcenode (often denoted as s) to a destination or sink node(often denoted as t) What is the shortest path fromnode 1 to node 6Assumptions for now 1 There is a path from node s to all other nodes 2 All arc lengths are non-negative
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
27
Direct Applications
bull What is the path with the shortest driving time from 77 Massachusetts Avenue to Boston City Hall
bull What is the path from Building 7 to Building E40 that minimizes the time spent outside
bull1048698What is the communication path from i to j that is the fastest (taking into account congestion at nodes)
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
28
Formulation as a linear program
In general the LP formulation is given as
Minimize
otherwise
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
29
The Shortest Path Problem1048698bull Fact The Shortest path problem is a special case of the minimum cost flow problem
bull Lots of interesting applications (coming up)
bull Very fast algorithm (coming up)
bull Connection to dynamic programming (several lectures from now)
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem
30
Conclusions
bull Advantages of the transportation problem and the minimum cost flow problem ndash Integer solutions ndash Very fast solution methods ndash Extremely common in modeling
bull Today we saw the following ndash The minimum cost flow problem ndash The transportation problem ndash The assignment problem ndash The maximum flow problem ndash The shortest path problem