2,036 views

1 Answer

3 votes
3 votes

It should be false..

Since dfs  can find the cycle in O(n+e) time.

But it will not find Hamiltonian cycle.

In the mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path in an undirected or directed graph that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian path that is a cycle. Determining whether such paths and cycles exist in graphs is the Hamiltonian path problem, which is NP-complete.

Because of it not able to find Hamiltonian cycle depth should be less than v-1.

https://en.m.wikipedia.org/wiki/Hamiltonian_path

Related questions

0 votes
0 votes
1 answer
1
Subbu. asked Jul 16, 2022
344 views
Please list the problems where BFS alone can do and DFS alone can do and both can do??