Answer the question
In order to leave comments, you need to log in
Is it possible to visit all vertices of a connected undirected graph once and return to the initial vertex?
What algorithm can be used to traverse all the vertices of the graph once, returning to the starting vertex.
The graph is connected, undirected.
Answer the question
In order to leave comments, you need to log in
Is it possible to bypass all the vertices of the graph and return to the initial one?
From the description, you want a Hamiltonian path .
This problem is NP-complete - therefore, no simple and fast algorithm is known to mankind. You can do a full search with cutoffs and heuristics. Some methods of simulating annealing or genetic algorithms can work faster, but this is not accurate and you need to poke around for a long and painful time to make it work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question