Questions tagged [boost-graph]

Boost.Graph is a C++ library containing generic graph components and algorithms.

Boost.Graph is a C++ library containing generic graph components and algorithms.

680 questions
0
votes
1 answer

using boost bind for function object with a state and two arguments in operator()()

I am having some trouble in doing the following : using boost::bind / std::bind in a boost graph. //function object template struct my_functor { public: my_functor() { } my_functor(graph_t& _G) : G(_G) { } …
Pogo
  • 475
  • 3
  • 19
0
votes
0 answers

Removing the last vertex from a boost graph throws an exception

Here's the code I'm using: typedef boost::adjacency_list Graph; Graph g; typedef graph_traits::vertex_descriptor Vertex; typedef graph_traits::edge_descriptor Edge_Desc; typedef…
Dula
  • 1,404
  • 1
  • 14
  • 29
0
votes
1 answer

Boost graph library causing errors when applying dijkstra's algorithm

I have been loosely following this example, this one, and this stack overflow post to try to apply Dijkstra's algorithm to find the cost of the shortest path between two nodes. If I try to follow the first example, I get an error with the typedef…
charmoniumQ
  • 5,214
  • 5
  • 33
  • 51
0
votes
1 answer

Iterate over boost graph without Visitor

I need to iterate over a graph(DFS), but without using the standard DFS visitor callback technique. Is there a way to iteratively traverse the graph in this manner ? for(each edge in my graph visited in dfs) { do some complicated stuff; }
subzero
  • 27
  • 5
0
votes
1 answer

to convert internal properties in boost graph to external properties container in boost graph

With reference to the code mentioned in my question here enter link description here, I want to convert the internal properties struct NodeInfo { int a , b , c; }; struct EdgeInfo { int timestamp; ... }; struct NodeInfoPropertyTag { …
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

Build neighboring vertices in a boost adjacency graph knowing the connectivity

I have a problem with the boost graph library. At the initialization step, I want to store an image in this adjacency graph: typedef boost::adjacency_list
0
votes
1 answer

Boost Graph Library C++/ Power Law

I have a vector of vertex with id,x & y coordinates, I want to generate a power law graph for my vertices. The Boost Library graph provide power law plod_iterator() but how can I generate that with my vertices. anyone can help?
zaza
  • 365
  • 2
  • 7
0
votes
1 answer

error using find() in boost associative property map in BOOST graph

I want to implement an ifexists() template function which checks whether a key exists in a map or not. If it is a std::map< > , I can use find() function in template, and hence can implement my template ifexists() function. (below) But I use…
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

boost::associative_property_map() compile error

using this link on boost website, I am able to compile the code here. and even get the answer (example). But when I do the same by defining in a class, I get the error as follows: #include < as usual in the code > class Test{ …
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

out_edges() implementation in BOOST filtered_graph without edge_predicate

I have a boost::filtered_graph< Graph_t, boost::keep_all, vertex_predicate > Say FG is my filtered graph. and v1 is any node for which i want to find all out edges using out_edge_iterators edge_predicate here is " keep_all " vertex predicate is…
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

filter over an existing filtered_graph in BOOST Graph

with continuation to my previous question HERE, is it possible to define/initialize a filtered_graph over existing filtered graph. for example, class A{ FilteredGraphType_t fg // it is a typedef // constructor template < typename ... ,…
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

To initialize a filtered_graph object in constructor after graph is defined in BOOST GRAPH

I have a query in initializing filtered_graph in boost. here is my code, // predicate template struct edge_predicate { bool operator()(const typename boost::graph_traits::edge_descriptor& v) const { return…
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

Using boost filtered_graph without print_graph()

I was hoping if there is any other way to use boost::filtered_graph () without the print_edges() or print_graph() functions. in the link here, it seems that the filter works on every node only when the print graph or print edge function is called.…
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

modify filter_iterator predicate to accept two arguments (binary fn) in BOOST

with reference to my previous question here, how do i pass another argument to the predicate. for example here is the code snippet. // want this to take 2 arguments instead of one. (like a binary function) template < typename edge > …
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

BGL : get vertex descriptor with data

I want to get the vertex descriptor with the composant of the vertex, like this : struct WayPoint{ std::pair pos; // with this composant }; the adjency list : typedef boost::adjacency_list< boost::listS, …
thegrandwaazoo
  • 301
  • 2
  • 15