39
Example: Minimum Cost Flow Problem Given: directed graph D =(V , A), with arc capacities u : A ! R 0 , arc costs c : A ! R, and node balances b : V ! R. Interpretation: I nodes v 2 V with b(v ) > 0(b(v ) < 0) have supply (demand) and are called sources (sinks) I the capacity u(a) of arc a 2 A limits the amount of flow that can be sent through arc a. Task: find a flow x : A ! R 0 obeying capacities and satisfying all supplies and demands, that is, 0 x (a) u(a) for all a 2 A, X a2δ + (v ) x (a) - X a2δ - (v ) x (a)= b(v ) for all v 2 V , such that x has minimum cost c (x ) := P a2A c (a) · x (a). 23

Example: Minimum Cost Flow Problemgairing/COMP557/board/20180927.pdf · Example: Minimum Cost Flow Problem Given: directed graph D =(V,A),witharccapacities u : A ! R0, arc costs c

  • Upload
    others

  • View
    17

  • Download
    0

Embed Size (px)

Citation preview

Example: Minimum Cost Flow Problem

Given: directed graph D = (V ,A), with arc capacities u : A ! R�0,arc costs c : A ! R, and node balances b : V ! R.

Interpretation:I nodes v 2 V with b(v) > 0 (b(v) < 0) have supply (demand) and are called

sources (sinks)I the capacity u(a) of arc a 2 A limits the amount of flow that can be sent through

arc a.

Task: find a flow x : A ! R�0 obeying capacities and satisfying all supplies anddemands, that is,

0 x(a) u(a) for all a 2 A,X

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V ,

such that x has minimum cost c(x) :=P

a2A c(a) · x(a).

23

Example: Minimum Cost Flow Problem (cont.)

Formulation as a linear program (LP):

minimizeX

a2Ac(a) · x(a) (1.1)

subject toX

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V , (1.2)

x(a) u(a) for all a 2 A, (1.3)x(a) � 0 for all a 2 A. (1.4)

I Objective function given by (1.1). Set of feasible solutions:

X = {x 2 RA | x satisfies (1.2), (1.3), and (1.4)} .

I Notice that (1.1) is a linear function of x and (1.2) – (1.4) are linear equations andlinear inequalities, respectively. �! linear program

24

Example: Minimum Cost Flow Problem (cont.)

Formulation as a linear program (LP):

minimizeX

a2Ac(a) · x(a) (1.1)

subject toX

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V , (1.2)

x(a) u(a) for all a 2 A, (1.3)x(a) � 0 for all a 2 A. (1.4)

I Objective function given by (1.1). Set of feasible solutions:

X = {x 2 RA | x satisfies (1.2), (1.3), and (1.4)} .

I Notice that (1.1) is a linear function of x and (1.2) – (1.4) are linear equations andlinear inequalities, respectively. �! linear program

24

Example: Minimum Cost Flow Problem (cont.)

Formulation as a linear program (LP):

minimizeX

a2Ac(a) · x(a) (1.1)

subject toX

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V , (1.2)

x(a) u(a) for all a 2 A, (1.3)x(a) � 0 for all a 2 A. (1.4)

I Objective function given by (1.1). Set of feasible solutions:

X = {x 2 RA | x satisfies (1.2), (1.3), and (1.4)} .

I Notice that (1.1) is a linear function of x and (1.2) – (1.4) are linear equations andlinear inequalities, respectively. �! linear program

24

Example (cont.): Adding Fixed Cost

Fixed costs w : A ! R�0.

If arc a 2 A shall be used (i. e., x(a) > 0), it must be bought at cost w(a).

Add variables y(a) 2 {0, 1} with y(a) = 1 if arc a is used, 0 otherwise.

This leads to the following mixed-integer linear program (MIP):

minimizeX

a2Ac(a) · x(a) +

X

a2Aw(a) · y(a)

subject toX

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V ,

x(a) u(a) · y(a) for all a 2 A,x(a) � 0 for all a 2 A.y(a) 2 {0, 1} for all a 2 A.

