Hello,

i am looking for algorithm how to genereate all variations with repetitions from two dimensional matrix. There are always trhree columns and row numbers is optional (row count > 1). All three fields in a row need not be filled. Lets assume there is a matrix like this:

1 2 3

A x x -

B - x x

C x x x

final variations will be:

A1C1

A1C2

A1C3

A1B2C1

A1B2C2

A1B2C3

A1B3C1

A1B3C2

A1B3C3

A2C1

A2C2

A2C3

A2B2C1

A2B2C2

A2B2C3

B3C1

B3C2

B3C3

Some idea? Thank you.