On Sun, 13 Apr 2008 13:18:04 -0500 "Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> > > P.S. As a matter of symmetry, a unified node could contain a list > > > of the node's parents. This is not necessary: it is analogous to > > double-linking a linked list. > > > > Unnecessary, but a big speed boost (at the cost of memory) if you > > wanted to access the list of a nodes parents. > > I don't think so. In my present thinking it will not be possible to > possible to access a *node's* parents--you can only access the > parents of a node *at a particular position*. Positions give you > parents instantly. So, how do you iterate through a set of clones? You could search the whole tree of course, any maybe iterating through clones is uncommon enough that this would be ok. Or not? > > So for DAG world, iterating children requires a position? > > For *any* world. It's amazing how simple everything is: nodes simply > have a children array: there are no other links in *nodes*. > Positions give you the context in what is an amazingly natural way. Words is so tricksy. I guess only directed graphs have children. Undirected graphs have a "list of places you can go to from here or from which you can come to here", and the position tells you from which of those places you came, from the current position's perspective. I think of positions as "paths". > > Nah, I guess it's not quite that simple, it doesn't account for > > loops back to the parent through an intermediate node. But of > > course that's not a concern if you know the interface doesn't allow > > creation of such loops. > > No, it is that simple. In a graph world iterators define paths. > Everything just works. Maybe I'm jumping the gun, but I'm trying to think about how Leo could have internally a cyclic and possible undirected or perhaps just nominally directed data structure, and yet still present it as essentially a DAG when it's running in "DAG mode". > > Bearing in mind that this is all future stuff not to be played with > > before the DAG stuff is done, a node could have two lists; a list of > > parents and a list of children, or a single list of tuples (o, d) > > where o is anOther node to which the current node connects and d is > > the direction of the connection. These two approaches are > > equivalent and the two list option might be more convenient, anyway > > they're equivalent so it doesn't matter much. > > True, but I believe the combination of nodes and iterators will > render these secondary kinds of data structures unnecessary. This is > very exciting because it makes the implementation dead simple. Again, I'm secretly rooting for undirected cyclic graphs :-) but not as a first step. Nor as a default mode. Cheers -Terry --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
