Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.043 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'algorithm': 0.04; 'positioned': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; "wouldn't": 0.14; 'programmatic': 0.16; 'wrote:': 0.18; 'properly': 0.19; 'solution.': 0.20; 'work,': 0.20; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; '>': 0.26; 'excel': 0.26; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '(which': 0.31; 'getting': 0.31; 'sep': 0.31; 'anyone': 0.31; 'class': 0.32; 'figure': 0.32; "can't": 0.35; 'something': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'too': 0.37; 'skip:& 10': 0.38; 'easy': 0.60; 'spot': 0.65; 'results': 0.69; 'forced': 0.84; 'oscar': 0.84; 'url:reference': 0.84; 'vba': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pU7+f1hvbr68gVG+8sXFXE9fmkul+J/2lJCZYs0VelY=; b=tTQpNLtaHijlzHHrWPW4lJs9aAqzq9tvpqt5jZNa3Bz/tMJ7Ep46KW6/uXqji8W/Ki 4prWIy39jhY3sOCrLLJBoWOEfyvHzxX1VytJv/G8WCkINmlKMl5duKAGZNjFPLWg1B+z 6mA9tFLHdIoFg7p8REwvNbNXHKy7yzGZ2aQeEjCEIJm2QNQIfoOa56F3ARnwYS772VrZ c+bqlIjAyxj4yLoaE6uIf1CVF+Y81tqb1rZExmEDs7u1v9luNYs+0lzvcTNfRqJUtSas rGUMWTdMl661Bv/BZNVkwbsLxfxmx0pI7yQQkNPZC/XmOlB03vZfYWUn/vG0dVZ3w89n Tx2Q== MIME-Version: 1.0 X-Received: by 10.58.136.4 with SMTP id pw4mr22257191veb.10.1378109198720; Mon, 02 Sep 2013 01:06:38 -0700 (PDT) In-Reply-To: <1PRUt.242963$ZD2.40442@fx19.iad> References: <1PRUt.242963$ZD2.40442@fx19.iad> Date: Mon, 2 Sep 2013 09:06:38 +0100 Subject: Re: Simplex Algorithm From: Oscar Benjamin To: Tommy Vee Content-Type: multipart/alternative; boundary=047d7b5dba6840640704e5620d16 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378109206 news.xs4all.nl 15974 [2001:888:2000:d::a6]:33618 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53461 --047d7b5dba6840640704e5620d16 Content-Type: text/plain; charset=ISO-8859-1 On Sep 2, 2013 2:31 AM, "Tommy Vee" 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 Oscar --047d7b5dba6840640704e5620d16 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Sep 2, 2013 2:31 AM, "Tommy Vee" <xxxxx@xxxxxx.xxx> wrot= e:
>
> Anyone know where I can get an easy to use Python class or algorithm f= or the Simplex optimization algorithm? =A0I've tried the one in the lin= k below, but I can't figure out if a) I'm using it properly, or b) = where to get the solution. =A0BTW, I tried some test scenarios using MS Exc= el's "Solver" and just can't get this algorithm to match = Excel's results (which is spot on).
>
> h= ttp://taw9.hubpages.com/hub/Simplex-Algorithm-in-Python
>
> BTW, if I can't something to work, I'm going to be forced to u= se 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= 9;s "Solver" is very painful. =A0A Python approach would be much = cleaner.

Are you able to use scipy? It has the simplex algorithm (among many othe= rs) in its optimize module:
http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
=

Oscar

--047d7b5dba6840640704e5620d16--