Designing a graph study program

Alexander Schliep schliep at molgen.mpg.de
Thu May 10 10:52:59 EDT 2007


andrea <kerny404 at gmail.com> writes:

> On 9 Mag, 09:10, Alexander Schliep <schl... at molgen.mpg.de> wrote:
>> Check outhttp://gato.sf.net(LGPL license). It does exactly what you
>> want to do and there is a binary for MacOS X. Algorithms are implemented
>> using Gato's graph class and rudimentary visualizations you get for free
>> by replacing standard data structures (e.g., a vertex queue) by
>> animated ones (AnimatedVertexQueue).
>>
> Very very nice well done!

Thanks.

> I'd like to do something similar, just to learn something new...

Gato is open source and I'd be happy to collaborate. There are quite a
few areas (e.g. SVG export, displays for data structure contents, more
complete 3D support, polygon edges, running backwards?) which need
work.

> Could you explain me how you designed it?? How is the step mechanism
> done??

The algorithm is executed by a subclass of the Python debugger (see
Gato.py).  A Tk event mechanism is used to step to the next line if
you are in running mode. Otherwise the user steps manually. The
visualizations are done with animated data structures, which animate
changes to their internal state with respect to the graph: e.g., when
you add or remove v to/from an AnimatedVertexQueue it changes v's
color.

Tk has a canvas which does object-oriented drawing. A line is not
just a bunch of pixels but rather an object which you can move,
scale, has callbacks. I dislike Tcl, but Tk is amazing, even it
it looks 1980s.

There is a paper
http://algorithmics.molgen.mpg.de/preprints/2000-CATBox-MTCM.pdf
describing the ideas.

Best,
Alexander



More information about the Python-list mailing list