MIP: Linear program where some variables may only take integer values.

25

Example (cont.): Adding Fixed Cost

Fixed costs w : A ! R�0.

If arc a 2 A shall be used (i. e., x(a) > 0), it must be bought at cost w(a).

Add variables y(a) 2 {0, 1} with y(a) = 1 if arc a is used, 0 otherwise.

This leads to the following mixed-integer linear program (MIP):

minimizeX

a2Ac(a) · x(a) +

X

a2Aw(a) · y(a)

subject toX

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V ,

x(a) u(a) · y(a) for all a 2 A,x(a) � 0 for all a 2 A.y(a) 2 {0, 1} for all a 2 A.

MIP: Linear program where some variables may only take integer values.

25

Example (cont.): Adding Fixed Cost

Fixed costs w : A ! R�0.

If arc a 2 A shall be used (i. e., x(a) > 0), it must be bought at cost w(a).

Add variables y(a) 2 {0, 1} with y(a) = 1 if arc a is used, 0 otherwise.

This leads to the following mixed-integer linear program (MIP):

minimizeX

a2Ac(a) · x(a) +

X

a2Aw(a) · y(a)

subject toX

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V ,

x(a) u(a) · y(a) for all a 2 A,x(a) � 0 for all a 2 A.y(a) 2 {0, 1} for all a 2 A.

MIP: Linear program where some variables may only take integer values.

25

Example (cont.): Adding Fixed Cost

Fixed costs w : A ! R�0.

If arc a 2 A shall be used (i. e., x(a) > 0), it must be bought at cost w(a).

Add variables y(a) 2 {0, 1} with y(a) = 1 if arc a is used, 0 otherwise.

This leads to the following mixed-integer linear program (MIP):

minimizeX

a2Ac(a) · x(a) +

X

a2Aw(a) · y(a)

subject toX

a2�+(v)

x(a)�X

a2��(v)

x(a) = b(v) for all v 2 V ,

x(a) u(a) · y(a) for all a 2 A,x(a) � 0 for all a 2 A.y(a) 2 {0, 1} for all a 2 A.

MIP: Linear program where some variables may only take integer values.

25

Example: Maximum Weighted Matching Problem

Given: undirected graph G = (V ,E ), weight function w : E ! R.

Task: find matching M ✓ E with maximum total weight.

(M ✓ E is a matching if every node is incident to at most one edge in M.)

Formulation as an integer linear program (IP):

Variables: xe 2 {0, 1} for e 2 E with xe = 1 if and only if e 2 M.

maximizeX

e2Ew(e) · xe

subject toX

e2�(v)

xe 1 for all v 2 V ,

xe 2 {0, 1} for all e 2 E .

IP: Linear program where all variables may only take integer values.

26

Example: Maximum Weighted Matching Problem

Given: undirected graph G = (V ,E ), weight function w : E ! R.

Task: find matching M ✓ E with maximum total weight.

(M ✓ E is a matching if every node is incident to at most one edge in M.)

Formulation as an integer linear program (IP):

Variables: xe 2 {0, 1} for e 2 E with xe = 1 if and only if e 2 M.

maximizeX

e2Ew(e) · xe

subject toX

e2�(v)

xe 1 for all v 2 V ,

xe 2 {0, 1} for all e 2 E .

IP: Linear program where all variables may only take integer values.

26

Example: Maximum Weighted Matching Problem

Given: undirected graph G = (V ,E ), weight function w : E ! R.

Task: find matching M ✓ E with maximum total weight.

(M ✓ E is a matching if every node is incident to at most one edge in M.)

Formulation as an integer linear program (IP):

Variables: xe 2 {0, 1} for e 2 E with xe = 1 if and only if e 2 M.

maximizeX

e2Ew(e) · xe

subject toX

e2�(v)

xe 1 for all v 2 V ,

xe 2 {0, 1} for all e 2 E .

IP: Linear program where all variables may only take integer values.

26

Example: Maximum Weighted Matching Problem

