I would like to find a heuristic or algorithm to solve a Travelling Sales Person-like problem with some key differences:
-The graph is unweighted. (so the cost of walking from any one vertex to a connected vertex is 1)
-I want to go through each vertex at least once, rather than exactly once.
-There are dead ends in the graph which we will have to backtrack from.
The graph would look something like this:
Currently, I am going along a random route, saving my history in a stack until I reach a vertex not connected to any un-travelled vertex - then I backtrack to the most recent unexplored branch and explore that. I repeat this until there are no vertices left to explore - I can walk the graph using this method in 2n steps, where n is the number of vertices. I feel there must be a better way - I would appreciate any help or pointers to materials I should research!