occ
Loading...
Searching...
No Matches
occ::core::graph::Graph< VertexType, EdgeType > Class Template Reference

#include <graph.h>

Public Types

using VertexDescriptor = std::size_t
 
using EdgeDescriptor = std::size_t
 
using Edges = ankerl::unordered_dense::map< EdgeDescriptor, EdgeType >
 
using Vertices = ankerl::unordered_dense::map< VertexDescriptor, VertexType >
 
using NeighborList = ankerl::unordered_dense::map< VertexDescriptor, EdgeDescriptor >
 
using AdjacencyList = ankerl::unordered_dense::map< VertexDescriptor, NeighborList >
 

Public Member Functions

 Graph ()=default
 
size_t size () const
 
VertexDescriptor add_vertex (const VertexType &vertex)
 
VertexDescriptor add_vertex (VertexType &&vertex)
 
EdgeDescriptor add_edge (VertexDescriptor source, VertexDescriptor target, const EdgeType &edge, bool bidirectional=false)
 
EdgeDescriptor add_edge (VertexDescriptor source, VertexDescriptor target, EdgeType &&edge, bool bidirectional=false)
 
const EdgeType & edge (EdgeDescriptor e) const
 
const VertexType & vertex (VertexDescriptor v) const
 
const auto & vertices () const
 
const auto & edges () const
 
const auto & adjacency_list () const
 
const auto neighbors (VertexDescriptor v) const
 
auto vertex (VertexDescriptor v)
 
auto edge (EdgeDescriptor e)
 
auto neighbors (VertexDescriptor v)
 
bool is_connected (VertexDescriptor i, VertexDescriptor j) const
 
template<typename T >
void depth_first_traversal (VertexDescriptor source, T &func) const
 
template<typename T >
void breadth_first_traversal (VertexDescriptor source, T &func) const
 
template<typename T >
void breadth_first_traversal_with_edge (VertexDescriptor source, T &func) const
 
template<typename T >
void connected_component_traversal (T &func)
 
auto connected_components () const
 
size_t num_edges () const
 
size_t num_vertices () const
 

Member Typedef Documentation

◆ AdjacencyList

template<typename VertexType , typename EdgeType >
using occ::core::graph::Graph< VertexType, EdgeType >::AdjacencyList = ankerl::unordered_dense::map<VertexDescriptor, NeighborList>

◆ EdgeDescriptor

template<typename VertexType , typename EdgeType >
using occ::core::graph::Graph< VertexType, EdgeType >::EdgeDescriptor = std::size_t

◆ Edges

template<typename VertexType , typename EdgeType >
using occ::core::graph::Graph< VertexType, EdgeType >::Edges = ankerl::unordered_dense::map<EdgeDescriptor, EdgeType>

◆ NeighborList

template<typename VertexType , typename EdgeType >
using occ::core::graph::Graph< VertexType, EdgeType >::NeighborList = ankerl::unordered_dense::map<VertexDescriptor, EdgeDescriptor>

◆ VertexDescriptor

template<typename VertexType , typename EdgeType >
using occ::core::graph::Graph< VertexType, EdgeType >::VertexDescriptor = std::size_t

◆ Vertices

template<typename VertexType , typename EdgeType >
using occ::core::graph::Graph< VertexType, EdgeType >::Vertices = ankerl::unordered_dense::map<VertexDescriptor, VertexType>

Constructor & Destructor Documentation

◆ Graph()

template<typename VertexType , typename EdgeType >
occ::core::graph::Graph< VertexType, EdgeType >::Graph ( )
default

Member Function Documentation

◆ add_edge() [1/2]

template<typename VertexType , typename EdgeType >
EdgeDescriptor occ::core::graph::Graph< VertexType, EdgeType >::add_edge ( VertexDescriptor  source,
VertexDescriptor  target,
const EdgeType &  edge,
bool  bidirectional = false 
)
inline

◆ add_edge() [2/2]

template<typename VertexType , typename EdgeType >
EdgeDescriptor occ::core::graph::Graph< VertexType, EdgeType >::add_edge ( VertexDescriptor  source,
VertexDescriptor  target,
EdgeType &&  edge,
bool  bidirectional = false 
)
inline