Given: undirected graph G = (V ,E ), weight function w : E ! R.

Task: find matching M ✓ E with maximum total weight.

(M ✓ E is a matching if every node is incident to at most one edge in M.)

Formulation as an integer linear program (IP):

Variables: xe 2 {0, 1} for e 2 E with xe = 1 if and only if e 2 M.

maximizeX

e2Ew(e) · xe

subject toX

e2�(v)

xe 1 for all v 2 V ,

xe 2 {0, 1} for all e 2 E .

IP: Linear program where all variables may only take integer values.

26

Example: Traveling Salesperson Problem (TSP)

Given: complete graph Kn on n nodes, weight function w : E (Kn) ! R.

Task: find a Hamiltonian circuit with minimum total weight.

(A Hamiltonian circuit visits every node exactly once.)

Application: Drilling holes in printed circuit boards.

Formulation as an integer linear program? (maybe later!)

27

Example: Traveling Salesperson Problem (TSP)

Given: complete graph Kn on n nodes, weight function w : E (Kn) ! R.

Task: find a Hamiltonian circuit with minimum total weight.

(A Hamiltonian circuit visits every node exactly once.)

Application: Drilling holes in printed circuit boards.

Formulation as an integer linear program? (maybe later!)

27

Example: Traveling Salesperson Problem (TSP)

Given: complete graph Kn on n nodes, weight function w : E (Kn) ! R.

Task: find a Hamiltonian circuit with minimum total weight.

(A Hamiltonian circuit visits every node exactly once.)

Application: Drilling holes in printed circuit boards.

Formulation as an integer linear program? (maybe later!)

27

Example: Weighted Vertex Cover Problem

Given: undirected graph G = (V ,E ), weight function w : V ! R�0.

Task: find U ✓ V of minimum total weight such that every edge e 2 E has at least oneendpoint in U.

Formulation as an integer linear program (IP):

Variables: xv 2 {0, 1} for v 2 V with xv = 1 if and only if v 2 U.

minimizeX

v2Vw(v) · xv

subject to xv + xv 0 � 1 for all e = {v , v 0} 2 E ,xv 2 {0, 1} for all v 2 V .

28

Example: Weighted Vertex Cover Problem

Given: undirected graph G = (V ,E ), weight function w : V ! R�0.

Task: find U ✓ V of minimum total weight such that every edge e 2 E has at least oneendpoint in U.

Formulation as an integer linear program (IP):

Variables: xv 2 {0, 1} for v 2 V with xv = 1 if and only if v 2 U.

minimizeX

v2Vw(v) · xv

subject to xv + xv 0 � 1 for all e = {v , v 0} 2 E ,xv 2 {0, 1} for all v 2 V .

28

Example: Weighted Vertex Cover Problem

Given: undirected graph G = (V ,E ), weight function w : V ! R�0.

Task: find U ✓ V of minimum total weight such that every edge e 2 E has at least oneendpoint in U.

Formulation as an integer linear program (IP):

Variables: xv 2 {0, 1} for v 2 V with xv = 1 if and only if v 2 U.

minimizeX

v2Vw(v) · xv

subject to xv + xv 0 � 1 for all e = {v , v 0} 2 E ,xv 2 {0, 1} for all v 2 V .

28

Markowitz’ Portfolio Optimisation Problem

Given: n different securities (stocks, bonds, etc.) with random returns, target return R ,for each security i 2 [n]:I expected return µi , variance �i

For each pair of securities i , j :I covariance ⇢ij ,

Task: Find a portfolio x1, . . . , xn that minimises “risk” (aka variance) and has expectedreturn � R .

Formulation as a quadratic programme (QP):

minimizeX

i ,j

⇢ij�i�jxixj

subject toX

i

xi = 1

X

i

µixi � R

xi � 0, for all i .

29

Markowitz’ Portfolio Optimisation Problem

Given: n different securities (stocks, bonds, etc.) with random returns, target return R ,for each security i 2 [n]:I expected return µi , variance �i

