Re: Generating the ith permutation of N elements

Yannick Letourneau <[email protected]> Tue, 1 Jun 2010 15:34:06 -0400
Newsgroups gmane.games.devel.algorithms
Message-ID <9E4A58AAF133E74A9114B0FA0F2FCC6B825B1A69@MDC-MAIL-CMS01.ubisoft.org>
Yes any consistent order will do.

Yannick

From: Danny Kodicek [mailto:[email protected]]
Sent: 1 juin 2010 14:48
To: Game Development Algorithms
Subject: Re: [Algorithms] Generating the ith permutation of N elements


I'm looking for a way to generate the ith permutation of N elements, at approximately O(N) cost.

All algorithms I've seen need the (i-1)th permutation in order to derive the ith permutation from it (e.g. they work incrementally).#
As far as I know there isn't a standard order for permutations and so there isn't such a thing as 'the' i'th permutation. Am I wrong? Or are you just looking for a consistent order rather than a standard one?

Danny

------------------------------------------------------------------------------

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list