Docsity

linear programming noted, Lecture notes of Linear Programming

Toggle sidebar
bg1
Algorithmic Methods 18.10.10
Lecture Notes 1: Introduction to Linear Programming
Professor: Yossi Azar Scribe: Alexei Kovelman
1 Linear Programming
Definition: The goal of linear programming (LP) is to find a maximum
(minimum) of a given (linear) objective function, given linear con-
straints (equalities or inequalities). This is deliberately general as many
problems can be modeled as linear programming problems; let’s take
a look at some examples.
2 LP examples
The diet problem: You are the proud owner of a chicken farm and you’re
given the task of preparing chicken food: there are four brands of
chicken food:
a
,
b
,
g
,
d
, each containing a certain percentage of one of
the three food groups A,B,C:
a b g d
A 20 9 4 8
B 9 8 18 10
C 10 15 3 9
Price 60 48 40 52
Chicken must consume a certain amount of each food group daily; in our
example they must consume (100, 80, 92) daily - that is, 100 units of food
group A, 80 of food group B, etc. Each brand also has a price tag (see table
above), and given that the farm is on a tight budget, the goal is to minimize
the total price of daily feeding while providing the chicken with the necessary
food groups.
Now let’s describe the problem as an LP problem:
•Our variables are: x1,x2,x3,x4- amounts of a brand of food per day
for brands
a
,
b
,
g
,
d
.
1 - 1
pf3
pf4
pf5

Partial preview of the text

Download linear programming noted and more Lecture notes Linear Programming in PDF only on Docsity!

Algorithmic Methods 18.10.

Lecture Notes 1: Introduction to Linear Programming

Professor: Yossi Azar Scribe: Alexei Kovelman

1 Linear Programming

Definition: The goal of linear programming (LP) is to find a maximum (minimum) of a given (linear) objective function, given linear con- straints (equalities or inequalities). This is deliberately general as many problems can be modeled as linear programming problems; let’s take a look at some examples.

2 LP examples

The diet problem: You are the proud owner of a chicken farm and you’re given the task of preparing chicken food: there are four brands of chicken food: a, b, g, d, each containing a certain percentage of one of the three food groups A,B,C:

a b g d A 20 9 4 8 B 9 8 18 10 C 10 15 3 9 Price 60 48 40 52

Chicken must consume a certain amount of each food group daily; in our example they must consume (100, 80, 92) daily - that is, 100 units of food group A, 80 of food group B, etc. Each brand also has a price tag (see table above), and given that the farm is on a tight budget, the goal is to minimize the total price of daily feeding while providing the chicken with the necessary food groups. Now let’s describe the problem as an LP problem:

  • Our variables are: x 1 , x 2 , x 3 , x 4 - amounts of a brand of food per day for brands a, b, g, d.
  • Our constraints are:
    1. 20 x 1 + 9x 2 + 4x 3 + 8x 4 ≥ 100 (for food group A)
    2. 9 x 1 + 8x 2 + 18x 3 + 10x 4 ≥ 80 (B)
    3. 10 x 1 + 15x 2 + 3x 3 + 9x 4 ≥ 92 (C)
    4. x 1 , x 2 , x 3 , x 3 ≥ 0
  • Our objective function is: min(60x 1 + 48x 2 + 40x 3 + 52x 4 ).

The max-flow problem: Let G(V, E) be a (directed) graph, s, t ∈ E be the source and sink of the desired flow, let c : E → R+^ be the capacity of the edges of E; we want to find a maximum flow f from source s to sink t that satisfies the following constraints:

  • Capacity constraint: f (u, v) ≤ c(u, v) ∀u, v ∈ E.
  • Conservation of flows:

v:(u,v)∈E f^ (u, v) =^

v:(v,u)∈E f^ (v, u)^ ∀u^ ∈ V {s, t}

The max-flow problem is easy to describe as an LP problem:

  • The variables are fe ∀e ∈ E - the flow through each edge, and d - the net flow leaving the source s (and entering the sink t).
  • The constraints are:
    1. fe ≥ 0 ∀e ∈ E (flow is non-negative).
    2. fe ≤ c(e) ∀e ∈ E (capacity constraint).

e:e=(u,v)∈E fe^ −^

e:e=(v,u)∈E fe^ = 0^ ∀u^ ∈^ V^ {s, t} (flow conservation for u ∈ V {s, t}).

e:e=(s,v)∈E fe^ −^

e:e=(v,s)∈E fe^ =^ d (Note: the corresponding equality for the sink t is redundant but may be added).

  • The objective function is max(d).

The multi-commodity max-flow problem: This is a generalization of the max-flow problem:

  • We are given a (directed) graph G(V,E) with a capacity function c : E → R+.
  • Rather than have a single source and sink, we have several pairs of sources and sinks {si, ti}∀i ∈ { 1 ...k}.
  • Each flow from si to ti should be maximized, subject to the rules of flow conservation.

