Ask Your Question

# How to get step by step table in Simplex method in sagemath?

I have used the following commands to solve a linear programing problem in sagemath.

>p = MixedIntegerLinearProgram(maximization=True, solver='GLPK')
>x = p.new_variable(nonnegative=True)
> p.set_objective(12*x + 3*x+x)
> p.add_constraint(10*x + 2*x+x<= 100)
>p.add_constraint(7*x +3*x+2*x <= 77)
> p.add_constraint(2*x + 4*x+x <= 80)
> p.show()
> print 'The optimal value:', QQ(p.solve())


It solved and gave the answer. But I want to generate a step by step table to explain to the students.

Is there any possible way to get the step by step table? or should we have to modify the program to do so?

edit retag close merge delete

## Comments

Probably you would have to write a completely new method, as MILP may not even use plain old simplex method internally, depending on the solver (it might, but I'm not sure of that). It certainly would not support a step-by-step table. However, such an addition would be of very useful pedagogical value for Sage-using educators! Edit - see tmonteil's answer instead!

## 1 Answer

Sort by » oldest newest most voted

Sage has an interactive simplex method designed for pedagogical use: you can have a look at this page

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2016-08-30 08:15:37 +0200

Seen: 720 times

Last updated: Aug 31 '16