Specific combinations in a 3x9 grid

In a 9x3 grid, I need to find all possible arrangements where exactly one active cell is placed in each column, and no column can contain more than one active cell at a time. The active cells can be placed in any of the rows, but there must always be one active cell per column, and no two active cells can share the same row.
The goal is to visualize all unique combinations of these arrangements in a 2D matrix format like the image attached.
thank you very much for the help.

1 Like

Please take a look at this topic:

All possible combination of 3x3 Grid - Grasshopper - McNeel Forum

It should have popped up when you created the topic…

Yes, but it does not follow the specific rule set.
Unfortunately I am not able to manipulate that script to fit this ruleset

1 Like

I might be missing some requirements but this seems like a base 3 counting system. Each row could be seen as representing 0, 1, or 2 and so you have 9 digits with 3 possibilities each.
Therefore 3 to the power of 9 = 19,683 different patterns.
That will be quite a lot to visualise!
Is there a further restriction? I didn’t understand the bit “no two active cells can share a row”?