Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class CircuitPropagator
Note: This documentation is automatically generated.
Circuit/sub-circuit constraint.
Nodes that are not in the unique allowed sub-circuit must point to themseves.
A nodes that has no self-arc must thus be inside the sub-circuit. If there is
no self-arc at all, then this constaint forces the circuit to go through all
the nodes. Multi-arcs are NOT supported.
Important: for correctness, this constraint requires that "exactly one"
constraints have been added for all the incoming (resp. outgoing) arcs of
each node. Also, such constraint must propagate before this one.
Method |
CircuitPropagator | Arguments: int num_nodes, const std::vector<int>& tails,
const std::vector<int>& heads,
const std::vector<Literal>& literals, Options options,
Model* model The constraints take a sparse representation of a graph on [0, n). Each arc
being present when the given literal is true.
|
IncrementalPropagate | Return type: bool Arguments: const std::vector<int>& watch_indices |
Propagate | Return type: bool |
RegisterWith | Return type: void Arguments: GenericLiteralWatcher* watcher |
SetLevel | Return type: void Arguments: int level |
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\u003eCircuitPropagator\u003c/code\u003e class enforces circuit/sub-circuit constraints within a graph, ensuring nodes not in the allowed sub-circuit point to themselves, and nodes without self-arcs are within the sub-circuit.\u003c/p\u003e\n"],["\u003cp\u003eThe constraint requires "exactly one" constraints for all incoming and outgoing arcs of each node, with those constraints propagating before \u003ccode\u003eCircuitPropagator\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCircuitPropagator\u003c/code\u003e takes a sparse representation of a graph where arcs are active based on the truth of their corresponding literals.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods like \u003ccode\u003ePropagate\u003c/code\u003e, \u003ccode\u003eIncrementalPropagate\u003c/code\u003e, \u003ccode\u003eRegisterWith\u003c/code\u003e, and \u003ccode\u003eSetLevel\u003c/code\u003e for managing and interacting with the circuit constraints.\u003c/p\u003e\n"]]],["The `CircuitPropagator` class enforces circuit/sub-circuit constraints in a graph represented sparsely. Nodes outside the allowed sub-circuit must self-loop; absence of a self-loop implies node inclusion. The constraint mandates \"exactly one\" constraints on each node's incoming/outgoing arcs, and these must propagate first. Key methods include: `CircuitPropagator` (constructor taking graph parameters and options), `Propagate` and `IncrementalPropagate` (for constraint enforcement), `RegisterWith` (to interact with a watcher), and `SetLevel` (for setting a propagation level).\n"],null,["# CircuitPropagator\n\nC++ Reference: class CircuitPropagator\n======================================\n\n\nNote: This documentation is automatically generated.\nCircuit/sub-circuit constraint. \n\nNodes that are not in the unique allowed sub-circuit must point to themseves. A nodes that has no self-arc must thus be inside the sub-circuit. If there is no self-arc at all, then this constaint forces the circuit to go through all the nodes. Multi-arcs are NOT supported. \n\nImportant: for correctness, this constraint requires that \"exactly one\" constraints have been added for all the incoming (resp. outgoing) arcs of each node. Also, such constraint must propagate before this one.\n\n| Method ||\n|--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`CircuitPropagator`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/circuit.h#L57) | \u003cbr /\u003e Arguments: `int num_nodes, const std::vector\u003cint\u003e& tails, const std::vector\u003cint\u003e& heads, const std::vector\u003cLiteral\u003e& literals, Options options, Model* model` The constraints take a sparse representation of a graph on \\[0, n). Each arc being present when the given literal is true. |\n| [`IncrementalPropagate`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/circuit.h#L64) | Return type: `bool ` Arguments: `const std::vector\u003cint\u003e& watch_indices` \u003cbr /\u003e |\n| [`Propagate`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/circuit.h#L63) | Return type: `bool ` \u003cbr /\u003e |\n| [`RegisterWith`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/circuit.h#L65) | Return type: `void ` Arguments: `GenericLiteralWatcher* watcher` \u003cbr /\u003e |\n| [`SetLevel`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/circuit.h#L62) | Return type: `void ` Arguments: `int level` \u003cbr /\u003e |"]]