Using Python for programming algorithms
Henrique Dante de Almeida
hdante at gmail.com
Mon May 19 20:42:26 EDT 2008
On May 19, 3:07 pm, Vicent Giner <vgi... at gmail.com> wrote:
>
> Yes, of course, but that should mean that I have to do it better, in
> the programming step (I would have to re-program or re-implement my
> algorithm). And I think the problem would be the same in any other
> language, wouldn't it?
The idea is that a C version of the same program could take, eg. 0,4
hours. But I think we have an authoritative answer here, see Robin
Becker's post (even though he programmed the problem, not the
algorithm). :-)
> Are there such toolkits in other languages? I am not sure they exist
> in C, for example.
I'm sure there are a lot of toolkits for linear programming (can't
tell about other solvers). glpk is the GNU implementation. It even has
its own built-in language (Mathprog). Someone posted an interesting
link of a python wrapper: "OpenOpt"
http://scipy.org/scipy/scikits/wiki/OpenOpt
It supports many solvers. It may be interesting for you, since there
are some non-linear and "global" problem solvers:
http://scipy.org/scipy/scikits/wiki/OOClasses
> By the way, is it possible (and easy) to call a C function from a
> Python program??
Yes. The easiest way I know of is using SWIG. People will recommend
you Cython too.
More information about the Python-list
mailing list