title: Sudoku backtracking algorithm (Java)
body: <p>I've created a Sudoku solver that will solve a Sudoku as a human might- by checking possibilities + definite values in squares corresponding to the square being checked.</p>
  
  <p>(Source: <a href="http://pastebin.com/KVrXUDBF" rel="nofollow">http://pastebin.com/KVrXUDBF</a>)</p>
  
  <p>However, I would like to create a random Sudoku generator (from a blank grid), and so have decided to use a backtracking algorithm. I understand the concept of backtracking, but am confused about one thing:</p>
  
  <p>How do I know which previous node to return to (and change) once I know a certain solution is not allowed?
  Should I simply return to the previous node and cycle through all possibilities? (And then if this yields no correct answers, return to the value before, etc.). This seems like a viable method, but also quite inefficient. Is this the correct way of implementing a backtracking method or is there a better way to go about it?</p>
  
  <p>Thanks in advance.</p>
  
  <p>More can be found about backtracking here: <a href="http://en.wikipedia.org/wiki/Backtracking" rel="nofollow">http://en.wikipedia.org/wiki/Backtracking</a></p>