I have an adjacency list as shown below. At this point, I need to access the vertex_descriptor as an int type. How can I do this tvertex source = ...; int source_as_int = ???source??? tvertex source = ...; int source_as_int = ???source??? I remember how I came across this issue before and solved it, but I donβt remember how the BGL documentation is useless, using it as a reference, they should try to look at Javadocs and get to know it.
Another possibility is to use a possible member function like vertex_descriptor or some other global BGL function for this purpose ... no one ever knows where to look for it and they seem like a random choice between global functions or member functions, a complete rejection intuitive design if you ask me.
typedef adjacency_list_traits<setS, setS, bidirectionalS> ttraits; typedef adjacency_list<setS, setS, bidirectionalS, // vertex properties property<vertex_color_t, default_color_type>, // edge properties property<edge_capacity_t, int, property<edge_residual_capacity_t, int, property<edge_reverse_t, ttraits::edge_descriptor> > >, no_property, vecS> tbgl_adjlist_bidir; typedef graph_traits<tbgl_adjlist_bidir>::vertex_descriptor tvertex; typedef graph_traits<tbgl_adjlist_bidir>::edge_descriptor tedge; typedef property_map<tbgl_adjlist_bidir, edge_capacity_t>::type tedge_capacity_map; typedef property_map<tbgl_adjlist_bidir, edge_reverse_t>::type treverse_edge_map; typedef property_map<tbgl_adjlist_bidir, vertex_color_t>::type tvertex_color_map; typedef graph_traits<tbgl_adjlist_bidir>::out_edge_iterator tout_edge_iterator; typedef graph_traits<tbgl_adjlist_bidir>::in_edge_iterator tin_edge_iterator;
source share