Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: In search of an algorithm for loading cyclic graphs

by dynamo (Chaplain)
on May 17, 2005 at 18:32 UTC ( [id://457933]=note: print w/replies, xml ) Need Help??


in reply to In search of an algorithm for loading cyclic graphs

A couple things about your question don't parse correctly for me.

What do you mean when you say that you 'apply a local fix' - how is what you describe a 'fix' for anything? (You still end up with the cycles in the database, which I gather you want to do)
Why would you be creating the id for A 'early' when you would normally generate the ids in order?
How does this differ from not applying said fix?

  • Comment on Re: In search of an algorithm for loading cyclic graphs

Replies are listed 'Best First'.
Re^2: In search of an algorithm for loading cyclic graphs
by samtregar (Abbot) on May 17, 2005 at 18:39 UTC
    What do you mean when you say that you 'apply a local fix' - how is what you describe a 'fix' for anything? (You still end up with the cycles in the database, which I gather you want to do)

    I mean I fix the code so it doesn't die() or loop forever anymore. A typical break is either an error about not being about the find the object linked to, or worse, an infinite loop loading the same nodes over and over.

    The cycles are perfectly valid, so I'm not trying to weed them out.

    Why would you be creating the id for A 'early' when you would normally generate the ids in order?

    Here's the "normal" course of events in my system:

    • Create an object, unsaved without an ID.
    • Fill it with data. Some of the data may include the IDs of linked objects.
    • Save the object, creating an ID for it.

    That works great until the code finds a cycle. When I run into a cycle I fix it to:

    • Create an object, unsaved without an ID.
    • Fill it with data, but not the data that might cycle.
    • Save the partially filled object, creating an ID for it.
    • Fill in the possibly cyclic pieces.
    • Save the completed object.

    The problem is that doing this for each node type when I find a break is a real pain.

    -sam

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://457933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-18 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found