Jens,

But maybe there are cases where only solution or worse none exist. To validate these cases the algorithm must contain loops that eliminate all possibilities.

Unless one has a proof that eliminates a permutation as always being a repeat you must code for all permutations. Stopping after finding your first solution requires an IF statement. Maybe someone could make a smaller algorithm that finds all solutions but doesn't contain the if statement.
_________________________
Jack