For each pair of securities i , j :I covariance ⇢ij ,

Task: Find a portfolio x1, . . . , xn that minimises “risk” (aka variance) and has expectedreturn � R .

Formulation as a quadratic programme (QP):

minimizeX

i ,j

⇢ij�i�jxixj

subject toX

i

xi = 1

X

i

µixi � R

xi � 0, for all i .

29

Markowitz’ Portfolio Optimisation Problem

Given: n different securities (stocks, bonds, etc.) with random returns, target return R ,for each security i 2 [n]:I expected return µi , variance �i

For each pair of securities i , j :I covariance ⇢ij ,

Task: Find a portfolio x1, . . . , xn that minimises “risk” (aka variance) and has expectedreturn � R .

Formulation as a quadratic programme (QP):

minimizeX

i ,j

⇢ij�i�jxixj

subject toX

i

xi = 1

X

i

µixi � R

xi � 0, for all i .

29

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Typical Questions

For a given optimization problem:

I How to find an optimal solution?

I How to find a feasible solution?

I Does there exist an optimal/feasible solution?

I How to prove that a computed solution is optimal?

I How difficult is the problem?

I Does there exist an efficient algorithm with “small” worst-case running time?

I How to formulate the problem as a (mixed integer) linear program?

I Is there a useful special structure of the problem?

30

Literature on Linear Optimization (not complete)

I D. Bertsimas, J. N. Tsitsiklis, Introduction to Linear Optimization, Athena, 1997.

I V. Chvatal, Linear Programming, Freeman, 1983.

I G. B. Dantzig, Linear Programming and Extensions, Princeton University Press,1998 (1963).

I M. Grötschel, L. Lovàsz, A. Schrijver, Geometric Algorithms and Combinatorial

Optimization. Springer, 1988.

I J. Matousek, B. Gärtner, Using and Understanding Linear Programming, Springer,2006.

I M. Padberg, Linear Optimization and Extensions, Springer, 1995.

I A. Schrijver, Theory of Linear and Integer Programming, Wiley, 1986.

I R. J. Vanderbei, Linear Programming, Springer, 2001.

31

Literature on Combinatorial Optimization (not complete)

I R. K. Ahuja, T. L. Magnanti, J. B. Orlin, Network Flows: Theory, Algorithms, and

Applications, Prentice-Hall, 1993.I W. J. Cook, W. H. Cunningham, W. R. Pulleyblank, A. Schrijver, Combinatorial

Optimization, Wiley, 1998.I L. R. Ford, D. R. Fulkerson, Flows in Networks, Princeton University Press, 1962.I M. R. Garey, D. S. Johnson, Computers and Intractability: A Guide to the Theory

of NP-Completeness, Freeman, 1979.I B. Korte, J. Vygen, Combinatorial Optimization: Theory and Algorithms, Springer,

2002.I C. H. Papadimitriou, K. Steiglitz, Combinatorial Optimization: Algorithms and

Complexity, Dover Publications, reprint 1998.I A. Schrijver, Combinatorial Optimization: Polyhedra and Efficiency, Springer, 2003.

32

Chapter 2:Linear Programming Basics

(Bertsimas & Tsitsiklis, Chapter 1)

33

Example of a Linear Program

minimize 2x1 � x2 + 4x3

subject to x1 + x2 + x4 2

3x2 � x3 = 5

x3 + x4 � 3

x1 � 0

x3 0

Remarks.I objective function is linear in vector of variables x = (x1, x2, x3, x4)T

I constraints are linear inequalities and linear equationsI last two constraints are special

(non-negativity and non-positivity constraint, respectively)

34

Example of a Linear Program

minimize 2x1 � x2 + 4x3

subject to x1 + x2 + x4 2

3x2 � x3 = 5

x3 + x4 � 3

x1 � 0

x3 0

Remarks.I objective function is linear in vector of variables x = (x1, x2, x3, x4)T

I constraints are linear inequalities and linear equationsI last two constraints are special

(non-negativity and non-positivity constraint, respectively)

