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
4
votes
1 answer

Send a simple boost graph object via boost:MPI got error

I am making a test by modifying the code 'serialize.cpp' in '/apps/boost_1_56_0/libs/graph/test' and trying to send a boost graph object over the network via boost MPI. It compiled fine, but when I ran the executable using mpirun, I got this…
user3658306
  • 217
  • 4
  • 15
4
votes
1 answer

Random access of Vertices using Boost::graph

I am trying to iterate over my boost graph's vertices in parallel using OpenMP. This seems to require having an iterator that supports random access of elements (e.g., itr[i] gets the ith element). However, the iterator that vertices(g) returns (a…
Sam
  • 2,707
  • 20
  • 25
4
votes
1 answer

Simple dot output for Boost Graph edges labelled with basic types

Using bundled properties with the Boost Graph Library means it's very simple to create code to output a dot file compatible with graphviz: #include struct Edge { int i; }; int main() { using namespace boost; typedef…
user2023370
  • 10,488
  • 6
  • 50
  • 83
4
votes
2 answers

Boost Graph : Test if two vertices are adjacent

I'm new in using C++ boost library in particularly the boost graph library which a needed to try coding some algorithms where i commonly check the adjacency of two vertices and dealing with other graph concepts like computing graph invariants. What…
user9879283
  • 99
  • 4
  • 9
4
votes
2 answers

Iteratively populate a BGL graph by use of a boost spirit qi parser

This question is a follow-up to "Iterative update of abstract syntax tree with boost spirit". Known: Parser grammar allows recursion The requirements are: The AST for the parser must be a BGL graph. Input can be one-to-many symbols per parser…
Dev Dev
  • 105
  • 6
4
votes
1 answer

Boost DFS tutorial: from serial to parallel

So, I have implemented a path overlap on a graph with a custom-made A*, using boost::graph, but all developed from scratch. What is a path overlap is simple. Given a graph of letters ('A'-> 'C', ...), and a word HELLO, I need to find the best…
senseiwa
  • 2,369
  • 3
  • 24
  • 47
4
votes
1 answer

Methods for implementing and using graphs of nodes in C++?

I am working on a research project that deals with social networks. I have done most of the backbone of the program in C++ and am now wanting to implement a way to create the graph of nodes and the connections as well as a way to visualize the…
patemotter
  • 1,043
  • 1
  • 11
  • 19
4
votes
2 answers

Provide vertex-mapping parameter to boost::graph::copy_graph

The boost function boost::graph::copy_graph template void copy_graph(const VertexListGraph& G, MutableGraph& G_copy, const bgl_named_params& params = all defaults) lists in its parameter…
hooch
  • 1,135
  • 1
  • 16
  • 31
4
votes
1 answer

Change value of adjacent vertices and remove self loop

Try to write a Karger’s algorithm with boost::graph example (first column is vertice, other are adjacent vertices): 1 2 3 2 1 3 4 3 1 2 4 4 2 3 assume I merge 2 to 1, I get the result 1 2 3 2 1 1 3 4 2 1 3 4 3 1 2 4 4 2 3 first question : How…
StereoMatching
  • 4,971
  • 6
  • 38
  • 70
4
votes
1 answer

Using Boost Graph Library (BGL) to identify connected components

I am trying to use the Boost Ggraph Library. On each iteration of my program, I have a set of points, e.g. {1,2,3,4,5,6,7,8,9,10} on iteration one and {1,2,3,...,1000} on iteration two, ... For each point I know which other points it is connected…
ziv
  • 189
  • 1
  • 9
4
votes
4 answers

Performance issue with graph incremental construction

I am working on a software where i have to create a graph (using boost::adjacency_list). The incremental insertion of vertices takes an extremely long time. Until now, i hadn't worked on the issue, because the use of STLport made this problem go…
user259233
4
votes
1 answer

boost graph library directed multigraph edge_range bug

I have a directed multigraph with vertices A..C and edges E1..E4 A ---E1--> B A ---E2--> B A ---E3--> B B ---E4--> C I wanted to iterate over the edges that connect A and B. In BGL, I expressed this as: #include…
nurettin
  • 11,090
  • 5
  • 65
  • 85
4
votes
1 answer

How to use boost::graph algorithms with listS, setS as vertex/edge containers?

The boost examples for usage of the boost::graph library usually employ a graph like using namespace boost; typedef adjacency_list < vecS, // edge container vecS, // vertex container undirectedS, property
a2sng
  • 253
  • 3
  • 10
4
votes
1 answer

Unexpected negative edge weight error in boost::prim_minimum_spanning_tree

The following code throws "negative edge weight" on prim_minimum_spanning_treecall even though i am using only positive numbers. What should be changed to make it work? typedef boost::property VertexProperty; typedef…
alexm
  • 6,854
  • 20
  • 24
4
votes
1 answer

Merging graphs using boost graph

How do I add edge between two different graphs using Boost Graph Library. I have seen code for merging/contracting two vertices, but I do not want to do that. I want to link end vertex of one graph to the starting vertex of another graph and make it…
p_kajaria
  • 87
  • 2
  • 12