Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Sort Algorithm (recursive?)

by dragonchild (Archbishop)
on Oct 14, 2005 at 15:36 UTC ( [id://500264]=note: print w/replies, xml ) Need Help??


in reply to Sort Algorithm (recursive?)

Convert your HoH into an AoH. To do that, you need to create a second entry in your HoH that contains successors. So, your datastructure needs to look like:
$hash={ 'MEX1J' => { 'desc' => 'Job 2' 'pred' => [TEX1J], 'succ' => [MEX2J], }, 'MEX2J' => { 'desc' => 'Job end' 'pred' => [TEX1J,MEX1J], 'succ' => [], }, 'TEX1J' => { 'desc' => 'Job start' 'pred' => [], 'succ' => [MEX2J], } }
That way, you can start to build your job execution tree.

Of course, I would build this using some sort of directed graph instead of a HoH. That way, predecessors and successors would be handled for you.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-28 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found