nextPermutation and ranges

bearophile bearophileHUGS at lycos.com
Thu Feb 7 12:42:34 PST 2013


H. S. Teoh:

> Combinatorial puzzles come to mind (Rubik's cube solvers and 
> its ilk,
> for example).  Maybe other combinatorial problems that require 
> some kind
> of exhaustive state space search. Those things easily go past 
> 20! once
> you get beyond the most trivial cases.

I know many situations/problems where you have more than 20! 
cases, but in those problems you don't iterate all permutations, 
because the program takes ages to do it. In those programs you 
don't use nextPermutation, you scan the search space in a 
different and smarter way.

I don't know of any use case for permuting so large sets of items.

Bye,
bearophile


More information about the Digitalmars-d mailing list