Return all the solutions
Revert "remove min-id optimization & some unused vars"

This reverts commit 6d5f4448241241a4039d51263ddb41ffd5ffbcf0.
refactor ids->machines mapping
Playing with combinatorics. Explodes with more than 12 machines
make it easy to get 1 or all solutions