17 #ifndef SIZE_MAX_INDEP_SET_ALG
18 #define SIZE_MAX_INDEP_SET_ALG
109 void recurse(
size_t pos,
size_t excluded);
Represents a monomial ideal with int exponents.
Encapsulates an algorithm for computing size-maximal independent sets of a hypergraph.
bool isIndependentIncludingMaybe(size_t pos)
Returns true if _state is an independent set according to every term in _edges from pos and forward.
vector< vector< size_t > > _undo
Stores information on how to restore the state of _state after having done backtracking on one possib...
void run(Ideal &ideal)
Run the algorithm on ideal.
size_t _varCount
The number of variables in the ideal passed to run.
bool _noIndependentSets
Is true if there are no independent sets for the argument to run.
size_t _minExcluded
The minimal number of excluded elements in any independent set found so far.
VarState
Is used for encoding the state of a partially-decided set of nodes/variables in the backtracking algo...
vector< VarState > _state
The current state of the backtracking algorithm.
void recurse(size_t pos, size_t excluded)
The recursive method that implements the algortihm.
vector< size_t > _edges
Sparse encoding of the parameter to run.
bool couldBeDependence(size_t pos, size_t nextPos, size_t &maybeCount)
Returns true if the term encoded in _edges between pos and nextPos makes or might make the set in _st...
mpz_class getMaxIndepSetSize()
Returns the largest size over all independent sets of the hypergraph passed to run.
size_t _endPos
The size of _edges.