4

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:

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
Sai Nikhil
  • 1,237
  • 2
  • 15
  • 39

1 Answers1

6

I think Transitive Reduction is what you're looking for. Check this one : https://cs.stackexchange.com/questions/7096/transitive-reduction-of-dag

Implementation Link

Community
  • 1
  • 1
Danstahr
  • 4,190
  • 22
  • 38