nextPermutation and ranges
Era Scarecrow
rtcvb32 at yahoo.com
Fri Feb 8 13:07:56 PST 2013
On Friday, 8 February 2013 at 12:27:50 UTC, John Colvin wrote:
> On Friday, 8 February 2013 at 06:59:20 UTC, Marco Leise wrote:
>>
>> So right now we can handle 20! = 2,432,902,008,176,640,000
>> permutations. If every check took only 20 clock cycles of a 4
>> Ghz CPU, it would take you ~386 years to go through the list.
>> For the average human researcher this is plenty of time.
>
> On a modern supercomputer this would take well under 2 months.
> (I calculated it as ~44 days on Minerva at Warwick, UK). 19!
> would take less than 3 days.
>
> In a parallel setting, such large numbers are assailable.
If we have such a large number of computations, then either cent
will have to be implemented, use BigInt, or an internal array
that handles locational information. That would remove the
limitations of 20 to either 255, or 65535 (assuming you EVER need
that many). Course rummaging through the array for the next
computation becomes more difficult the larger the number of
elements.
More information about the Digitalmars-d
mailing list