On 11/1/06, wyatt bC <[EMAIL PROTECTED]> wrote:
Looking at your code, I'm curious about (confused by) the "upper" and
"lower" neighbors. Do you need to keep track of which neighbors are
above and below?

That was to make working with the edges table easier. Otherwise one had to look both for a node in either of the columns and the join would depend on which column that was (that was not so clear.. I hope you know what I mean).

Here's a slightly modified version that doesn't use upper and lower and
only uses a single property, _neighbours. There is a flag for
add_neighbour that says whether the node being added (othernode) should
have the node being added to (self) as a neighbor. So, instead of this:

Yeah, I actually changed my version just like that right after I send the post to the list :) It of course doubles the size of the edges table for undirected graphs, but makes queries easier and allows you to store directed graphs as well. 

Maybe that's useful? Maybe not. It was fun to think about it anyway.

Same here.. I actually have no use for this in any of my projects.. just  some recreational programming :)

Arnar



--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to