Google OR-Tools v9.11
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) |
Classes to which this template function can be applied to as of 04/2014. Usage: LocalSearchOperator* op = MakeLocalSearchOperator<Relocate>(...); class TwoOpt; class Relocate; class Exchange; class Cross; class MakeActiveOperator; class MakeInactiveOperator; class MakeChainInactiveOperator; class SwapActiveOperator; class ExtendedSwapActiveOperator; class MakeActiveAndRelocate; class RelocateAndMakeActiveOperator; class RelocateAndMakeInactiveOperator; After building a Directed Acyclic Graph, allows to generate sub-DAGs reachable from a node. Workflow:
Definition at line 1746 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 1754 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 3767 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 3825 of file local_search.cc.
operations_research::SubDagComputer::DEFINE_STRONG_INT_TYPE | ( | ArcId | , |
int | ) |
operations_research::SubDagComputer::DEFINE_STRONG_INT_TYPE | ( | NodeId | , |
int | ) |