Designing a graph study program
Diez B. Roggisch
deets at nospam.web.de
Tue May 8 07:55:15 EDT 2007
> Ok thank you very much I'll try with that.
> But I have some design doubts, I'd like to keep the algorithm (for
> example bfs) as clean as possible, being independent from the drawing
> methods.
> And how could I make it step through algorithms without having a more
> complicated code? Maybe using threads?
Along the lines of what Marc said:
Use two graph-implementations that share the same interface regarding the
algorithms, but one will emit events to some observer for each operation on
the graph - edge/node adding/removal, attribute changing and so forth.
Thus the algorithm is kept clean, and all that you can visualize anyway is
available to you.
diez
More information about the Python-list
mailing list