minimum cost flow problem · march 10, 2015. announcements. hw 2 due today exam on thursday, topics...

31
Minimum cost flow problem CE 377K March 10, 2015

Upload: others

Post on 23-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Minimum cost flow problem

CE 377K

March 10, 2015

Page 2: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

ANNOUNCEMENTS

Page 3: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

HW 2 due today

Exam on Thursday, topics of coverage are through max-flow/min-cutduality (February 26 notes).

Emails marked as spam

Min cost flow Announcements

Page 4: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

REVIEW

Page 5: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Augmenting path algorithm

Capacity scaling

Complexity arguments Proof of augmenting path algo AND max flow-mincut

Min cost flow Review

Page 6: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

MINIMUM COST FLOWPROBLEM

Page 7: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Minimum Cost Flow Problem

Respecting capacities, find link flows which balance supply and demandamong sources and sinks, with minimum total cost.

Min cost flow Minimum Cost Flow Problem

Page 8: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Applications

Logistics and shipping

Earthwork in roadway construction

Passenger selection in ridesharing

Min cost flow Minimum Cost Flow Problem

Page 9: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Each link (i , j) has a specified cost cij and capacity uij , and we mustdetermine its flow xij .

Each node has a supply bi . If bi > 0, the node is a source, if bi < 0 it is asink, and if bi = 0 it is a transhipment node.

We want to minimize the total transportation cost∑

(i ,j)∈A cijxij .

Constrants are the link capacities, and flow conservation.

Min cost flow Minimum Cost Flow Problem

Page 10: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

maxx

∑(i ,j)∈A

cijxij

s.t.∑

(i ,j)∈A(i)

xij −∑

(h,i)∈B(i)

xhi = bi ∀i ∈ N

0 ≤ xij ≤ uij ∀(i , j) ∈ A

Min cost flow Minimum Cost Flow Problem

Page 11: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

ExampleSupply chain logistics can often be represented by a min cost flow problem.

The following model is based on Shahabi, Unnikrishnan, Shirazi & Boyles(2014). A three-level location-inventory problem with correlated demand.Transportation Research Part B 69, 1–18.

Min cost flow Minimum Cost Flow Problem

Page 12: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

There are three kinds of nodes, representing manufacturing plants,warehouses, and retailers.Each manufacturing plant produces a certain quantity of product, whichmust be shipped first to a warehouse, and then from a warehouse to aretailer which will sell a prespecified quantity of product.

Manufacturing plants

Warehouses Retailers

(The paper considered other factors: locations of plants and warehouseswere decision variables, and demand was a random variable not known inadvance.)

Min cost flow Minimum Cost Flow Problem

Page 13: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

There is a transportation cost between each plant and warehouse, andbetween each warehouse and retailer.

These transportation links have a capacity; furthermore, each warehousehas a capacity.

Manufacturing plants Warehouses Retailers

+2

+5

+4

-3

-6

-1

-1

Shipping costs and capacity

Storage cost and capacity

Min cost flow Minimum Cost Flow Problem

Page 14: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

RELATION TO OTHERPROBLEMS

Page 15: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

The minimum cost flow problem can be seen as a generalization of theshortest path and maximum flow problems.

That is, by suitably choosing costs, capacities, and supplies we can solveshortest path or maximum flow using any method which will solve mincost flow.

(Naturally, this means that solving the minimum cost flow problem mustbe at least as hard as solving shortest path or max flow.)

Min cost flow Relation to other problems

Page 16: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Transformation to shortest path problemFor each link, set uij to ∞. (Capacities ignored in shortest path.)

For the origin r , set br = +1. For the destination s, set bs = −1. For allother nodes i , bi = 0.

r

s

+1

-1

Min cost flow Relation to other problems

Page 17: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Transformation to maximum flow problemCreate an artificial link (s, r) connecting the sink s to the source r , withcapacity usr =∞.

Set cij = 0 for all links, except the artificial link, which gets cost csr = −1.

r

s

Cost -1

Min cost flow Relation to other problems

Page 18: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

SUCCESSIVE SHORTESTPATH ALGORITHM

Page 19: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Like the augmenting path algorithm, the successive shortest pathalgorithm also uses the residual graph R(x).

As before, the capacity of a forward link is uij − xij , and the capacity of areverse link is xij .

The cost of a forward link is cij , the cost of a reverse link is −cij .

Forward links show what happens if we increase the flow on a link, reverselinks show what happens if we decrease the flow on a link.

Min cost flow Successive shortest path algorithm

Page 20: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Algorithm

1 Start with the zero flow x← 0.

2 Choose a node r with b(r) > 0 and a sink node s with b(s) < 0. (Ifnone exist, terminate.)

3 Create the residual graph R(x) and find the shortest path π from r tos with positive capacity.

4 Calculate the amount of flow which can be sent on this path:∆ = min{b(r), |b(s)|, uij : (i , j) ∈ π}.

5 Update the flow, adding ∆ on the forward links in π and subtracting∆ from the reverse links; also reduce b(r) by ∆ and increase b(s) by∆.

6 Return to step 2.

Min cost flow Successive shortest path algorithm

Page 21: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Min cost flow Successive shortest path algorithm

Page 22: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

(Links in residual graph labeled with cost and capacity. Zero-capacity linksomitted for clarity.)

Min cost flow Successive shortest path algorithm

Page 23: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

(Links in residual graph labeled with cost and capacity. Zero-capacity linksomitted for clarity.)

Min cost flow Successive shortest path algorithm

Page 24: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

(Links in residual graph labeled with cost and capacity. Zero-capacity linksomitted for clarity.)

Min cost flow Successive shortest path algorithm

Page 25: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

Min cost flow Successive shortest path algorithm

Page 26: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Second example

Min cost flow Successive shortest path algorithm

Page 27: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

(Links in residual graph labeled with cost and capacity. Zero-capacity linksomitted for clarity.)

Min cost flow Successive shortest path algorithm

Page 28: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

(Links in residual graph labeled with cost and capacity. Zero-capacity linksomitted for clarity.)

Min cost flow Successive shortest path algorithm

Page 29: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

(Links in residual graph labeled with cost and capacity. Zero-capacity linksomitted for clarity.)

Min cost flow Successive shortest path algorithm

Page 30: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

(Links in residual graph labeled with cost and capacity. Zero-capacity linksomitted for clarity.)

Min cost flow Successive shortest path algorithm

Page 31: Minimum cost flow problem · March 10, 2015. ANNOUNCEMENTS. HW 2 due today Exam on Thursday, topics of coverage are through max-ow/min-cut duality (February 26 notes). ... Earthwork

Example

Min cost flow Successive shortest path algorithm