https://gist.github.com/CyberShadow/39f43cf25dac0534f8a9
The solver uses BFS with delayed duplicate detection for pruning visited states (instead of, say, hash tables).
The DDD part can be summed up in two lines of code:
prevStates = (prevStates ~ states).sort.uniq.array();
states = nextStates.sort.uniq.setDifference(prevStates).array();
// ... expand states into nextStates ...
These were part of the solver's code at one point, although now I've expanded them a bit to improve memory efficiency.I love D.