Re: Need guidance on data structure
Re: Need guidance on data structure
- Subject: Re: Need guidance on data structure
- From: Kyle Sluder <email@hidden>
- Date: Tue, 28 Apr 2009 17:14:28 -0400
On Mon, Apr 27, 2009 at 9:47 PM, Graham Cox <email@hidden> wrote:
> A road can be connected to other roads. Currently each road keeps a list of
> the "subroads" that are connected to it, which is a parent-child
> relationship. A parent road can have any number of child roads, but a child
> road can only have a maximum of two parents - one for each end. (The parent
> could also be the same for each end, or it could have an unconnected end
> which is a nil parent for that end). Roads can connect to each other in any
> way you like, so in some cases a child road could be the parent of its own
> parent, and obviously there are many other kinds of cycles possible. The
> only thing currently not permitted is that a road can't loop back and
> connect to itself.
This seems wrong. This situation is common in games, and the way it's
dealt with is to instead use a directed acyclic graph: no more "my son
is my father" relationships, instead using special node types with
logic that understands the relationship of their children.
You can also go the TeX route and iterate the system until you reach a
fixed point or an oscillation.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden