|
-
December 17th, 2014, 10:10 AM
#1
Build DAG from Objects
I have this problem
There are a collection of objects, each object has it properties and a list of objects that depens of. So I want to generate a Directly Acyclic Graph, that can model the dependency of every object. Also mutual conection doesn't exists, so object A depends object B, so object B can't depends object A, thats a rule that must follow every object, if happens then object A and object B automatically get merge in object C, so A+B=C. There is an algorithm for this situation?
-
December 18th, 2014, 01:47 PM
#2
Re: Build DAG from Objects
 Originally Posted by firomero
Also mutual conection doesn't exists, so object A depends object B, so object B can't depends object A, thats a rule that must follow every object, if happens then object A and object B automatically get merge in object C, so A+B=C.
It seems you want to identify all cyclic (strongly connected) objects in a directed grapth. Have a look here,
http://en.wikipedia.org/wiki/Strongl...cted_component
Especially Tarjan's algorithm looks interesting.
If you run Tarjan repeatedly and each time merge all strongly connected objects until Tarjan comes up empty, what remains must be a DAG.
Last edited by razzle; December 18th, 2014 at 05:49 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|