August 2017
Intermediate to advanced
438 pages
14h 19m
English
In this recipe, we'll describe a graph type, create a graph of that type, add some vertexes and edges to the graph, and search for a specific vertex. That should be enough to start with Boost.Graph.
#include <boost/graph/adjacency_list.hpp>
#include <string>
typedef std::string vertex_t;
typedef boost::adjacency_list<
boost::vecS
, boost::vecS
, boost::bidirectionalS
, vertex_t
> graph_type;
int main() { graph_type graph;
static const std::size_t vertex_count = 5;
graph.m_vertices.reserve(vertex_count);
typedef boost::graph_traits< ...
Read now
Unlock full access