permutations / combinations implementation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

permutations / combinations implementation

Tudor Girba
Hi,

Is there an implementation of permutations and combinations of a collection?

Cheers,
Doru


--
www.tudorgirba.com

"Presenting is storytelling."


Reply | Threaded
Open this post in threaded view
|

Re: permutations / combinations implementation

Peter Hugosson-Miller
Hi Doru!

I did a lot of work with permutations and combinations a few years back when I was writing code to help me solve the challenges in Simon Singh's "The Code Book".

It probably isn't comprehensive (and it's all in VisualAge Smalltalk), but I expect it might provide a large chunk of what you're looking for. I could try and find it for you, if you like.

--
Cheers,
Peter.

On 15 nov 2010, at 10:55, Tudor Girba <[hidden email]> wrote:

> Hi,
>
> Is there an implementation of permutations and combinations of a collection?
>
> Cheers,
> Doru
>
>
> --
> www.tudorgirba.com
>
> "Presenting is storytelling."
>
>

Reply | Threaded
Open this post in threaded view
|

Re: permutations / combinations implementation

Ralph Boland
In reply to this post by Tudor Girba
In Squeak  SequenceableCollection>>permutationsDo:  will apply a block
to each permutation
of a collection.  I assume it is also in Pharo.

I have a package CombinatorialGeneration that implements a number of
combinatorial
generation algorithms.  I use it for generating large numbers of test
cases.  It's about
a man month of work from being ready to release.  Then, based on
feedback, I will
likely have more work to do before it is production ready.  It uses
some code that as
far as I know is not supported in Pharo including the generators code
added by Andreas
(? Sorry I forget his last name but it is a short name).

Hope that helps.

Ralph Boland

Reply | Threaded
Open this post in threaded view
|

Re: permutations / combinations implementation

Tudor Girba
Hi,

On 15 Nov 2010, at 15:59, Ralph Boland wrote:

> In Squeak  SequenceableCollection>>permutationsDo:  will apply a block
> to each permutation
> of a collection.  I assume it is also in Pharo.

Stupid me. I did not find it on first search :).

> I have a package CombinatorialGeneration that implements a number of
> combinatorial
> generation algorithms.  I use it for generating large numbers of test
> cases.  It's about
> a man month of work from being ready to release.  Then, based on
> feedback, I will
> likely have more work to do before it is production ready.  It uses
> some code that as
> far as I know is not supported in Pharo including the generators code
> added by Andreas
> (? Sorry I forget his last name but it is a short name).

Is this package available? I am mainly looking for simple mathematical combinations of a collections.

Cheers,
Doru


--
www.tudorgirba.com

"Live like you mean it."


Reply | Threaded
Open this post in threaded view
|

Re: permutations / combinations implementation

Stéphane Ducasse
In reply to this post by Tudor Girba

On Nov 15, 2010, at 3:59 PM, Ralph Boland wrote:

> In Squeak  SequenceableCollection>>permutationsDo:  will apply a block
> to each permutation
> of a collection.  I assume it is also in Pharo.
>
> I have a package CombinatorialGeneration that implements a number of
> combinatorial
> generation algorithms.  I use it for generating large numbers of test
> cases.  It's about
> a man month of work from being ready to release.  Then, based on
> feedback, I will
> likely have more work to do before it is production ready.  It uses
> some code that as
> far as I know is not supported in Pharo including the generators code
> added by Andreas
> (? Sorry I forget his last name but it is a short name).

If you find it I would like to know it :)

>
> Hope that helps.
>
> Ralph Boland
>


Reply | Threaded
Open this post in threaded view
|

Re: permutations / combinations implementation

Chris Muller-3
In reply to this post by Tudor Girba
Hi, you might also be interested in #maPermutationsDo: in the "Ma base
additions" package.

"I am a collection of other SequenceableCollections.  For each
combination of elements in my element-Collections, value aBlock with
the arguments Array of each combination of elements."

On Mon, Nov 15, 2010 at 3:55 AM, Tudor Girba <[hidden email]> wrote:

> Hi,
>
> Is there an implementation of permutations and combinations of a collection?
>
> Cheers,
> Doru
>
>
> --
> www.tudorgirba.com
>
> "Presenting is storytelling."
>
>
>