backtrex icon indicating copy to clipboard operation
backtrex copied to clipboard

`Backtrex.solve/1` should return a Stream of solutions

Open jmitchell opened this issue 9 years ago • 0 comments

Problems can have multiple solutions, but Backtrex currently returns the first one it finds. Instead it should return a lazy Stream of all of solutions (even if there's infinitely many!). It should also provide a function to get the first n solutions and the Stream of the remaining solutions.

Conceptually all this should require is upon finding a solution...

  1. enqueue it and
  2. backtrack to the next possible state

jmitchell avatar Jan 13 '17 21:01 jmitchell