34

General Linear Program

minimize cT · xsubject to ai

T · x � bi for i 2 M1, (2.1)

aiT · x = bi for i 2 M2, (2.2)

aiT · x bi for i 2 M3, (2.3)

xj � 0 for j 2 N1, (2.4)xj 0 for j 2 N2, (2.5)

with c 2 Rn, ai 2 Rn and bi 2 R for i 2 M1 [̇M2 [̇M3 (finite index sets), andN1,N2 ✓ {1, . . . , n} given.

I x 2 Rn satisfying constraints (2.1) – (2.5) is a feasible solution.I feasible solution x⇤ is optimal solution if

cT · x⇤ cT · x for all feasible solutions x .

I linear program is unbounded if, for all k 2 R, there is a feasible solution x 2 Rn

with cT · x k .

35

General Linear Program

minimize cT · xsubject to ai

T · x � bi for i 2 M1, (2.1)

aiT · x = bi for i 2 M2, (2.2)

aiT · x bi for i 2 M3, (2.3)

xj � 0 for j 2 N1, (2.4)xj 0 for j 2 N2, (2.5)

with c 2 Rn, ai 2 Rn and bi 2 R for i 2 M1 [̇M2 [̇M3 (finite index sets), andN1,N2 ✓ {1, . . . , n} given.

I x 2 Rn satisfying constraints (2.1) – (2.5) is a feasible solution.I feasible solution x⇤ is optimal solution if

cT · x⇤ cT · x for all feasible solutions x .

I linear program is unbounded if, for all k 2 R, there is a feasible solution x 2 Rn

with cT · x k .

35

General Linear Program

minimize cT · xsubject to ai

T · x � bi for i 2 M1, (2.1)

aiT · x = bi for i 2 M2, (2.2)

aiT · x bi for i 2 M3, (2.3)

xj � 0 for j 2 N1, (2.4)xj 0 for j 2 N2, (2.5)

with c 2 Rn, ai 2 Rn and bi 2 R for i 2 M1 [̇M2 [̇M3 (finite index sets), andN1,N2 ✓ {1, . . . , n} given.

I x 2 Rn satisfying constraints (2.1) – (2.5) is a feasible solution.

I feasible solution x⇤ is optimal solution if

cT · x⇤ cT · x for all feasible solutions x .

I linear program is unbounded if, for all k 2 R, there is a feasible solution x 2 Rn

with cT · x k .

35

General Linear Program

minimize cT · xsubject to ai

T · x � bi for i 2 M1, (2.1)

aiT · x = bi for i 2 M2, (2.2)

aiT · x bi for i 2 M3, (2.3)

xj � 0 for j 2 N1, (2.4)xj 0 for j 2 N2, (2.5)

with c 2 Rn, ai 2 Rn and bi 2 R for i 2 M1 [̇M2 [̇M3 (finite index sets), andN1,N2 ✓ {1, . . . , n} given.

I x 2 Rn satisfying constraints (2.1) – (2.5) is a feasible solution.I feasible solution x⇤ is optimal solution if

cT · x⇤ cT · x for all feasible solutions x .

I linear program is unbounded if, for all k 2 R, there is a feasible solution x 2 Rn

with cT · x k .

35

General Linear Program

minimize cT · xsubject to ai

T · x � bi for i 2 M1, (2.1)

aiT · x = bi for i 2 M2, (2.2)

aiT · x bi for i 2 M3, (2.3)

xj � 0 for j 2 N1, (2.4)xj 0 for j 2 N2, (2.5)

with c 2 Rn, ai 2 Rn and bi 2 R for i 2 M1 [̇M2 [̇M3 (finite index sets), andN1,N2 ✓ {1, . . . , n} given.

I x 2 Rn satisfying constraints (2.1) – (2.5) is a feasible solution.I feasible solution x⇤ is optimal solution if

cT · x⇤ cT · x for all feasible solutions x .

I linear program is unbounded if, for all k 2 R, there is a feasible solution x 2 Rn

with cT · x k .35