cs 312: algorithm analysis

31
CS 312: Algorithm Analysis Lecture #30: Linear Programming: Intro. to the Simplex Algorithm This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License . by: Eric Ringger, with contributions from Mike Jones and Eric Mercer

Upload: ama

Post on 24-Feb-2016

34 views

Category:

Documents


0 download

DESCRIPTION

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License . CS 312: Algorithm Analysis. Lecture #30: Linear Programming: Intro. to the Simplex Algorithm. Slides by: Eric Ringger, with contributions from Mike Jones and Eric Mercer. Announcements. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS 312:  Algorithm Analysis

CS 312: Algorithm Analysis

Lecture #30: Linear Programming: Intro. to the Simplex Algorithm

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

Slides by: Eric Ringger, with contributions from Mike Jones and Eric Mercer

Page 2: CS 312:  Algorithm Analysis

Announcements Homework #21 (Project 6, Part 1)

Due online today by 5pm No late submissions accepted (just like any homework asst.) Key available online after 5pm

Important: LP Notes available on the schedule Works through the ideas up through the Simplex algorithm Includes the pseudo-code for Simplex (and Pivot)

Project #6: Linear Programming (Part 2) Early day: Friday Due: next Monday Verification suggestion: use another LP solver

Page 3: CS 312:  Algorithm Analysis

Objectives

Review various forms for representing an LP problem

Understand the Simplex method algebraically

Introduce the concept of a Pivot Walk through an example to completion

Page 4: CS 312:  Algorithm Analysis

Forms of an LP Problem1. English form2. Algebraic form3. Standard form up to step #1

also algebraic

Page 5: CS 312:  Algorithm Analysis

Example: Standard Form (up to step #1)

Page 6: CS 312:  Algorithm Analysis

Forms of an LP Problem1. English form2. Algebraic form3. Standard form up to step #1

also algebraic4. Geometric / graphical form

Only if 2-D, maybe 3-D5. Matrix-vector form

Read off directly from standard form up to step #1

Page 7: CS 312:  Algorithm Analysis

Example: Matrix-Vector Form

Page 8: CS 312:  Algorithm Analysis

Forms of an LP Problem1. English form2. Algebraic form3. Standard form up to step #1

also algebraic4. Geometric / graphical form

Only if 2-D, maybe 3-D5. Matrix-vector form

Read off directly from standard form up to step #16. Padded matrix-vector form

Adapted directly from matrix-vector form Reflects the participation of slack variables

Page 9: CS 312:  Algorithm Analysis

Example: Padded Matrix-Vector form

Purposes:• for input to the Simplex algorithm• for computation in the Simplex algorithm

Page 10: CS 312:  Algorithm Analysis

Forms of an LP Problem1. English form2. Algebraic form3. Standard form up to step #1

also algebraic4. Geometric / graphical form

Only if 2-D, maybe 3-D5. Matrix-vector form

Read off directly from standard form up to step #16. Padded matrix-vector form

Adapted directly from matrix-vector form Reflects the participation of slack variables

7. Standard form up to step #2 (aka “slack form”) Also algebraic

Page 11: CS 312:  Algorithm Analysis

Standard Form (step #2)

Page 12: CS 312:  Algorithm Analysis

Sketch of Simplex Algorithm

Start with Basic solution (the origin of the feasible region)

1. Pick a non-basic variable2. Raise its value as high as we can3. Pick a basic variable4. Algebraically pivot5. Repeat at #1 until we cannot raise the value of

any non-basic variables

Page 13: CS 312:  Algorithm Analysis

Basic Solution

Page 14: CS 312:  Algorithm Analysis

Basic Solution

Page 15: CS 312:  Algorithm Analysis

Identify a Non-Basic Variable

Page 16: CS 312:  Algorithm Analysis

Identify a Non-Basic Variable

Page 17: CS 312:  Algorithm Analysis

Select a Basic Variable

Page 18: CS 312:  Algorithm Analysis

Select a Basic Variable

Page 19: CS 312:  Algorithm Analysis

Solve for the Non-Basic Variable: “Pivot”

Page 20: CS 312:  Algorithm Analysis

Solve for the Non-Basic Variable: “Pivot”

Page 21: CS 312:  Algorithm Analysis

Pivot: Rewrite the Other Equations

Page 22: CS 312:  Algorithm Analysis

Pivot: Rewrite the Other Equations

Page 23: CS 312:  Algorithm Analysis

After the Pivot: Objective Values

Page 24: CS 312:  Algorithm Analysis

After the Pivot: Objective Values

Page 25: CS 312:  Algorithm Analysis

Repeat

Page 26: CS 312:  Algorithm Analysis

Repeat

Page 27: CS 312:  Algorithm Analysis

Repeat Again (Third time)

Page 28: CS 312:  Algorithm Analysis

Repeat Again (Third time)

Page 29: CS 312:  Algorithm Analysis

What next?

Page 30: CS 312:  Algorithm Analysis

Observations At the beginning of every round of Simplex,

The value of each non-basic variable in the current solution is 0.

The space for the transformed problem is spanned by unit vectors in the directions of the non-basic variables

The current solution is at the origin of that space The new feasible region is defined in that space

Pivot is designed to keep our attention focused on the origin of each successive space

Page 31: CS 312:  Algorithm Analysis

Assignments

Project #6 Now re-read the Simplex and Pivot pseudo-

code to see how these algebraic steps are performed in the code

HW #22