$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] BGL: How to get add_edge work with adjacency_list graph
From: Christoph (c_p_at_[hidden])
Date: 2011-09-26 06:05:42
Dear List,
i just started learning about The Boost Graph Library. Here is my
Problem in a minimal example:
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
typedef boost::adjacency_list < boost::listS,
                                    boost::listS, 
                                    boost::bidirectionalS>
    Map;
int main()
{
    Map map;
    std::cout 	<< "number of vertices: " 
                << num_vertices(map) << std::endl;
    Map::vertex_descriptor u = boost::add_vertex (map);;
    Map::vertex_descriptor v = boost::add_vertex (map);;
    std::cout 	<< "number of vertices: " 
                << num_vertices(map) << std::endl;
   
    Map::add_edge (u, v, map); // <- problem
    return 0; 
}
The compiler tells me that âadd_edgeâ is not a member of âMapâ. I would
like to know why and what am i doing wrong by writing 
"Map::add_edge (u, v, map);"
best regards
Christoph