From the boost documentation: "If the color of a vertex after running the algorithm is black the vertex belongs to the source tree else it belongs to the sink-tree (used for minimum cuts)."(boykov_kolmogorov_max_flow) I guess you should count those other values as part of the sink-tree set....

As I expected (from my recollection) the edge lists (both in/out) are already ordered by their targets, hence they are deterministic. This is especially unambiguous when the VertexContainer selector is vecS because, there, the vertex_descriptor is a simple integral type, that doubles as your vertex_index_t property anyways. Down The Rabbit...

It seems that you have to specify the edge index manually. Here is a modified version of AddBidirectionalEdge that correctly constructs the reverse edge map, as well as correctly sets the edge indices. void AddBidirectionalEdge(GraphType& graph, unsigned int source, unsigned int target, float weight, std::vector<EdgeDescriptor>& reverseEdges, std::vector<float>& capacity) { //...

c++,c++11,boost,tbb,boost-graph

Thanks to the comments provided by Dr. Jeremy Siek at this link here, I was able to define my own container type viz. concurrent_vector to the container_traits.hpp file in boost/pending/ folder. I can now change the vecS to concurrentVecS and use my algorithm. Although std::vector<> is thread safe for reads,...

c++,boost,depth-first-search,boost-graph,visitor

If you want to "track" which "route" vertex is currently being explored, you can use code similar to "predecessor_recorder" in your visitor. Details on predefined predecessor_recorder can be found here: http://www.boost.org/doc/libs/1_57_0/libs/graph/doc/predecessor_recorder.html. In fact, you probably would better of with dijkstra_shortest_paths. That algorithm reports a predecessor map for you. You can...

c++,boost,dijkstra,boost-graph,adjacency-list

Okay. You've come a long ways since Boost adjacency_list _swap errors when using boost Dijkstra; the sample is self-contained and can compileĀ¹ I figured I could just connect some dots and hope this would be helpful. 1. Using VEdge For the simplest option, I'd use Bundled Properties, and define VEdge...

You're using property lists: they're documented here. So in your example, you'd use diagonal_map_type vp = get(boost::vertex_diagonal, graph); using storage_type = std::vector<int>; storage_type repo_begining(10); for(storage_type::const_iterator i = repo_begining.begin(); i != repo_begining.end(); ++i) { diagonal_dominance_graph::vertex_descriptor dia_vertex = boost::add_vertex(graph); khut::diagonal* v = nullptr; boost::put(vp, dia_vertex, v); } // likewise for edges dominance_map_type...

c++,boost,boost-graph,dynamic-properties

The true issue at hand is that the category of the vertex property map is being deduced as LvaluePropertyMap (which it is). However, the LvaluePropertyMap concept promises to be a superset of ReadablePropertyMap and WritablePropertyMap. This poses problems when the const_type of the graph properties are used: they are lvalues,...

c++,boost,point-cloud-library,boost-graph

This is very strange. The problem is solved when I moved the header file #include<pcl/registration/icp.h> to the beginning of all the header files. No error any more and the program executed giving the expected results!...

As I stated in the update, it looks like the problem was in betweenness centrality. Digging through the dispatches in the source, and looking at the parameters in the docs I found that if vertex_index_map is not passed to the algorithm it defaults to get(vertex_index, g) which as we know...

c++,boost,boost-graph,adjacency-list

Two issues: the first argument needs to be a vertex descriptor, not the property bundle. Change boost::adjacent_vertices(g[*vp.first], g) into boost::adjacent_vertices(*vp.first, g) the return type is std::pair<adjacency_iterator, adjacency_iterator>. However, you defined adjacency_iterator as typedef boost::graph_traits<Graph>::adjacency_iterator adjacency_it; when it needs to be typedef boost::graph_traits<UndirectedGraph>::adjacency_iterator adjacency_it; Further notes: It's easier to work with...

c++,c++11,boost-graph,icc,icpc

Since you use a reference Graph& G in your predicate my_filter_pred the latter is copy-constructable but cannot be assigned by operator=. But you need operator = in many places of your code.gnable. I would recommend to change the code as follows template struct my_filter_pred { public: my_filter_pred() { } my_filter_pred(Graph&...

A* is based on an heuristic. If the legacy uses A* it means the problem is more complex then just find the shortest path. To find the shortest path between 2 vertices, there are certain Graph Algorithms, Dijkstra is the easyest one to implement (make sure to make it with...

c++,boost,parameter-passing,boost-graph

Something like this: typedef boost::graph_traits<graph_t>::vertex_descriptor vertex_t; typedef boost::property_map<graph_t, boost::vertex_index_t>::type index_map_t; //for simple adjacency_list<> this type would be more efficient: typedef boost::iterator_property_map<typename std::vector<vertex_t>::iterator, index_map_t,vertex_t,vertex_t&> IsoMap; //maps vertices of g to vertices of g_copy std::vector<vertex_t> isoValues( num_vertices(g)); IsoMap mapV( isoValues.begin()); boost::copy_graph( g,...

BGL is a highly generic library. You can adapt most any datastructure for use with its algorithms. You can vary the edge container. You don't mention it, but I'm assuming you've been looking at the interface/complexity guarantees for boost::adjacency_list. Indeed the edge membership test will be O(n) even if you...

c++,boost,graphviz,boost-graph

You couldn't even do std::cout << g[add_edge(0,1,{123,456},g)]; without providing e.g. inline static std::ostream& operator<<(std::ostream& os, std::array<double, 2> const& doubles) { return os << "{" << doubles[0] << "," << doubles[1] << "}"; } Now getting these overloads seen by lexical_cast at the right time is exceptionally hard to do portably...

c++,boost,graph-theory,boost-graph

We need to know a little more about your graph probably. I had a "similar" problem. This may not be exactly what you are looking for, but it is similar. This is a DFS visitor I used on a directed graph with a root to count the number of paths...

You made a typo in the second for loop: for (auto e : make_iterator_range(edges(g))) { Should be: for (auto e : make_iterator_range(edges(g2))) { So you were printing the content of the first graph twice, instead of the first then the second....

c++,boost,graph,boost-graph,graph-coloring

Hehe. This is gonna be the third boost bug to report today. The dimacs parsing code looks truly evil to me. The interface is very inconvenient and the implementation... Well, as you found it's very wrong: In read_edge_line there is this loop: if ('e' == linebuf[0]) { while (*tmp !=...

Starting at the top: it is NOT a good idea to specialize the adjacency list and add you own methods to it. Instead you should create an instance of the boost::adjacency_list class as a member of a new class that you can then write methods for. class cNavGraph { public:...

c++,algorithm,boost,graph,boost-graph

The interior properties formulation is: property<tag, type, next_property> Of course, unless you make Intersection_Graph behave like an integral type you cannot use it directly as the type of the vertex_index property. It's also likely not what you wanted. This looks closer: boost::property<boost::vertex_index_t, int, topologicalmap::Intersection_Graph> And it would declare two properties:...

c++,templates,boost,graph,boost-graph

What the error is telling you at the very beginning, is that VertexSetFilter must have a default constructor. Also, the documentation on boost::filtered_graph reads: Also, the predicate must be Default Constructible [1]. [1] The reason for requiring Default Constructible in the EdgePredicate and VertexPredicate types is that these predicates are...