3 Different representations of linear programming

3.1 General form:

  • Let A ∈ Rkn^ be a matrix of equalities for k constraints and n variables: Ax = b (b ∈ Rk).
  • Let A′^ ∈ Rln^ be a matrix of inequalities for l constraints and n vari- ables: A′x ≥ b′^ (b′^ ∈ Rl).
  • Let r be an integer such that: x 1 ...xr ≥ 0 and xr+1...xn R 0 (no constraint on their value).
  • The objective function is min(cT^ x) where c ∈ Rn.

3.2 Polyhedral form:

  • As above, but only inequalities allowed: Ax ≥ b.

3.3 Canonical form:

  • As in polyhedral form, with the addition of a constraint that x ≥ 0.

3.4 Standard form:

  • A is matrix of equalities: Ax = b such that x ≥ 0.
  • The objective function is min(cT^ x).

3.5 Equivalency of all forms of LP:

We can convert equalities to inequalities in the following manner: given an equality −→a · −→x = b, convert it into:

  • −→a · −→x ≥ b
  • −→a · −→x ≤ b

Thus we see that the polyhedral form is equivalent to the general form, and both the canonical and standard forms are special cases of the polyhedral form. In order to prove all-around equivalence, we need two things:

  • Represent a polyhedral problem as a canonical problem: we’ll represent a variable which could be negative as a difference of two non-negative variables in the following fashion: - For all i xi = x+ i − x− i where x+ i , x− i ≥ 0.
  • Represent a canonical problem as a standard problem: we convert inequalities into equalities using a dummy variable - given aix ≥ bi we add a variable si such that si ≥ 0 and convert the inequality into aix − si = bi.

4 Terms in Linear Algebra

Vector space: a set closed to addition of vectors and multiplication of vec- tor and scalar that satisfies certain axioms (associativity/commutativity of addition, etc).

Linear independence: a set of vectors is independent iff none the vectors in the set can be written as a linear combination of the other vectors in the set.

Dimension: for vector space V , the dimension of V is the cardinality (size) of the largest independent set.

Affine space: given a vector space V, its subspace S and vector t ∈ V , an affine space is defined by {y + t|y ∈ S}.

Matrix rank: the dimension of the matrix’ rows (columns).

Vector orthogonality: vectors u,v are said to be orthogonal iff u · v = 0.

Nullspace: for matrix A, the nullspace (kernel) of A is the set of vectors x such that Ax = 0; the nullspace is a linear subspace.

Length: length of vector u is defined as: ||u|| =

u · u.

Bounded set: a set T is bounded iff there exists v such that ||x|| ≤ v∀x ∈ T.

Hyperplane: defined as {x|a · x = b}.

Half-space: defined as {x|a · x ≥ b}.

Polyhedron: an intersection of a finite number of half-spaces.

Polytope: a bounded, non-empty polyhedron.

Convex combination: a convex combination of vectors X is

i λixi^ such that 0 ≤ λi ≤ 1 ,

i λi^ = 1.

Strictly convex combination: as above, but: 0 < λi < 1.

Convex set: a set S is said to be convex if any convex combination of vectors in S is contained in S (it is sufficient to show for two vectors).

Intersection of convex sets is a convex set.

Polyhedron vertex: a vector in a polyhedron that cannot be written as a strictly convex combination of any other vectors in the polyhedron.

6 Basic feasible solution

Definition: we are given an LP problem in its standard form; Amxn is the matrix of equalities; assume that the rows of A are linearly inde- pendent (since we’re dealing with equalities, we remove the rows that are linearly dependent with other rows without affecting the result); also assume that m < n (otherwise the solution is exactly one point); rank(A) = m; f = {x ≥ 0 |Ax = b} is the feasible region of A. We take m linearly independent columns and suppose that the other columns are assigned the value of 0; we then solve the remaining mxm set of linear equations and recover the (unique) solution x; such x is called a basic solution of A; if x ≥ 0 then x is feasible and a vertex and will be called basic feasible solution (bfs for short). Each bfs has at least n − m zeroes; if a bfs has more that n − m zeros, it will be called a degenerate bfs.

Claim: A bfs that is the result of two different selections of columns in a standard-form LP problem is degenerate.

Proof: Let J 1 , J 2 be two different selections of non-zero columns in a standard- form LP problem; let x be the solution to both J 1 and J 2 ; the number of non-zeros in x is at most the size of the intersection of J 1 and J 2 - and that size is strictly less that n − m, making x degenerate.

Theorem C: In a standard-form LP problem x is a vertex if and only if x is a bfs.

The proof appears in the notes of the next lecture.