◆ add_vertex() [1/2]

template<typename VertexType , typename EdgeType >
VertexDescriptor occ::core::graph::Graph< VertexType, EdgeType >::add_vertex ( const VertexType &  vertex)
inline

◆ add_vertex() [2/2]

template<typename VertexType , typename EdgeType >
VertexDescriptor occ::core::graph::Graph< VertexType, EdgeType >::add_vertex ( VertexType &&  vertex)
inline

◆ adjacency_list()

template<typename VertexType , typename EdgeType >
const auto & occ::core::graph::Graph< VertexType, EdgeType >::adjacency_list ( ) const
inline

◆ breadth_first_traversal()

template<typename VertexType , typename EdgeType >
template<typename T >
void occ::core::graph::Graph< VertexType, EdgeType >::breadth_first_traversal ( VertexDescriptor  source,
T func 
) const
inline

◆ breadth_first_traversal_with_edge()

template<typename VertexType , typename EdgeType >
template<typename T >
void occ::core::graph::Graph< VertexType, EdgeType >::breadth_first_traversal_with_edge ( VertexDescriptor  source,
T func 
) const
inline

◆ connected_component_traversal()

template<typename VertexType , typename EdgeType >
template<typename T >
void occ::core::graph::Graph< VertexType, EdgeType >::connected_component_traversal ( T func)
inline

◆ connected_components()

template<typename VertexType , typename EdgeType >
auto occ::core::graph::Graph< VertexType, EdgeType >::connected_components ( ) const
inline

◆ depth_first_traversal()

template<typename VertexType , typename EdgeType >
template<typename T >
void occ::core::graph::Graph< VertexType, EdgeType >::depth_first_traversal ( VertexDescriptor  source,
T func 
) const
inline

◆ edge() [1/2]

template<typename VertexType , typename EdgeType >
auto occ::core::graph::Graph< VertexType, EdgeType >::edge ( EdgeDescriptor  e)
inline

◆ edge() [2/2]

template<typename VertexType , typename EdgeType >
const EdgeType & occ::core::graph::Graph< VertexType, EdgeType >::edge ( EdgeDescriptor  e) const
inline

◆ edges()

template<typename VertexType , typename EdgeType >
const auto & occ::core::graph::Graph< VertexType, EdgeType >::edges ( ) const
inline

◆ is_connected()

template<typename VertexType , typename EdgeType >
bool occ::core::graph::Graph< VertexType, EdgeType >::is_connected ( VertexDescriptor  i,
VertexDescriptor  j 
) const
inline

◆ neighbors() [1/2]

template<typename VertexType , typename EdgeType >
auto occ::core::graph::Graph< VertexType, EdgeType >::neighbors ( VertexDescriptor  v)
inline

◆ neighbors() [2/2]

template<typename VertexType , typename EdgeType >
const auto occ::core::graph::Graph< VertexType, EdgeType >::neighbors ( VertexDescriptor  v) const
inline

◆ num_edges()

template<typename VertexType , typename EdgeType >
size_t occ::core::graph::Graph< VertexType, EdgeType >::num_edges ( ) const
inline

◆ num_vertices()

template<typename VertexType , typename EdgeType >
size_t occ::core::graph::Graph< VertexType, EdgeType >::num_vertices ( ) const
inline

◆ size()

template<typename VertexType , typename EdgeType >
size_t occ::core::graph::Graph< VertexType, EdgeType >::size ( ) const
inline

◆ vertex() [1/2]

template<typename VertexType , typename EdgeType >
auto occ::core::graph::Graph< VertexType, EdgeType >::vertex ( VertexDescriptor  v)
inline

◆ vertex() [2/2]

template<typename VertexType , typename EdgeType >
const VertexType & occ::core::graph::Graph< VertexType, EdgeType >::vertex ( VertexDescriptor  v) const
inline

◆ vertices()

template<typename VertexType , typename EdgeType >
const auto & occ::core::graph::Graph< VertexType, EdgeType >::vertices ( ) const
inline

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