Solving Linear Program (P): Adding Slack Variables

In summary, when introducing slack variables in a linear program, you can either subtract them or multiply the constraint by -1 and add the slack variable to turn \geq into \leq.
  • #1
catcherintherye
48
0
i am working with the following linear program

[tex] (P) max 2x_1 - x_2 \\

subject to x_1 \leq 3 \\

- x_1 + x_2 \leq -1 \\

x_1 + x_2 \geq 2 \\

x_1, x_2 \geq 0 [/tex]

my question is this, when introducing slack variable [tex] x_3 , x_4 , x_5 [/tex]

what should i do about the greater and equal to inequality, must i subtract the slack variable?
 
Last edited:
Physics news on Phys.org
  • #2
i am working with the following linear program

(P) max [tex] 2x_1 - x_2 [/tex]

[tex] subject to x_1 \leq 3 [/tex]

[tex] - x_1 + x_2 \leq -1 [/tex]

[tex] x_1 + x_2 \geq 2 [/tex]

[tex] x_1, x_2 \geq 0 [/tex]

my question is this, when introducing slack variable [tex] x_3 , x_4 , x_5 [/tex]

what should i do about the greater and equal to inequality, must i subtract the slack variable?
 
Last edited:
  • #3
You can do that. Or you can multiply the last constraint by -1 to turn [itex]\geq[/itex] into [itex]\leq[/itex], and then add the slack variable.
 

1. What is a linear program (P)?

A linear program (P) is a mathematical optimization problem that involves finding the maximum or minimum value of a linear objective function, subject to a set of linear constraints. It is a widely used tool in operations research, economics, and other fields.

2. What are slack variables in linear programming?

Slack variables are artificial variables added to a linear program (P) in order to transform inequality constraints into equality constraints. They represent the surplus or slack in each constraint and allow the simplex algorithm to find an optimal solution.

3. How do you add slack variables to a linear program (P)?

To add slack variables to a linear program (P), you need to first identify the inequality constraints in the problem. Then, for each inequality constraint, you add a slack variable to the left-hand side of the equation and set it equal to the difference between the right-hand side and the left-hand side. This transforms the inequality constraint into an equality constraint.

4. Why do we add slack variables to a linear program (P)?

Adding slack variables to a linear program (P) allows us to convert inequality constraints into equality constraints, which can be solved more easily using the simplex algorithm. This also allows us to include all constraints in the objective function, making it easier to find an optimal solution.

5. Can slack variables change the optimal solution of a linear program (P)?

No, slack variables do not change the optimal solution of a linear program (P). They are only added to help solve the problem more efficiently. The optimal solution will remain the same regardless of whether slack variables are used or not.

Similar threads

Replies
3
Views
731
  • Linear and Abstract Algebra
Replies
9
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
480
  • Linear and Abstract Algebra
Replies
8
Views
2K
  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
11
Views
952
  • Linear and Abstract Algebra
Replies
2
Views
422
  • Precalculus Mathematics Homework Help
Replies
32
Views
839
  • General Math
Replies
2
Views
735
Replies
2
Views
1K
Back
Top