Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::CanonicalBooleanLinearProblem Class Reference

#include <pb_constraint.h>

Public Member Functions

 CanonicalBooleanLinearProblem ()=default
 
 CanonicalBooleanLinearProblem (const CanonicalBooleanLinearProblem &)=delete
 This type is neither copyable nor movable.
 
CanonicalBooleanLinearProblemoperator= (const CanonicalBooleanLinearProblem &)=delete
 
bool AddLinearConstraint (bool use_lower_bound, Coefficient lower_bound, bool use_upper_bound, Coefficient upper_bound, std::vector< LiteralWithCoeff > *cst)
 
int NumConstraints () const
 Getters. All the constraints are guaranteed to be in canonical form.
 
Coefficient Rhs (int i) const
 
const std::vector< LiteralWithCoeff > & Constraint (int i) const
 

Detailed Description

Holds a set of boolean linear constraints in canonical form:

  • The constraint is a linear sum of LiteralWithCoeff <= rhs.
  • The linear sum satisfies the properties described in ComputeBooleanLinearExpressionCanonicalForm().

    Todo
    (user): Simplify further the constraints.
    Todo
    (user): Remove the duplication between this and what the sat solver is doing in AddLinearConstraint() which is basically the same.
    Todo
    (user): Remove duplicate constraints? some problems have them, and this is not ideal for the symmetry computation since it leads to a lot of symmetries of the associated graph that are not useful.

Definition at line 150 of file pb_constraint.h.

Constructor & Destructor Documentation

◆ CanonicalBooleanLinearProblem() [1/2]

operations_research::sat::CanonicalBooleanLinearProblem::CanonicalBooleanLinearProblem ( )
default

◆ CanonicalBooleanLinearProblem() [2/2]

operations_research::sat::CanonicalBooleanLinearProblem::CanonicalBooleanLinearProblem ( const CanonicalBooleanLinearProblem & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ AddLinearConstraint()

bool operations_research::sat::CanonicalBooleanLinearProblem::AddLinearConstraint ( bool use_lower_bound,
Coefficient lower_bound,
bool use_upper_bound,
Coefficient upper_bound,
std::vector< LiteralWithCoeff > * cst )

Adds a new constraint to the problem. The bounds are inclusive. Returns false in case of a possible overflow or if the constraint is never satisfiable.

Todo
(user): Use a return status to distinguish errors if needed.

Canonicalize the linear expression of the constraint.

We transform the constraint into an upper-bounded one.

Definition at line 215 of file pb_constraint.cc.

◆ Constraint()

const std::vector< LiteralWithCoeff > & operations_research::sat::CanonicalBooleanLinearProblem::Constraint ( int i) const
inline

Definition at line 171 of file pb_constraint.h.

◆ NumConstraints()

int operations_research::sat::CanonicalBooleanLinearProblem::NumConstraints ( ) const
inline

Getters. All the constraints are guaranteed to be in canonical form.

Definition at line 169 of file pb_constraint.h.

◆ operator=()

CanonicalBooleanLinearProblem & operations_research::sat::CanonicalBooleanLinearProblem::operator= ( const CanonicalBooleanLinearProblem & )
delete

◆ Rhs()

Coefficient operations_research::sat::CanonicalBooleanLinearProblem::Rhs ( int i) const
inline

Definition at line 170 of file pb_constraint.h.


The documentation for this class was generated from the following files: