Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
util::GraphTraits< Graph > Struct Template Reference

#include <graph.h>

Public Types

using NodeIndex
 The index type for nodes of the graph.

Detailed Description

template<typename Graph>
struct util::GraphTraits< Graph >

Graph traits, to allow algorithms to manipulate graphs as adjacency lists. This works with any graph type, and any object that has:

  • a size() method returning the number of nodes.
  • an operator[] method taking a node index and returning a range of neighbour node indices. One common example is using std::vector<std::vector<int>> to represent adjacency lists.

Definition at line 611 of file graph.h.

Member Typedef Documentation

◆ NodeIndex

template<typename Graph>
using util::GraphTraits< Graph >::NodeIndex
Initial value:
std::decay_t<decltype(*(std::declval<NeighborRangeType>().begin()))>

The index type for nodes of the graph.

Definition at line 619 of file graph.h.


The documentation for this struct was generated from the following file: