简体   繁体   中英

Algorithm to find a hierarchy tree in a directed acyclic graph?

I have a graph with properties as shown below:

Adjacency Matrix:

Graph Representation:

Which algorithm can be applied to find a hierarchy tree of the above graph? In my words, a hierarchy tree is one in which nodes are connected and directed towards their immediate child only and any edge from current to child of child or any other should be removed.

For the above graph, a hierarchy tree would look like the following:

Hierarchy Tree:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM