mhridoy's blog

By mhridoy, history, 8 years ago, In English

Remove the minimum number of edges from the following directed graph so that there exists a topological order. Draw the new graph and find the topological order using a DFS.

No. of Nodes: 9 No. of Edges: 14

Edge List: 1-4, 1-5, 2-5, 3-6, 4-9, 5-1, 5-7, 6-5, 7-4, 8-5, 9-3, 9-6, 9-7, 9-8

How can I Draw the graph?

  • Vote: I like it
  • +4
  • Vote: I do not like it

| Write comment?
»
8 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

You have to break all cycles. 5 -> 1 -> 5 is one and 4 -> 7 -> 9 -> 4 is another. So you have to remove at least one edge from each. But I don't think the solution is unique.