Question: PLEASE HELP SOLVE & I WILL UPVOTE!!!! Ex.6 (1/2 approximation MAS) In the problem of Maximum Acyclic Subgraph, you are given a directed graph G
PLEASE HELP SOLVE & I WILL UPVOTE!!!!

Ex.6 (1/2 approximation MAS) In the problem of Maximum Acyclic Subgraph, you are given a directed graph G and you want to find a linear ordering on the vertices such that all edges are "forward". A directed edge is "forward" in the ordering if it points from left-to-right. Otherwise, if the edge points from right-to-left, we say that it is a "backward" edge. Give an algorithm that runs in O(m+n) time and detects whether or not the directed graph G has a linear ordering where every edge is a forward edge. (Hint: Very similar to exercise 4 above). Then, suppose we are in the case that the graph does not admit an ordering in which every edge is forward. Can you give an algorithm that finds an ordering in which at least half of the edges are forward? (this is a called an approximation algorithm) In other words, if the input graph has m edges, your algorithm should find an ordering in which at least m/2 edges are forward. (hint: your algorithm should be extremely simple)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
