Using Python for programming algorithms

Henrique Dante de Almeida hdante at gmail.com
Sat May 17 23:25:18 EDT 2008


On May 17, 7:32 pm, Vicent Giner <vgi... at gmail.com> wrote:
> Hello.
>
> I am new to Python. It seems a very interesting language to me. Its
> simplicity is very attractive.
>
> However, it is usually said that Python is not a compiled but
> interpreted programming language —I mean, it is not like C, in that
> sense.
>
> I am working on my PhD Thesis, which is about Operations Research,
> heuristic algorithms, etc., and I am considering the possibility of
> programming all my algorithms in Python.
>
> The usual alternative is C, but I like Python more.
>
> The main drawbacks I see to using Python are these:
>
> * As far as I understand, the fact that Python is not a compiled
> language makes it slower than C, when performing huge amounts of
> computations within an algorithm or program.
>
> * I don't know how likely it is to find libraries in Python related to
> my research field.
>
> * I know Python is a "serious" and mature programming language, of
> course. But I do not know if it is seen as "just funny" in a research
> context. Is Python considered as a good programming language for
> implementing Operations Research algorithms, such as heuristics and
> other soft-computing algorithms?
>
> Maybe this is not the right forum, but maybe you can give me some
> hints or tips...
>
> Thank you in advance.

 I guess that python is not a good language for that. Algorithms
implemented in plain python are many times slower than C ones
(hundreds ?). In practice, algorithms are written in C and wrapped in
python. I have near zero experience in operations research, but once I
looked for linear programming toolkits for python and IIRC, I only
could find a trivial wrapper for glpk (called pulp).

 My opinion: choose compiled or byte compiled languages. Choose the
language paradigm that best suit the algorithms.



More information about the Python-list mailing list