Vous êtes sur la page 1sur 12

Simplex Method

 The simplex algorithm operates on linear programs in the canonical form


maximize
subject to and
with the variables of the problem,
the coefficients of the objective function, A a p×n matrix
and nonnegative constants .

 There is a straightforward process to convert any linear program into one in standard form, so using this form of linear
programs results in no loss of generality.

Page 1 22 September 2019


► Slack Variable: Variable added to a <= constraint to convert it to an equation (=).
A slack variable represents unused resources
A slack variable contributes nothing to the objective function value.
► Surplus Variable: Variable subtracted from a >= constraint to convert it to an equation (=).
A surplus variable represents an excess above a constraint requirement level.
Surplus variables contribute nothing to the calculated value of the objective function.

Page 2 22 September 2019


Example:-

Solution:-

Page 3 22 September 2019


Contd:-

Page 4 22 September 2019


Contd:-

Page 5 22 September 2019


The code is written on the above algorithm as discussed in example section but the way input is given is different.
Input for the code is given in the following Format:-

Page 6 22 September 2019


► Solution:-

Page 7 22 September 2019


Optimum Solution:-

The Execution Time is :-

Page 8 22 September 2019


► Simplex consists of both Minimization and Maximization problem,
In Minimization problem the initial table that will be created using objective function and inequality equation
will be transposed to form a Maximization problem.
Example:-

Page 9 22 September 2019


► Solution:- Conversion of Minimization Problem to Maximization Problem using Transpose.

The second matrix is the transposed matrix and is converted to maximization problem now.

Page 10 22 September 2019


► The problem is converted to maximization problem.

► Now we need to solve the above as a maximization problem.

Page 11 22 September 2019


LIMITATIONS

► The code runs perfectly for the Maximization Problem but for the Minimization problem it fails as it will not
transpose the initial table of the minimization problem.

► We have to convert the minimization problem to maximization manually and then give the input to the system
(i.e. to code).

► The above limitations are considered for the future goal and betterment of the code.

Page 12 22 September 2019

Vous aimerez peut-être aussi