I am trying to write a code that lists all possible assignments of say n objects in p containers.
For instance, if N={a,b} is the containers set and S={1,2} is the objects, then I want to have:
{ ( {1,2} , { } ) ; ( {1} , {2} ) ; ( {2} , {1} ) ; ( { } , {1,2} ) } where the tuple elements are respectively assignments to objects a and b from N.
This grows rapidly in fact for N containers and S objects, there are N^S possibilities which I want the program to list.
How you ever encountered any code, pseudo code, or algorithm that would list all the possibilities?
Thanks a lot.
For instance, if N={a,b} is the containers set and S={1,2} is the objects, then I want to have:
{ ( {1,2} , { } ) ; ( {1} , {2} ) ; ( {2} , {1} ) ; ( { } , {1,2} ) } where the tuple elements are respectively assignments to objects a and b from N.
This grows rapidly in fact for N containers and S objects, there are N^S possibilities which I want the program to list.
How you ever encountered any code, pseudo code, or algorithm that would list all the possibilities?
Thanks a lot.