95 views

An undirected graph canbe converted into a directed graph by choosing a direction for every edge. Here is an example:

Show that for every undirected graph, there is a way of choosing directions for its edges so that the resulting directed graph has no directed cycles.

asked in Others | 95 views

select any random vertex and start BFS algorithm such that if you are at vertex u and going to vertex v direction of the edge will be from u to v, u$\rightarrow$v, maintain a data structure visited[i] which keeps track of unvisited edge if the edge ek is visited we don't perform BFS this will create a directed graph with no back edge. complexity O(V+E)