Longest path



Hello!
We have a graph that is not directional. We want an algorithm to find
out if this graph is divided to two parts or not.

.