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

Boost graph list or vec

I've been spending quite a few days working with the boost graph library. As far as I understand, when considering VertexList and EdgeList storage : vecS : possess an index, so can be access with it when removing vertices, iterator are…
Malcolm
  • 662
  • 7
  • 29
5
votes
1 answer

Boost Graph accessing properties through vertex_descriptor

I have my custom vertex and edge properties namespace boost { enum vertex_diagonal_t{vertex_diagonal = 999}; BOOST_INSTALL_PROPERTY(vertex, diagonal); } namespace boost { enum edge_dominance_t{edge_dominance = 998}; …
Neel Basu
  • 12,638
  • 12
  • 82
  • 146
5
votes
3 answers

Apply algorithms considering a specific edge subset

I've got a huge graph with typed edge (i.e. edge with a type property). Say typedef adjacency_list Graph; The "type" of the edge is a member of edge_prop and has a value in {A,B,C,D}, I'd like to run the…
log0
  • 10,489
  • 4
  • 28
  • 62
5
votes
2 answers

Return a list of connected component subgraphs in Boost Graph

I'm having problems in filtering the subgraphs with the same component in the original graph. I want to output them in a vector of subgraphs. Following the example in `connected_components I've tried to adapt it to me needs: // Create a typedef for…
linello
  • 8,451
  • 18
  • 63
  • 109
5
votes
1 answer

Boost graph libraries: setting edge weight values

I am investigating the use of the boost graph libraries in order to apply them to various network problems I have in mind. In the examples I have been looking at the graph edge values ("weights") are always initialized as integers, such as in these…
AndyUK
  • 3,933
  • 7
  • 42
  • 44
5
votes
3 answers

How to add colored edge in boost graph?

int main() { using namespace std; using namespace boost; typedef adjacency_list< listS, vecS, directedS > digraph; // instantiate a digraph object with 8 vertices digraph g; // add some edges add_edge(0, 1, g); …
humanshu
  • 139
  • 1
  • 6
5
votes
1 answer

On C++ Boost Graph Creation and the vertex_index Property.

I am boost noob. I am wondering why compilation fails in the following code. I am creating a set of vertices, and trying to assign my own vertex indices and vertex names. (I am following this page:…
mskb
  • 341
  • 3
  • 12
5
votes
1 answer

using c++11 auto as return type for const function object

I have a const function object and for the timebeing, it returnes void. but can return int or double. I am writing the code in c++11 style and was just trying to use auto as return type. Although the code compiles, I am not sure it is 100% correct…
Pogo
  • 475
  • 3
  • 19
5
votes
2 answers

Why is Boost Graph Library's `source()` a global function?

I understand that in generic programming, algorithms are decoupled from containers. So it would make no sense to implement a generic algorithm as an instance method (the same algorithm should work on multiple concrete classes; we don't want to make…
max
  • 49,282
  • 56
  • 208
  • 355
5
votes
1 answer

Is it possible to change breadth first search termination condition in BGL?

I am new to BGL(boost graph library). I am learning the breadth_first_search interface and it looks handy. However, in my application, I need to cut the breadth_first_search when some other termination condition is meet such as the search space node…
xiao 啸
  • 6,350
  • 9
  • 40
  • 51
5
votes
2 answers

Modifying bundled properties from visitor

How should I modify the bundled properties of a vertex from inside a visitor? I would like to use the simple method of sub-scripting the graph, but the graph parameter passed into the visitor is const, so compiler disallows changes. I can store a…
ravenspoint
  • 19,093
  • 6
  • 57
  • 103
5
votes
1 answer

Resuming an a-star search in BGL

I am running an astar algorithm on a graph that is partially (?) implicit - it is built from a large paging data source, but the graph is persistent. I need to handle paging in new parts of the graph whenever the astar algorithm gets to an area that…
user1299170
  • 108
  • 4
5
votes
2 answers

BGL Adding an edge with multiple properties

I want to have all edges have to properties, weight and capacity. I found that BGL has these both already defined. So I define Edge and Vertex properties for the Graph typedef property VertexProperty; typedef…
Jim
  • 3,236
  • 8
  • 33
  • 43
4
votes
3 answers

LEDA graph v/s Boost Graph library

I want efficiency and I am willing to write code by myself if efficiency (=0.9*speed + 0.1*others) is high. If I were to choose between LEDA graph or Boost graph, which one should I choose? My algorithms are time-consuming (some are even…
Dilawar
  • 5,438
  • 9
  • 45
  • 58
4
votes
2 answers

Is it possible to apply breadth-first search algorithm of boost library to matrix?

My task is to find the shortest way in a matrix from one point to other. It is possible to move only in such direction (UP, DOWN, LEFT, RIGHT). 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 F 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 S 0 1 0 0 1 0 0 0 0 0 0…
Lucky Man
  • 1,488
  • 3
  • 19
  • 41