Hi Olivier,
Olivier Tournaire
Here is the code:
#include <iostream> #include <vector> using namespace std;
#include
#include using namespace boost; typedef adjacency_list_traits < vecS, vecS, directedS > Traits; typedef adjacency_list < vecS, vecS, directedS, property < vertex_index_t, long, property < vertex_color_t, boost::default_color_type, property < vertex_distance_t, long, property < vertex_potential_t, long, // stores the unary energy associated to each vertex property < vertex_predecessor_t, Traits::edge_descriptor > > > > >, property < edge_capacity_t, long, // stores the binary energy associated to each edge property < edge_residual_capacity_t, long, property < edge_reverse_t, Traits::edge_descriptor > > > > Graph;
int main(int argc, char** argv) { Graph g;
property_map
::type capacity = get(edge_capacity, g); property_map ::type rev = get(edge_reverse, g);
add_vertex(g); add_vertex(g); add_vertex(g); or so ...
graph_traits<Graph>::vertex_iterator v_first, v_second, v_third; v_first = vertices(g).first; v_second = v_first; ++v_second; v_third = v_second; ++v_third;
Did you forget to add a few vertices before calling vertices(g) ? Eric