On 11/1/05, daz <dooby / d10.karoo.co.uk> wrote:
> draq wrote:
> > My thought is following:
> >
> > class City without any references to the connections.
> >
>
> Yes; the relationship probably is one-way (Connection -> City)
> i.e. a City shouldn't need to understand a Connection.

This sounds like straight-up graph theory.  The graph representations
I've done in the past have always been deceptively simple.

Depending on the complexity of your data and the types of problems you
need to solve, you may want City to have a list of incoming and
outgoing connections.   It saves time culling the edge/connection list
if you're computing shortest path, etc.

I could, of course, be way off, and you're free to ignore me.

--
Rob