Re: Build DAG from Objects
Quote:
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.