Add DisjointCover node#557
Conversation
arcondello
left a comment
There was a problem hiding this comment.
Couple random aesthetic comments
| public: | ||
| DisjointCoverNode(ssize_t primary_set_size, std::span<ArrayNode*> node_ptrs); | ||
|
|
||
| // Node overloads ********** |
There was a problem hiding this comment.
I know this is a pattern used by a lot of other nodes, but I want to move to just alphabetical for all methods going forward.
|
|
||
| See Also: | ||
|
|
||
| .. versionadded:: |
|
Misc unhelpful notes from trying to find precedent for similar functions in other libraries we like to follow.
Maybe we want |
|
I think if we were writing this from scratch we'd want an API like from dwave.optimization import Model, is_disjoint_cover
model = Model()
universe = 100
num_lists = 10
lists = [model.list(universe, min_size=0) for _ in range(num_lists)]
model.add_constraint(is_disjoint_cover(lists))open to suggestions |
I'm convinced adding "Is" is the way to go. At least, its consistent with "IsIn", and its probably not a good idea to go the other way and rename that to just "In" |
So, add |
Adds a logical-valued node that determines whether its predecessors are a disjoint cover of a given primary set
Reference issue
What does this implement/fix?
Implements a
DisjointCovernode, enabling construction ofDisjointListsviaListsymbolsAI Generation Disclosure
No AI tools used