Given a graph consists of two-colored nodes(e.g. white and black) and a starting node, and every time you visit a node, its color is switched(from black to white, or, white to black), how to find the minimum path such that all nodes are converted to black (or white, since it is equivalent)?
closed as unclear what you're asking by Juho, Evil, Discrete lizard♦, Thomas Klimpel, Luke Mathieson Feb 3 at 0:30
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
This problem is $NP$-complete, there is a quite simple reduction from Hamiltonian Path. Therefore, there's (likely) no way to solve this problem efficiently in general, so the solution method will need to be tailored to the inputs you are interested in solving (brute force for small instances, heuristic methods for large instances, specialized methods for instances with special structure,...).