Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: A fast DAG class needed

by dwm042 (Priest)
on Nov 16, 2007 at 16:00 UTC ( [id://651248]=note: print w/replies, xml ) Need Help??


in reply to A fast DAG class needed

I suspect that what you want is called a spanning tree on a directed graph. There are some fast algorithms for finding spanning trees. The best intro discussion I can find quickly is the Wikipedia article on minimum spanning trees which will give you a place to start. I also think the book Mastering Algorithms in Perl touches these topics.

Update: Now, if my gut instinct is wrong and you actually want every possible *tree* associated with a directed graph, then you have to know that the number of trees grows so rapidly as a function of the number of nodes that you're in for a time intensive process regardless.

Update 2: Argh, totally off base here. DAGs aren't necessarily rooted, as trees are.

Log In?
Username:
Password:

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

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

    No recent polls found