1 / 29

The Simplex Method

The Simplex Method. The Two-Phase Simplex Method. Expanding Our Reach. Until now, we have only considered LPs with “<=” constraints, nonnegative variables, and nonnegative right-hand-side values. Why?

stedman
Download Presentation

The Simplex Method

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Simplex Method The Two-Phase Simplex Method

  2. Expanding Our Reach • Until now, we have only considered LPs with “<=” constraints, nonnegative variables, and nonnegative right-hand-side values. • Why? • Remember that simplex needs a place to start – it must start from a bfs then move to another bfs to improve the objective value. • With these assumptions, we can obtain an initial bfs/dictionary by letting all slack variables be basic, all original variables be nonbasic.

  3. Expanding Our Reach • Obviously, these assumptions do not hold for every LP. What do we do when they don’t? • This is where Two-Phase Simplex comes in. It involves two phases (thus the name!): • Phase I: Works to achieve feasibility. • Phase II: Works to achieve optimality.

  4. Example: Two-Phase Step 1: make all right-hand-side Values nonnegative.

  5. Example: Two-Phase Step 2: put the LP in standard form.

  6. Example: Two-Phase What if we wrote the initial dictionary? Infeasible! Basic var?

  7. Artifical Variables • When we had a slack variable in each constraint, it was easy to find an initial bfs to initiate simplex. • When there are rows without slack variables, it isn’t so obvious how to begin simplex. • To deal with the problem, we will use artificial variables. • Essentially, we will invent a basic variable for each row without a slack (we will use the slacks when they are available).

  8. Example: Two-Phase (cont’d) Step 3: add an artificial variable to each row without a slack.

  9. Example: Two-Phase (cont’d) Step 4: write the initial dictionary, using slack and artificial variables as basic variables.

  10. A Problem • We have essentially made up extra variables to make our lives easier. Is this a valid thing to do? • Yes and no. We can not start simplex with a bfs that utilizes artificial variables. We can use artificial variables as a tool to obtain a starting bfs.

  11. Solving the Problem • How do we use them? Starting with our dictionary that uses artificial variables, we use simplex to find a bfs in which all artificial variables are equal to zero. Then they don’t affect the real solution. X X

  12. Forcing Artificials = 0 • To force all artificial variables to be zero, we minimize the sum of all artifical variables. • If the minimum is zero, then all artificial variables equal zero (this is what we want!!) • If the minimum is nonzero, then some artificial variable is positive. This implies feasibility!!!

  13. Example: Two-Phase (cont’d) Step 5: replace the objective with minimizing the sum of all artificial variables (call it “w” to keep it separate from the original objective).

  14. Example: Two-Phase (cont’d) If the objective value is zero, then both artificial variables are also zero, and we have found a feasible solution to our original LP. Otherwise, one of the artificial variables has a postive value, and there is no feasible solution to our original LP. If there IS a feasible solution, the minimum will be zero.

  15. Example: Two-Phase (cont’d) The LP given above (original constraints with artificial variables, and new objective) is called the Phase I Linear Program.

  16. Basic variables on the right-hand-side!! Example: Two-Phase (cont’d) Write the dictionary for the Phase I LP: Step 6: write the new objective in terms of nonbasic variables.

  17. Example: Two-Phase (cont’d)

  18. Example: Two-Phase (cont’d) Step 7: solve the Phase I LP. Entering Variable? (Remember: we’re minimizing!) Leaving Variable?

  19. Tie!! Either is a valid choice for leaving variable. Example: Two-Phase (cont’d) Step 7: solve the Phase I LP. Entering Variable? Leaving Variable?

  20. Word of Advice….. • If there is a tie for leaving variable, always choose an artificial variable over another variable. • If there is more than one candidate for entering variable, avoid choosing an artifical variable. • The goal is to make all artifical variables zero, which can be achieved by making them nonbasic!!!

  21. Example: Two-Phase (cont’d) New dictionary:

  22. X X X X X X X X Example: Two-Phase (cont’d) This dictionary represents a bfs in which all artificial variables are nonbasic. Since both artificial variables equal zero, we can delete them from the dictionary without destroying our current solution.

  23. Remember • Phase I is concerned only with feasibility, not optimality. • The primary aim of Phase I is to obtain a bfs with which to start simplex. Notice that we essentially solve an LP (using simplex!) to find this bfs.

  24. Basic variables on the right-hand-side!! Example: Two-Phase (cont’d) Step 8: replace the original objective, in terms of nonbasic variables. This creates the Phase II LP. Now that we have eliminated the artificial variables, we can go back to our original objective, which is to maximize z!!

  25. Example: Two-Phase (cont’d) Step 9: Optimize the Phase II LP. Since we are maximizing z, this dictionary/bfs is optimal!! If it weren’t optimal, we could continue with simplex as usual.

  26. One more possibility…. • What if the Phase I LP is degenerate? That is, what if we reach optimality (so that all artificial variables are zero), but one of the artificial variables is basic? • Proceed with the Phase II LP, eliminating all nonbasic artificial variables. As soon as any of the remaining artificial variables becomes nonbasic, delete it.

  27. Recap Step 1: make all right-hand-side values nonnegative. Step 2: put the LP in standard form. Step 3: add an artificial variable to each row without a slack. Step 4: write the initial dictionary, using slack and artificial variables as basic variables. Step 5: replace the objective with minimizing the sum of all artificial variables (call it “w” to keep it separate from the original objective).

  28. Recap Step 6: write the new objective in terms of nonbasic variables. Step 7: solve the Phase I LP. If w > 0, the original LP is infeasible. Step 8: replace the original objective, in terms of nonbasic variables. Delete all nonbasic artificial variables. This creates the Phase II LP. Step 9: Optimize the Phase II LP. As artificial variables become nonbasic, delete them.

  29. Recap • Three outcomes when solving Phase I LP: • Minimum w > 0: LP infeasible • Mimimum w = 0, all artificial variables nonbasic: • replace objective • delete artificial variables • continue with Phase II • Minimum w = 0, some artificial variable basic (and equal to zero): • replace objective • delete nonbasic artificial variables • continue with Phase II • delete each artificial variable as it becomes nonbasic.

More Related