Simplex Algorithm

Robert Kern robert.kern at gmail.com
Mon Sep 2 05:45:07 EDT 2013


On 2013-09-02 09:06, Oscar Benjamin wrote:
>
> On Sep 2, 2013 2:31 AM, "Tommy Vee" <xxxxx at xxxxxx.xxx> wrote:
>  >
>  > Anyone know where I can get an easy to use Python class or algorithm for the
> Simplex optimization algorithm?  I've tried the one in the link below, but I
> can't figure out if a) I'm using it properly, or b) where to get the solution.
>   BTW, I tried some test scenarios using MS Excel's "Solver" and just can't get
> this algorithm to match Excel's results (which is spot on).
>  >
>  > http://taw9.hubpages.com/hub/Simplex-Algorithm-in-Python
>  >
>  > BTW, if I can't something to work, I'm going to be forced to use the VBA
> programmatic Excel interface. That wouldn't be too bad, but the data comes from
> a DB and getting it properly positioned to use Excel's "Solver" is very painful.
>   A Python approach would be much cleaner.
>
> Are you able to use scipy? It has the simplex algorithm (among many others) in
> its optimize module:
> http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html

Careful. Confusingly, there are two optimization algorithms known as "the 
simplex algorithm". The one the OP wants is for solving a linear programming 
problem (minimize a linear combination of variables subject to linear inequality 
constraints). The simplex algorithm that scipy implements is more properly 
termed "the Nelder-Mead simplex algorithm" for unconstrained local nonlinear 
minimization problems without derivative information.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list