Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class CanonicalBooleanLinearProblem
Note: This documentation is automatically generated.
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.
Method |
AddLinearConstraint | Return type: bool Arguments: 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.
|
CanonicalBooleanLinearProblem | |
Constraint | Return type: const std::vector<LiteralWithCoeff>& Arguments: int i |
NumConstraints | Return type: int Getters. All the constraints are guaranteed to be in canonical form.
|
Rhs | Return type: const Coefficient Arguments: int i |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCanonicalBooleanLinearProblem\u003c/code\u003e class in C++ stores a set of boolean linear constraints, each expressed as a sum of literals with coefficients, less than or equal to a right-hand side value.\u003c/p\u003e\n"],["\u003cp\u003eThese linear constraints are in a canonical form, ensuring specific properties are satisfied as defined by \u003ccode\u003eComputeBooleanLinearExpressionCanonicalForm()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods to add constraints, access individual constraints and their components (literals, coefficients, and right-hand side), and determine the total number of constraints.\u003c/p\u003e\n"],["\u003cp\u003eThere are ongoing development plans to simplify the constraints further, eliminate redundancy with the SAT solver's constraint handling, and address potential issues with duplicate constraints impacting symmetry computations.\u003c/p\u003e\n"]]],["The `CanonicalBooleanLinearProblem` class manages boolean linear constraints in canonical form, where each constraint is a linear sum of `LiteralWithCoeff` less than or equal to a right-hand side (rhs). Key actions include: adding new constraints with specified bounds via `AddLinearConstraint`, and retrieving the number of constraints with `NumConstraints`, a specific constraint using `Constraint`, and a specific rhs value with `Rhs`. The class includes TODOs for simplifying constraints, removing duplication with the sat solver, and addressing duplicate constraints.\n"],null,["# CanonicalBooleanLinearProblem\n\nC++ Reference: class CanonicalBooleanLinearProblem\n==================================================\n\n\nNote: This documentation is automatically generated.\nHolds a set of boolean linear constraints in canonical form: \n- The constraint is a linear sum of LiteralWithCoeff \\\u003c= rhs. \n- The linear sum satisfies the properties described in ComputeBooleanLinearExpressionCanonicalForm(). \n\n\u003cbr /\u003e\n\nTODO(user): Simplify further the constraints. \n\nTODO(user): Remove the duplication between this and what the sat solver is doing in AddLinearConstraint() which is basically the same. \n\nTODO(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.\n\n| Method ||\n|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`AddLinearConstraint`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/pb_constraint.h#L159) | Return type: `bool ` Arguments: `bool use_lower_bound, Coefficient lower_bound, bool use_upper_bound, Coefficient upper_bound, std::vector\u003cLiteralWithCoeff\u003e* 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. |\n| [`CanonicalBooleanLinearProblem`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/pb_constraint.h#L152) | \u003cbr /\u003e |\n| [`Constraint`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/pb_constraint.h#L166) | Return type: `const std::vector\u003cLiteralWithCoeff\u003e& ` Arguments: `int i` \u003cbr /\u003e |\n| [`NumConstraints`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/pb_constraint.h#L164) | Return type: `int ` Getters. All the constraints are guaranteed to be in canonical form. |\n| [`Rhs`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/pb_constraint.h#L165) | Return type: `const Coefficient ` Arguments: `int i` \u003cbr /\u003e |"]]