![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <inclusion.h>
Public Member Functions | |
SubsetsDetector (const Storage &storage, TimeLimit *time_limit) | |
void | SetWorkLimit (uint64_t work_limit) |
void | StopProcessingCurrentSubset () |
void | StopProcessingCurrentSuperset () |
void | Stop () |
uint64_t | work_done () const |
bool | Stopped () const |
process () can call StopProcessingCurrentSuperset() to abort early - process() can call StopProcessingCurrentSubset() to never consider void IndexAllStorageAsSubsets() | |
void | FindSubsets (absl::Span< const int > superset, int *next_index_to_try, const std::function< void(int subset)> &process) |
Similar API and purpose to InclusionDetector. But this one is a bit simpler and faster if it fit your usage. This assume an initial given set of potential subsets, that will be queried against supersets one by one.
Definition at line 171 of file inclusion.h.
|
inline |
Definition at line 173 of file inclusion.h.
|
inline |
We check each time our work_done_ has increased by more than this.
Compute the signature and also resize vector if needed. We want a signature that is order invariant and is compatible with inclusion.
Find any subset included in current superset.
Bitset should be cleared.
Do a bunch of quick checks. The second one is optimized for size 2 which happens a lot in our usage of merging clique with implications.
Long check with bitset.
Cleanup.
Definition at line 480 of file inclusion.h.
operations_research::sat::SubsetsDetector< Storage >::process | ( | ) |
Different API than InclusionDetector. 1/ Add all potential subset to the storage_. 2/ Call IndexAllStorageAsSubsets() 3/ Call one or more time FindSubsets(). that subset again. 4/ Call Stop() to reclaim some memory.
Optimization: next_index_to_try is an index in superset that can be used to skip some position for which we already called FindSubsets().
|
inline |
Definition at line 176 of file inclusion.h.
|
inline |
Definition at line 179 of file inclusion.h.
|
inline |
Definition at line 186 of file inclusion.h.
|
inline |
Definition at line 177 of file inclusion.h.
|
inline |
Definition at line 178 of file inclusion.h.
|
inline |
Definition at line 185 of file inclusion.h.