title: Sudoku solver multiple solutions
body: <p>all below I have an outline for a 9x9 Sudoku Solver, but I'm not sure how to incorporate multiple solutions to a certain Sudoku with partial entries, if it hasn't been already. Can someone run me through this?</p>
  
  <p>This algorithm uses backtracking (hence, the use of stack)</p>
  
  <pre><code>Algorithm findSolutions:
    Given:
      (cell, value) findDecidableCell(puzzle) - returns reference to a cell (if any) whose value 
          can be immediately decided along that value
      void Puzzle::decide(cell, value) - note that value has been decided for cell
      bool Puzzle::solved() - return true if the puzzle has been solved
  
    Input: 
      puzzle - ADT representing the set of possible solutions to current puzzle
      strategies[] - list of deductive strategies
  
    Returns:
      list of solutions
  </code></pre>
  
  <hr>
  
  <pre><code>list&lt;Puzzle&gt; solutions
  stack&lt;Puzzle&gt; alternatives  // holds alternate outcomes of speculative simplifications
  alternatives.push(puzzle)   // our start state is our first alternative
  
  while(!alternatives.empty()) {          // more solutions possible
      puzzle = alternatives.pop()
  
      // decide all immediately decidable cells
      while((cell, value) = findDecidableCell(puzzle)) {
          puzzle.decide(cell, value)
      }
  
      // try simplification strategies until we hit a dead end or solution
      simplificationFound = true
      while(!puzzle.solved() &amp;&amp; simplificationFound) {
          // try deductive strategies
          simplificationFound = false
          for(i = 0; i &lt; strategies.length &amp;&amp; !simplificationFound; ++i) {
              simplificationFound = strategies[i].simplify(&amp;puzzle)
          } 
  
          // fall back to guessing
          if(!simplificationFound) {
              Puzzle alternative;
              if(simplificationFound = guess(&amp;puzzle, &amp;alternative)) {
                  // guess may be wrong, record alternate outcome
                  alternatives.push(alternative);
              }
          }
  
          // decide all immediately decidable cells before looking for
          // further simplifications
          if(simplificationFound) {
              while((cell, value) = findDecidableCell(puzzle)) {
                  puzzle.decide(cell, value)
              }
          }
      }
  
      // We either found a solution or a contradiction (no simplifications)
      if(puzzle.solved()) {
          solutions.push_back(puzzle);
      }
  }
  </code></pre>