Add Hamiltonian cycle.

This commit is contained in:
Oleksii Trekhleb
2018-05-17 08:08:29 +03:00
parent 569c6ae452
commit d2c6d14acd
2 changed files with 2 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ function hamiltonianCycleRecursive({
cycle: currentCycle,
});
// BACKTRACKING.
// Remove candidate vertex from cycle path in order to try another one.
currentCycle.pop();
}