31
Linear Programming, 1 Max c 1 *X 1 +…+ c n *X n = z s.t. a 11 *X 1 +…+ a 1n *X n b 1 a m1 *X 1 +…+ a mn *X n b m X 1 , X n 0 Standard form

Linear Programming, 1 Max c 1 *X 1 +…+ c n *X n = z s.t. a 11 *X 1 +…+ a 1n *X n b 1 … a m1 *X 1 +…+ a mn *X n b m X 1, X n 0 Standard form

Embed Size (px)

Citation preview

Linear Programming, 1

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0Standard form

Linear Programming, 2

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0n +1 Variables

Linear Programming, 3

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0Objective function

Linear Programming, 4

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0

n Objective function coefficients (data)

Linear Programming, 5

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0m Constraints

Linear Programming, 6

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0

m*n technical coefficients (data)

Linear Programming, 7

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0m resource limits (data)

Linear Programming Example

Max 2*X1 + 3*X2 = zs.t. X1 + 2*X2 10 X1 , X2 0

Feasibility Region

Max 2*X1 + 3*X2 = zs.t. X1 + 2*X2 10 X1 , X2 0

X2

X1

10

5

X2 5 – 0,5*X1

X1,X2 0

Feasibility Region

Convex Set

X2

X1

10

5

Objective Function Isoclines - 1

Max 2*X1 + 3*X2 = zs.t. X1 + 2*X2 10 X1 , X2 0

X2

X1

10

5

X2 = z/3 – 2/3*X1

z=6X2=2–2/3*X1

Objective Function Isoclines - 2

Max 2*X1 + 3*X2 = zs.t. X1 + 2*X2 10 X1 , X2 0

X2

X1

10

5

X2 = z/3 – 2/3 * X1

z=15z=6z=0

Graphical Solution

Max 2*X1 + 3*X2 = zs.t. X1 + 2*X2 10 X1 , X2 0

X2

X1

10

5

X2 = z/3 – 2/3 * X1

z=20

Graphical Solution

X2

X1

10

5

z=20

Is at extreme point!

Other Extreme Points

X2

X1

10

5

Solving Arithmetically

Max c1 *X1 +…+ cn *Xn = zs.t. a11*X1 +…+ a1n*Xn b1

… am1*X1 +…+ amn*Xn bm

X1 , Xn 0

Convert Inequalities

Max c1 *X1 +…+cn *Xn +0*S1 +…+0*Sm = zs.t. a11*X1 +…+a1n*Xn +1*S1 +…+0*Sm = b1

… am1*X1 +…+amn*Xn +0*S1 +…+1*Sm = bm

X1 , X2 , S1 , Sm 0

Max c1 *X1 +…+cn *Xn = zs.t. a11*X1 +…+a1n*Xn b1

… am1*X1 +…+amn*Xn bm

X1 , X2 0

Arithmetic Problem, 1

• Number of unknown variables: n+m

• Number of equations (constraints): m

Can only solve m equations for m unknown variables

Arithmetic Problem, 2

From graphical illustration, we know

• Solution occurs at extreme point

1 Constraint 1 Non-Zero Variable

Max Objective s.t. X1 + 2*X2 + S = 10 X1 , X2 , S 0

X2

X1

10

5

X1 10

X2 0

S 0

10S

02X

01X

0S

52X

01X

2 ConstraintsX2

X1

10

5

5

10 Max Objective s.t. X1 + 2*X2 + S1 = 10 2*X1 + X2 + S2 = 10 X1 , X2 , S1, S2 0

02S

51S

02X

51X

Max Objective s.t. X1 + 2*X2 + S1 = 10 2*X1 + X2 + S2 = 10 X1 , X2 , S1, S2 0

X2

X1

10

5

102S

101S

02X

01X

52S

01S

52X

01X

02S

01S3

102X3

101X

10

5

2 Constraints 2 Non-Zero Variables

Arithmetic Problem, 3

Extreme points have only m non-zero variables and n-m zero variables

Thus, if we knew which n-m variables are zero, we could solve for the remaining m variables using our m equation system

New task: Which variables should remain zero?

Arithmetic Solution

1. Pick n-m variables and set to zero

2. Solve mxm equation system

3. Compute optimality indicators

4. If optimal, done; otherwise

Optimal solution is extreme point

• Number of non-zero variables = number of equations

• Non-zero (positive) variables are called basic variables

• All remaining variables are called non-basic variables

• Non-basic variables are zero.

Decomposed LP in Matrix Notation

Max CBXB + CNBXNB

s.t. B XB + ANBXNB = b

XB , XNB 0

Solution of LP in Matrix Notation

BXB = b - AXNB

BXB = b

  XB = B-1b

Solver tasks

• Determine which variables form basis

• Invert coefficient matrix to calculate

optimal variable values

If optimal solution is an extreme point, why not simply calculate

all extreme points and choose the one with highest objective

function value?

Number of Possible Extreme Points

n!

(n m)! m!

n .. Number of Variablesm .. Number of Equations

Calculating all extreme points?

(n) (m) n!/[m!*(n-m)!]Variables Equations Combinations Time

10 5 252 ~0 Seconds20 10 184.756 58 Seconds30 15 155.117.520 17 Hours40 20 137.846.528.820 2 Years50 25 126.410.606.437.752 2 Millenia