932 views
0 0 votes
Can we use DFS to detect the negetive weight cycle in a directed graph?

1 Answer

0 0 votes
Yes Possible.

If there is a Back Edge (u,v) in a DFT , there is a cycle in the graph G.

Total Cost from v to u + Back Edge Cost(u,v) <0 indicates there is a negative weighted cycle in the graph G.
Position:
Show:

Related questions

0 0 votes
1 1 answer
833
833 views
Shivam Kasat asked Dec 9, 2018
833 views
there are multiple algorithm of DFS available and i cant figure out which one to follow for solving question asking for the nodes which aren’t pushed into the stack or th...
0 0 votes
0 0 answers
1.6k
1.6k views
Na462 asked Feb 18, 2018
1,551 views
Let T be a depth first search tree in an undirected graph G. Vertices u and ν are leaves of this tree T. The degrees of both u and ν in G are at least 2.In such case in t...
0 0 votes
1 1 answer
983
983 views
Lakshman Bhaiya asked Nov 13, 2018
983 views
Which of the following statements are true? In a depth-first search of an undirected graph $G,$every edge of $G$ is either a tree edge or a back edgeForward and cross edg...
5 5 votes
1 1 answer
4.7k
4.7k views
manvi_agarwal asked Sep 15, 2018
4,713 views
Also let me know the approach to find back edges, cross edges, forward edges,How to solve these questions(a) 2(b) 4(c) 6(d) None of theseQ. 3 Consider the following graph...