Are Slack Variables Causing Infeasible Points in Simplex Method?

  • Thread starter liquidFuzz
  • Start date
  • Tags
    Method
In summary: This will give you a starting point within the feasible set.In summary, the conversation is about the simplex method and how it can lead to infeasible points if the starting point is not within the feasible set. The individual is seeking advice on how to choose a proper starting point and how to calculate the steepest descent direction in the algorithm. They also discuss different methods for choosing pivoting elements and the importance of iterating until a solution is reached.
  • #1
liquidFuzz
97
3
Simplex method - infeasible

I'm looking at some linear optimization problems. In one example I must be missing something, maybe someone can point it out. Here's the example:

[tex]
\begin{align*}
\textrm{max } f(\textbf{x}) = & 2x_1 + x_2 \\
\textrm{subject to} & x_1 + x_2 \leq 5 \\
& -x_1 + x_2 \geq 1 \\
& \textbf{x} \geq 0
\end{align*}
[/tex]

When I try to perform iterations of the simplex method I get funky results, not feasible stuff. I suspect that it is due to how I set up my slack variables, ##x_3## and ##x_4##. My starting point ##x=(0,0)## is not in the feasible set, but that shouldn't matter, right?

[tex]
\begin{align*}
\textrm{min } f(\textbf{x}) = & -2x_1 - x_2 \\
\textrm{subject to} & x_1 + x_2 + x_3 = 5 \\
& x_1 - x_2 + x_4 = - 1 \\
& \textbf{x} \geq 0
\end{align*}
[/tex]

Are my slack variables wrong..? Or is it something else causing me to end up in infeasible points in my iterations?
 
Mathematics news on Phys.org
  • #2
Have you tried a starting point that is in your set? like, x1 = 1, x2 = 2?

I am not familiar with the method you're talking about, but whenever I get crazy results or errors in MATLAB from fitting, it's usually because of the starting point I've chosen.
 
  • #3
liquidFuzz said:
My starting point ##x=(0,0)## is not in the feasible set, but that shouldn't matter, right?

Of course it matters - the trial solution blindly heads off down the line of steepest descent, how do you expect it is going to find its way into the feasible set?
 
  • #4
MrAnchovy said:
Of course it matters - the trial solution blindly heads off down the line of steepest descent, how do you expect it is going to find its way into the feasible set?
Eh could you refresh my memory. Where do you calculate the steepest descent direction in the simplex algorithm..?
 
  • #5
elegysix said:
Have you tried a starting point that is in your set? like, x1 = 1, x2 = 2?

I am not familiar with the method you're talking about, but whenever I get crazy results or errors in MATLAB from fitting, it's usually because of the starting point I've chosen.

I haven't tinkered with this in matlab. Is the optimixation tool kit good? I'll try different starting points and see what I get.
 
  • #6
Maybe it's how I chose pivoting element..?

I'll post some iterations, maybe you can comment on them.

Tableau
\begin{matrix}
& x_1 & x_2 & s_1 & s_2 & f(x) & \hat{x} \\
r1 & 1 & 1 & 1 & 0 & 0 & 5 \\
r2 & 1 & -1 & 0 & 1 & 0 & -1 \\
obj & -2 & -1 & 0 & 0 & 1 & 0 \\
\end{matrix}

If I chose column ##x_1## as pivoting column the ratio test gives pivoting element ##r_1,x_1##. The updated tableau is then:
\begin{matrix}
& x_1 & x_2 & s_1 & s_2 & f(x) & \hat{x} \\
r1 & 1 & 1 & 1 & 0 & 0 & 5 \\
r2 & 0 & -2 & -1 & 1 & 0 & -6 \\
obj & 0 & 1 & 2 & 0 & 1 & 10 \\
\end{matrix}
This would imply that there are no descent direction, so no further optimization is possible. The current solution however is ##x =(5,0)## which isn't feasible.

If I instead chose starting pivoting element ##r2,x1## I end up in the point ##x=(2,3)## after a couple of iterations with ##f(2,3) = 7##. This suggests that I don't have a clue on how to chose pivoting elements. Pointers would be appreciated...
 
  • #7
Sigh, I got now. I just needed to iterate until I had the solution...
 
  • #8
liquidFuzz said:
Eh could you refresh my memory. Where do you calculate the steepest descent direction in the simplex algorithm..?

I could have put that better, but it would have taken more words. At each vertex (the initial vertex in particular) you have a number of choices of which variable to vary. An efficient implementation generally chooses the variable that descends most steeply (or possibly the one which achieves the greatest descent when reaching the next extremum).

This is not really relevant to the point though, which is that the simplex method works by traversing (a subset of) the extrema of the feasible set. If you start outside the feasible set you are only going to end up inside it by luck.
 
  • #9
liquidFuzz said:
If I instead chose starting pivoting element ##r2,x1## I end up in the point ##x=(2,3)## after a couple of iterations with ##f(2,3) = 7##. This suggests that I don't have a clue on how to chose pivoting elements. Pointers would be appreciated...

No, it demonstrates that unless you are at an extremum the choice of reaching the solution is purely down to luck. Now you have struck lucky and found your way to x = (2,3) which is clearly an extremum, the algorithm starts to work and...

liquidFuzz said:
Sigh, I got now. I just needed to iterate until I had the solution...

Bingo!
 
  • #10
MrAnchovy said:
No, it demonstrates that unless you are at an extremum the choice of reaching the solution is purely down to luck. Now you have struck lucky and found your way to x = (2,3) which is clearly an extremum, the algorithm starts to work and...

Could you, or someone else, show me ho to start in, let's say x =(0,1)..?
 
  • #11
Set the slack variables to 0 and solve the simultaneous equations.
 

1. What is the simplex method?

The simplex method is a popular algorithm used to solve linear programming problems. It is an iterative process that systematically moves from one feasible solution to another until an optimal solution is reached.

2. How does the simplex method work?

The simplex method starts with an initial feasible solution and then examines adjacent solutions until an optimal solution is found. It does this by moving along the edges of the feasible region, improving the objective function at each step.

3. What does it mean when the simplex method is infeasible?

If the simplex method is infeasible, it means that there is no feasible solution to the linear programming problem. This could be due to constraints that are contradictory or unattainable.

4. How can you tell if the simplex method is infeasible?

The simplex method will be infeasible if, after performing the first iteration, all of the values in the bottom row of the simplex tableau are negative or zero. This indicates that there is no feasible solution.

5. Can the simplex method be used to find multiple solutions?

No, the simplex method is designed to find the optimal solution to a linear programming problem. If there are multiple optimal solutions, the simplex method will only find one of them. To find all possible solutions, other methods, such as the dual simplex method, can be used.

Similar threads

Replies
3
Views
729
  • General Math
Replies
4
Views
718
Replies
9
Views
4K
  • Introductory Physics Homework Help
Replies
4
Views
737
Replies
17
Views
3K
Replies
1
Views
1K
  • General Math
Replies
1
Views
4K
  • General Math
Replies
1
Views
5K
  • General Math
Replies
1
Views
4K
Replies
18
Views
2K
Back
Top