![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
#include <constraint_solveri.h>
Public Member Functions | |
DEFINE_STRONG_INT_TYPE (ArcId, int) | |
DEFINE_STRONG_INT_TYPE (NodeId, int) | |
SubDagComputer ()=default | |
ArcId | AddArc (NodeId tail, NodeId head) |
void | BuildGraph (int num_nodes) |
const std::vector< ArcId > & | ComputeSortedSubDagArcs (NodeId node) |
After building a Directed Acyclic Graph, allows to generate sub-DAGs reachable from a node. Workflow:
Definition at line 2737 of file constraint_solveri.h.
|
default |
Adds an arc between node 'tail' and node 'head'. Nodes must be nonnegative. Returns the index of the new arc, those are used to identify arcs when calling ComputeSortedSubDagArcs().
Definition at line 2745 of file constraint_solveri.h.
void operations_research::SubDagComputer::BuildGraph | ( | int | num_nodes | ) |
Finishes the construction of the DAG. 'num_nodes' is the number of nodes in the DAG and must be greater than all node indices passed to AddArc().
Definition at line 2887 of file local_search.cc.
const std::vector< SubDagComputer::ArcId > & operations_research::SubDagComputer::ComputeSortedSubDagArcs | ( | NodeId | node | ) |
Computes the arcs of the sub-DAG reachable from node returns a view of those arcs in topological order.
Compute indegrees of nodes of the sub-DAG reachable from node.
Generate arc ordering by iteratively removing zero-indegree nodes.
Invariant: indegree_of_node_ must be all 0, or the graph has a cycle.
Definition at line 2945 of file local_search.cc.
operations_research::SubDagComputer::DEFINE_STRONG_INT_TYPE | ( | ArcId | , |
int | ) |
operations_research::SubDagComputer::DEFINE_STRONG_INT_TYPE | ( | NodeId | , |
int | ) |