Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinvestigate frozenset suitability for sequence independent membership checks #5

Open
ktnr opened this issue Jan 12, 2022 · 0 comments

Comments

@ktnr
Copy link
Owner

ktnr commented Jan 12, 2022

Frozen sets are sequence dependent when instantiated from lists but not when instantiated from tuples or sets?

For example, in

if frozenset(itemIndices) in model._InfeasibleSets or frozenset(itemIndices) in model._IncompatibleItems:

membership is compared after adding items to the collection of frozensets from lists

BinPacking2D/BinPacking.py

Lines 673 to 676 in 3d2852a

if frozenset(itemIndices) in model._FeasibleSets:
continue
if frozenset(itemIndices) in model._InfeasibleSets:# or frozenset(itemIndices) in model._IncompatibleItems:

So there might be many entries with the same items but in different sequence. As a result, subproblems will have to be solved multiple times even though they have already been proven feasible or infeasible before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant