Skip to content

Consider only subsets, not permutations#4

Open
recmo wants to merge 1 commit into
HorizenLabs:mainfrom
recmo:patch-1
Open

Consider only subsets, not permutations#4
recmo wants to merge 1 commit into
HorizenLabs:mainfrom
recmo:patch-1

Conversation

@recmo
Copy link
Copy Markdown

@recmo recmo commented Jul 27, 2024

Empirically (in large fields), if a solution is satisfying then so are all its permutation and no valid solution has repeated elements. So it is sufficient to iterate over all subsets of length NUM_CELLS of the small range, which is much faster for larger sizes.

Additionally, the iterator is not converted to a list (which leads to a combinatorial sized memory allocation).

Note that the range is left hardcoded and will have to be increased for larger NUM_CELLS.

Empirically, if a solution is satisfying, so are all its permutation.
So it is sufficient to iterate over all subsets of length `NUM_CELLS` of the small range, which is much faster for larger sizes.

Additionally, the iterator is not converted to a list (which leads to a combinatorial sized memory allocation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant