Public Member Functions | Private Attributes
transform_graph::internal::Graph Class Reference

Graph implements a sparse, unweighted, and undirected graph. More...

#include <graph_internal.h>

List of all members.

Public Member Functions

void AddEdge (const std::string &v1, const std::string &v2)
 Adds an undirected edge to the graph.
 Graph ()
bool HasVertex (const std::string &v) const
 Returns if the given vertex exists in the graph.
bool Path (const std::string &source, const std::string &target, std::vector< std::string > *path) const
 Finds the path between the source vertex and the target vertex. If a path exists, it is specified in the path vector (including both endpoints). If the source and target are the same, then the path returned is of length 1.

Private Attributes

std::map< std::string,
std::set< std::string > > 
adjacencies_

Detailed Description

Graph implements a sparse, unweighted, and undirected graph.

Definition at line 13 of file graph_internal.h.


Constructor & Destructor Documentation

Definition at line 16 of file graph_internal.cpp.


Member Function Documentation

void transform_graph::internal::Graph::AddEdge ( const std::string &  v1,
const std::string &  v2 
)

Adds an undirected edge to the graph.

Definition at line 18 of file graph_internal.cpp.

bool transform_graph::internal::Graph::HasVertex ( const std::string &  v) const

Returns if the given vertex exists in the graph.

Returns:
true if the given vertex exists in the graph, false otherwise.

Definition at line 66 of file graph_internal.cpp.

bool transform_graph::internal::Graph::Path ( const std::string &  source,
const std::string &  target,
std::vector< std::string > *  path 
) const

Finds the path between the source vertex and the target vertex. If a path exists, it is specified in the path vector (including both endpoints). If the source and target are the same, then the path returned is of length 1.

Returns:
true if a path exists, false otherwise.

Definition at line 23 of file graph_internal.cpp.


Member Data Documentation

std::map<std::string, std::set<std::string> > transform_graph::internal::Graph::adjacencies_ [private]

Definition at line 33 of file graph_internal.h.


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


transform_graph
Author(s):
autogenerated on Sat Jun 8 2019 19:23:43