Created
May 9, 2014 08:36
-
-
Save maxfunke/cca46cfc13e0bbb829b4 to your computer and use it in GitHub Desktop.
basic algorithm for back tracking (pseudo-code)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean solve(configuration conf) { | |
if (no more choices) | |
return (conf is goal state); | |
for (all available choices) { | |
try one choice c; | |
ok = solve(conf with choice c made); | |
if (ok) | |
return true; | |
else | |
unmake choice c; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment