Graph implements a sparse, unweighted, and undirected graph. More...
#include <graph_internal.h>
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_ |
Graph implements a sparse, unweighted, and undirected graph.
Definition at line 13 of file graph_internal.h.
Definition at line 16 of file graph_internal.cpp.
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.
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.
Definition at line 23 of file graph_internal.cpp.
std::map<std::string, std::set<std::string> > transform_graph::internal::Graph::adjacencies_ [private] |
Definition at line 33 of file graph_internal.h.