On Sun, 13 Apr 2008 05:20:54 -0700 (PDT) "Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> - Unified nodes are *precisely* the nodes contemplated in the graph > world. /me grins > Recall that a key part in my rejection of the graph world > was a realization that iterators in any graph world are much more > complex than Leo's iterators. True, but now you're on the slippery slope :-) It seems to me that hard part with the new node system will be not implementing "general graph world" accidentally. I.e. it's up to the interface to stop the user linking a node in a way that creates a cycle, and the interface has to do that to avoid the more complicated iterators (for now, at least :-) > 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. Seems to me that the concept of "parent" only exists as a side effect of the position. What if a node simply had a list L of all nodes to which it connects, and functions that return a list of children or iterate children simply omit any members of L that point to p.parent? So for DAG world, iterating children requires a position? 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. I think this is a great path your heading down - get all the current DAG machinery working on top of the new structure, which sounds doable, then there'll be some solid ground from which to explore the possibilities for cyclic graphs. 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. Then iterators could have three flags, 'unique' as you discussed, 'directed' meaning pay attention to direction (don't follow links to "parents"), and 'cyclic' meaning don't shield me from cycles in the data (the default being to shield the caller from cycles by maintaining a list of visited nodes). Not sure how unique and cyclic interact, unique makes sense is a DAG+clones context, where cyclic doesn't apply. Again, none of that matters until the DAG stuff is done. Anyway, exciting news. 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 -~----------~----~----~----~------~----~------~--~---
