dijkstra algorithm by object oriented

Mike Meyer mwm at mired.org
Fri Nov 5 01:35:00 EST 2004


"Ricardo Batista" <batista.ric at iol.pt> writes:

> Ok. you are right.
>
> I don't express my self in a rigth way.
>
> I just want an idea to begin my work.
>
> For example, how many classes do i implement.
>
> I have an idea to create three classes, class Graph, class Vertex, class
> edge.
> But i don't know if i'm going in the rigth way.

Yup, that's certainly one way to do it. But the best way to found out
is to try it and see.

One comment on the original code. You'd be better off doing INF =
None. That way you don't risk accidently generating an INF.

      <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.




More information about the Python-list mailing list