17 #ifndef OR_TOOLS_GRAPH_GRAPHS_H_ 18 #define OR_TOOLS_GRAPH_GRAPHS_H_ 26 template <
typename Graph>
31 return graph.OppositeArc(arc);
34 return graph.IsArcValid(arc);
37 return graph.node_capacity();
40 return graph.arc_capacity();
43 static void Build(
Graph* graph, std::vector<ArcIndex>* permutation) {
44 graph->Build(permutation);
71 static void Build(
Graph* graph, std::vector<ArcIndex>* permutation) {
78 #endif // OR_TOOLS_GRAPH_GRAPHS_H_ static NodeIndex NodeReservation(const Graph &graph)
static ArcIndex ArcReservation(const Graph &graph)
Since StarGraph does not have exactly the same interface as the other graphs, we define a corresponde...
static void Build(Graph *graph)
static void Build(Graph *graph)
ArcIndexType Opposite(const ArcIndexType arc) const
Returns the opposite arc, i.e the direct arc is the arc is in reverse direction, and the reverse arc ...
ListGraph Graph
Defining the simplest Graph interface as Graph for convenience.
Graph::NodeIndex NodeIndex
ArcIndexType max_num_arcs() const
Returns the maximum possible number of original arcs in the graph.
static ArcIndex ArcReservation(const Graph &graph)
static ArcIndex OppositeArc(const Graph &graph, ArcIndex arc)
static void Build(Graph *graph, std::vector< ArcIndex > *permutation)
NodeIndexType max_num_nodes() const
Returns the maximum possible number of nodes in the graph.
bool CheckArcValidity(const ArcIndexType arc) const
Utility function to check that an arc index is within the bounds AND different from kNilArc.
Graph::NodeIndex NodeIndex
static bool IsArcValid(const Graph &graph, ArcIndex arc)
static bool IsArcValid(const Graph &graph, ArcIndex arc)
static NodeIndex NodeReservation(const Graph &graph)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c...
static void Build(Graph *graph, std::vector< ArcIndex > *permutation)
operations_research::StarGraph Graph
int32 NodeIndex
Standard instantiation of ForwardEbertGraph (named 'ForwardStarGraph') of EbertGraph (named 'StarGrap...
static ArcIndex OppositeArc(const Graph &graph, ArcIndex arc)