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

Boost graph wrapper compilation error

I'm a beginner in boost graph library and I got the following error while compiling : mytree.cpp:80: error: expected init-declarator before '<' token Here is the wrong line : typedef boost::labeled_graph
Yelsi
  • 11
  • 1
0
votes
1 answer

How to get weight map from bundled properties for Kruskal MST?

I'm trying to apply Kruskal's minimum spanning tree to my graph to turn it from a undirected cyclic graph into a real tree. The edge weights are all the same, because it doesn't matter whether the MST is unique or not. So far I've implemented it as…
a2sng
  • 253
  • 3
  • 10
0
votes
1 answer

Boost Graph: What happens when calling remove_vertex on vertex with degree > 0

From the boost graph manual for the function remove_vertex It is assumed that there are no edges to or from vertex u when it is removed. One way to make sure of this is to invoke clear_vertex() beforehand. What happens if you do call…
Sean Lynch
  • 2,852
  • 4
  • 32
  • 46
0
votes
1 answer

All possible paths in a series of numbers

I have a small problem where I need to find all possible paths given a set of numbers. For example, lets say we have numbers 1, 2 and 3. I need to find all the possible combinations. The result for this simple case is: path_1 = 1 path_2 = 2 path_3 =…
Some_Geeza
  • 41
  • 6
0
votes
1 answer

Removing an edge from a graph

I would like to remove some edges from a graph generated using Boost graph library. I use Boost's boost::mt19937 to generate random numbers from 1 to N(number of vertices) as shown below, and add random edges. #include "stdafx.h" #include…
Spaniard89
  • 2,359
  • 4
  • 34
  • 55
0
votes
1 answer

Generating a Graph using Boost library by allowing user to select the number of vertex

I would like to generate a graph using boost library which would allow user to input the number of edges and vertex. What I basically want to do is, I would want the user to input the number of vertices and number each vertex. I would give the…
Spaniard89
  • 2,359
  • 4
  • 34
  • 55
0
votes
1 answer

Creating a graph using Boost Graph library

I am new to graph theory and graph concept. I am workign on something, that requires me to create a mesh(Undirected graphs) with n number of nodes. Once the structure is created, I would be running various algorithms on the structure, to find a…
Spaniard89
  • 2,359
  • 4
  • 34
  • 55
0
votes
1 answer

Boost graph unable to union_set

This question is connected with: Using boost connected components with cartesian points I've made some changes in example to use cartesian points. Here is my current code: using namespace boost; typedef adjacency_list
krzych
  • 2,126
  • 7
  • 31
  • 50
0
votes
1 answer

Boost Graph Library - weight property from external vector

What am I doing wrong? #include #include #include using namespace std; typedef boost::adjacency_list<> Graph; void dijkstra(Graph &g, vector
zoo
  • 1,901
  • 1
  • 17
  • 25
-1
votes
1 answer

how to use boost graph as a member variable

I am almost new to boost-graph library. How to declare graph as a member variable? typedef boost::adjacency_list Graph; class myclass{ private: …
Abolfazl
  • 1,047
  • 2
  • 12
  • 29
-1
votes
1 answer

BGL - Custom Visitor that weights edge weights by previous step

I have a directed graph, which I know doesn't have any circular dependencies and have "termination" nodes i.e they have a custom vertex property, which is a bool that I can check. Each edge is weighted using the BGL built-in edge weight…
oracle3001
  • 1,090
  • 19
  • 31
-1
votes
1 answer

How do I add a vertex in between 0 and 1 such that there exists an edge from 0 to 0.5(the new vertex, say) and 0.5 to 1 using Boost Graph Library?

I have a boost graph: Graph g(2); indices of which I access like: g[0]; g[1]; I draw an edge add_edge(0, 1, g); Problem: I want to add a vertex in between 0 and 1 such that there exists an edge from 0 to 0.5 (the new vertex, say) and 0.5 to…
Aviral Srivastava
  • 137
  • 1
  • 2
  • 6
-1
votes
1 answer

undirected_dfs: how to get the vectors of edges

NB: The question below is the context of "boost-graph". But the issue is maybe a "c++" issue or "boost-graph" issue. Using boost-graph and undirected_dfs, I am trying to get the vectors of edges. The code print correctly back_edge and tree_edge. My…
alvaro562003
  • 678
  • 1
  • 6
  • 27
-1
votes
1 answer

Wrap my custom graph with boost::graph and calculate dijkstra_shortest_paths

I've got a project with a large graph filled like this: struct EdgeItem{ int mPid1; int mPid2; double weight; }; struct StationItem{ int mPid; QString mName; }; QMap StationsMap; QList
Dmitry Ilukhin
  • 490
  • 3
  • 9
-1
votes
3 answers

BGL : dijkstra_shortest_paths usage

I'm struggling with dijkstra_shortest_paths() usage. Here is a code snippet which gives tons of compilation error output : Vertex_t s = *departIter; /* VertexIterator_t departIter */ std::vector p( boost::num_vertices( this->m_g ) ); /*…
Dmitry
  • 1,912
  • 2
  • 18
  • 29
1 2 3
45
46