Boost Graph Library (Directed Graph Example)

Help
2012-10-22
2013-05-14
  • Eberhard2010
    Eberhard2010
    2012-10-22

    Hallo,

    I try to use BGL to benefit from its features in the next future. All I got is templates and restrictions. The minimum example in the manual are not good to understand. Imagin I define my Unidirected_Graphtype like this:

    typedef adjacency_list <vecS,vecS,undirectedS,MyVertexClass,MyEdgeClass> Unidirected_Graphtype;
    Unidirected_Graphtype g=Unidirected_Graphtype(2);

    //for loop
    myvertex1=MyVertexClass( ….);
    add_vertex(myvertex1,g);
    myvertex1=MyVertexClass( something else );
    add_vertex(myvertex1,g);
    a.s.o.
    //end of for

    Now. I want to find the vertex which has a special property prop1.
    I want to insert an edge between prop1 and prop2.
    How I do this? Please comment your solution. Thx.

    Regards Eberhard