Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed > Class Template Reference

Public Types

using vertex_property = VertexProperty
 Vertex information.
 
using edge_property = EdgeProperty
 Edge information.
 
using directed_category = Directed
 Is the graph directed or not.
 
using vertex_descriptor = typename base_type::vertex_descriptor
 Vertex descriptor ("node ID" in other words).
 
using edge_descriptor = typename base_type::edge_descriptor
 Edge descriptor.
 
using degree_size_type = typename base_type::degree_size_type
 Degree size type.
 
using traversal_category = typename base_type::traversal_category
 The ways in which the vertices in the graph can be traversed.
 
using in_edge_iterator = typename base_type::in_edge_iterator
 Iterate through the in-edges.
 
using out_edge_iterator = typename base_type::out_edge_iterator
 Iterate through the out-edges.
 
using edge_parallel_category = typename base_type::edge_parallel_category
 

Public Member Functions

 graph_common ()
 Default constructor.
 
 graph_common (size_t n)
 Constructs a graph with \(n\) vertices.
 
Topology Lookup
int num_vertices () const
 Number of vertices in the graph.
 
int num_edges () const
 Number of edges in the graph.
 
bool is_isomorphic (graph_common const &other) const
 Detects if there is a 1-to-1 mapping of the vertices in one graph to the vertices of another graph such that adjacency is preserved.
 
degree_size_type degree (vertex_descriptor u) const
 Returns the number of in-edges plus out-edges.
 
degree_size_type in_degree (vertex_descriptor u) const
 Returns the number of in-edges of vertex \(u\).
 
degree_size_type out_degree (vertex_descriptor v) const
 Returns the number of out-edges of vertex \(v\).
 
std::optional< edge_descriptoredge (vertex_descriptor u, vertex_descriptor v) const
 Returns the edge between two vertices of the graph if the edge exists.
 
vertex_descriptor source (edge_descriptor e) const
 Returns the source vertex of a directed edge.
 
vertex_descriptor target (edge_descriptor e) const
 Returns the target vertex of a directed edge.
 
Topology Modification
vertex_descriptor add_vertex ()
 
void clear_vertex (vertex_descriptor u)
 Remove all edges to and from vertex \(u\) from the graph.
 
void remove_vertex (vertex_descriptor u)
 Remove vertex u from the graph, also removing all edges to and from vertex \(u\).
 
edge_descriptor add_edge (vertex_descriptor u, vertex_descriptor v)
 Inserts the edge \((u,v)\) into the graph if it does not exist, and returns an edge descriptor pointing to the new edge.
 
void remove_edge (vertex_descriptor u, vertex_descriptor v)
 Remove the edge \((u,v)\) from the graph.
 
void remove_edge (edge_descriptor e)
 Remove the edge \(e\) from the graph.
 
Iterators
auto in_edges (vertex_descriptor u) const
 Provides a range to iterate over the in-going edges of vertex \(u\).
 
auto out_edges (vertex_descriptor u) const
 Provides a range to iterate over the out-going edges of vertex \(u\).
 
auto vertices () const
 Provides a range to iterate over the vertices of the graph.
 
auto edges () const
 Provides a range to iterate over the edges of the graph.
 

Static Public Member Functions

static constexpr vertex_descriptor null_vertex ()
 Null vertex identifier.
 

Protected Types

using base_type = typename Representation::rebind< Directed, VertexProperty, EdgeProperty >
 The type of graph hold by the graph class - disallow parallel edges.
 

Protected Attributes

base_type _graph
 

Member Function Documentation

◆ add_edge()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
edge_descriptor quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::add_edge ( vertex_descriptor  u,
vertex_descriptor  v 
)
inline

Inserts the edge \((u,v)\) into the graph if it does not exist, and returns an edge descriptor pointing to the new edge.

Parameters
uSource vertex
uTarget vertex

◆ clear_vertex()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
void quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::clear_vertex ( vertex_descriptor  u)
inline

Remove all edges to and from vertex \(u\) from the graph.

Parameters
uThe vertex

◆ degree()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
degree_size_type quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::degree ( vertex_descriptor  u) const
inline

Returns the number of in-edges plus out-edges.

Parameters
uThe vertex \(u\)
Returns
Returns the number of in-edges plus out-edges.

◆ edge()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
std::optional< edge_descriptor > quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::edge ( vertex_descriptor  u,
vertex_descriptor  v 
) const
inline

Returns the edge between two vertices of the graph if the edge exists.

Parameters
uThe first vertex
uThe second vertex
Returns
An optional edge descriptor \(e\).

◆ edges()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
auto quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::edges ( ) const
inline

Provides a range to iterate over the edges of the graph.

Returns
A range

◆ in_degree()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
degree_size_type quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::in_degree ( vertex_descriptor  u) const
inline

Returns the number of in-edges of vertex \(u\).

Parameters
uThe vertex \(u\)
Returns
The number of in-edges.

◆ in_edges()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
auto quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::in_edges ( vertex_descriptor  u) const
inline

Provides a range to iterate over the in-going edges of vertex \(u\).

Parameters
uThe vertex \(u\).
Returns
A range

◆ is_isomorphic()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
bool quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::is_isomorphic ( graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed > const &  other) const
inline

Detects if there is a 1-to-1 mapping of the vertices in one graph to the vertices of another graph such that adjacency is preserved.

Parameters
otherA graph graph.
Returns
true if there exists an isomorphism between the two graphs and false otherwise

◆ null_vertex()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
static constexpr vertex_descriptor quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::null_vertex ( )
inlinestaticconstexpr

Null vertex identifier.

Returns
A null vertex

◆ num_edges()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
int quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::num_edges ( ) const
inline

Number of edges in the graph.

Returns
The number of edges.

◆ num_vertices()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
int quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::num_vertices ( ) const
inline

Number of vertices in the graph.

Returns
The number of vertices.

◆ out_edges()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
auto quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::out_edges ( vertex_descriptor  u) const
inline

Provides a range to iterate over the out-going edges of vertex \(u\).

Parameters
uThe vertex \(u\).
Returns
A range

◆ remove_edge() [1/2]

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
void quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::remove_edge ( edge_descriptor  e)
inline

Remove the edge \(e\) from the graph.

Parameters
eThe edge to remove

◆ remove_edge() [2/2]

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
void quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::remove_edge ( vertex_descriptor  u,
vertex_descriptor  v 
)
inline

Remove the edge \((u,v)\) from the graph.

Parameters
uSource vertex
uTarget vertex

◆ remove_vertex()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
void quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::remove_vertex ( vertex_descriptor  u)
inline

Remove vertex u from the graph, also removing all edges to and from vertex \(u\).

Parameters
uThe vertex to remove.

◆ source()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
vertex_descriptor quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::source ( edge_descriptor  e) const
inline

Returns the source vertex of a directed edge.

Parameters
eThe edge
Returns
The source vertex of the edge \(e\).

◆ target()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
vertex_descriptor quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::target ( edge_descriptor  e) const
inline

Returns the target vertex of a directed edge.

Parameters
eThe edge
Returns
The target vertex of the edge \(e\).

◆ vertices()

template<class CRTP , class VertexProperty , class EdgeProperty , connectedness Representation, directional Directed>
auto quetzal::geography::detail::graph_common< CRTP, VertexProperty, EdgeProperty, Representation, Directed >::vertices ( ) const
inline

Provides a range to iterate over the vertices of the graph.

Returns
A range

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