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

how to write GraphViz subgraphs with boost::write_graphviz

Is it possible to generate a DOT subgraph using ::boost::write_graphviz? For instance, if I create a subgraph G0 in a graph G, can I get something like the following in the DOT output: graph G { subgraph G0 { ... } ... }
7
votes
2 answers

What does boost::out_edges( v, g ) in Boost.Graph do?

I am not able to comprehend the documentation for this function, I have seen several times the following tie (ei,ei_end) = out_edges(*(vi+a),g); **g**<-graph **vi**<-beginning vertex of graph **a**<- a node **ei and ei_end** <- edge iterators What…
LoveMeow
  • 3,858
  • 9
  • 44
  • 66
7
votes
1 answer

Which graphviz library API is recommended for a C++ project that needs to generate some graphs?

I know there are several versions of Graphviz as a library. But I'm a bit confused as to which one is considered current + recommended. I would like to generate and display a few graphs from a linux GUI application. According to…
Stéphane
  • 19,459
  • 24
  • 95
  • 136
7
votes
3 answers

Algorithm and data structure to find and store superpixels' neighborhood in C++

I have an image, holding results of segmentation, like this one. I need to build a graph of neighborhood of patches, colored in different colors. As a result I'd like a structure, representing the following Here numbers represent separate patches,…
wl2776
  • 4,099
  • 4
  • 35
  • 77
7
votes
1 answer

Getting edge properties (including related vertices) from boost::adjacency_list

So, I must have gone through the Boost documentation for an hour today. I must be blind. I have, I hope, a simple question: How do you get the corresponding vertices for an edge with boost::adjacency_list? I have the following code which I'm trying…
MichaelM
  • 5,518
  • 2
  • 30
  • 23
7
votes
1 answer

How to print a graph in graphviz with multiple properties displayed

My question is based off of: How to print a graph with a single property displayed I am using bundled properties: typedef struct vert{ std::string name; }; typedef struct edge{ int capacity; int weight; }; typedef…
Jim
  • 3,236
  • 8
  • 33
  • 43
6
votes
1 answer

copy a graph (adjacency_list) to another one

How can I copy a graph of type adjacency_list to another one graph of type adjacency_list ? typedef adjacency_list MyGraph; MyGraph g1, g2; // processing g1: adding vertices and edges ... //…
shn
  • 5,116
  • 9
  • 34
  • 62
6
votes
3 answers

Boost Subgraph and Bundled properties

I'm using bundled properties and adjacency_list and would like to use the subgraph class. struct Vertex { int index; int seed; }; struct Edge { bool visted; double weight; }; typedef adjacency_list
Ben
  • 83
  • 1
  • 4
6
votes
1 answer

What is the motivation behind the API of the Boost Graph DFS (and other algorithms)?

General question As I am making my first steps into the BGL, I struggle understand what justifies the Principle of Least Astonishment being a bit bullied here. Background So, after lots of efforts I could build a tree graph, and I was expecting to…
WaterFox
  • 850
  • 6
  • 18
6
votes
2 answers

Stop boost::depth_first_search along a particular depth if certain criteria is met

I'm using BGL to store my DAG. Vertices have states. Given a change in state in one of the vertices i want to update dependent vertices. This i'm able to do using boost::depth_first_search and a custom visitor. Now the logic is that i dont want to…
Vikas
  • 8,790
  • 4
  • 38
  • 48
6
votes
1 answer

Boost::graph (c++) outperformed by networkx (python)

EDIT: As pointed out by @sehe, the error lies somewhere before the betweenness centrality calculation. Move along! I implemented a minimal program to compute the betweenness centrality of an undirected graph, in both Python and C++. Surprisingly,…
jgyou
  • 473
  • 1
  • 8
  • 19
6
votes
3 answers

remove_vertex when the graph VertexList=vecS

I have a Boost Graph with VertexList=vecS. typedef adjacency_list TracksConnectionGraph; Now I want to iterate through my vertices and remove those that have a specific property. How can…
Dat Chu
  • 10,822
  • 13
  • 58
  • 82
6
votes
1 answer

boost graph library: deterministic order of iteration of in_edges?

TL;DR: I would very much like for the order of iteration of in_edges on my graph (adjacency_list with edge_list of setS) to be determinstic, but as far as I can tell, the order of iteration is determined by a comparison operator that is just…
David Alexander
  • 358
  • 1
  • 12
6
votes
1 answer

Boost::graph Dijkstra and custom objects and properties

I want to use boost's dijkstra algorithm (since I'm using boost in other parts of my program). The problem I'm having is adding custom objects (I believe they are referred to as property) to the adjacency_list. Essentially I have a custom edge…
lilott8
  • 1,116
  • 2
  • 17
  • 41
6
votes
2 answers

Boost Graph Library: Is there a neat algorithm built into BGL for community detection?

Anybody out there using BGL for large production servers? How many node does your network consist of? How do you handle community detection Does BGL have any cool ways to detect communities? Sometimes two communities might be linked together…
Setori
  • 10,326
  • 11
  • 40
  • 46
1 2
3
45 46