-1

Given a directed cyclic graph, how do I get various DAGs/trees, which are representative of the input graph? In effect, I'd like to extract various trees from the given circuit (directed & cyclic) graph.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61

2 Answers2

0

It depends on your requirement. If you only want to have the highest weight DAG, I think you can try to sort all the edges, then remove edges one by one in that order if the edge breaks a cycle.

chepukha
  • 2,371
  • 3
  • 28
  • 40
0

Use Prim or Kruskal's algos.
See summary: http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Graph/Undirected/

Adrian
  • 5,603
  • 8
  • 53
  • 85