Questions tagged [boost-property-map]

32 questions
15
votes
1 answer

What is a property map in BOOST?

Can someone explain to a Boost beginner like me what is a property map is in Boost? I came across this when trying to use the BGL for calculating strong connected components. I went through the documentation for the property map and graph module and…
Matei Florescu
  • 1,155
  • 11
  • 23
7
votes
1 answer

Dijkstra graph with a table of weights on each edge

I have a boost graph with multiples weights for each edges (imagine one set of weights per hour of the day). Every one of those weights values is stored in a propretyEdge class : class propretyEdge { std::map weights; //…
Emmanuel Jay
  • 484
  • 3
  • 10
4
votes
1 answer

Weight map as function in Boost Graph Dijkstra algorithm

I'm using Boost Graph Libraries and need to use a weightmap which is not constant, but which is a function of a parameter K (i.e. the edge costs depend on K). In practice, given the following code: #include #include…
user1403546
  • 1,680
  • 4
  • 22
  • 43
4
votes
1 answer

BGL - BFS/DFS visitor, accessing vertex colours

In BGL, I can't quite figure out how to access the inherent colouring of the vertexes (white for untouched, grey for visited, black for finished) in a graph as they are visited during a bfs/dfs search. Could somebody illustrate how to access a…
User1291
  • 7,664
  • 8
  • 51
  • 108
3
votes
2 answers

External property map tied to std::vector in boost graph library

I am currently trying to define external properties of a boost graph. I use some bundled properties as internal ones: struct VertexProperties { int demand; }; struct EdgeProperties { uint capacity; int cost; }; typedef adjacency_list
Exp
  • 206
  • 2
  • 5
3
votes
1 answer

specializing boost::lexical_cast for enums in boost::property_maps

I am trying to use a boost::graph that has an enum inside its bundled vertex property. The problem starts when I try to use the bundled property for a boost::dynamic_property. Looks like I can't get the correct template specialization for…
Slizzered
  • 869
  • 2
  • 9
  • 23
3
votes
1 answer

Writing boost dynamic properties to a file using Boost Graph Library

I have already asked a question here about using Boost Graph Library and writing graph into file. Due to change in my requirements, I need to write dynamic graph properties into a DOT file. After some look up, I managed to come up with some code but…
soupso
  • 592
  • 1
  • 4
  • 20
3
votes
1 answer

How does the attractive force of Fruchterman Reingold work with Boost Graph Library

I am learning the Fruchterman-Reingold algorithm in Boost Graph Library. By reading the document, I know that the algorithm is to compute the positions for all nodes in terms of graph layout, but my problem is I cannot understand the calculation…
Ruofan Kong
  • 1,060
  • 1
  • 17
  • 34
3
votes
1 answer

Is it possible to have several edge weight property maps for one graph?

How would I create a graph, such that the property map (weight of edges) is different in each property map? Is it possible to create such a property map? Like an array of property maps? I have not seen anyone on the Internet using it, could I have…
LoveMeow
  • 3,858
  • 9
  • 44
  • 66
2
votes
1 answer

external properties of boost graph behaving weird?

I am doing my first steps with Boost::Graph and encountered some (to me) unexpected behavior. What I want is to have a series of edge_weight properties (the number is only known at runtime), and use the minimum of all weights that satisfy certain…
blubb
  • 9,510
  • 3
  • 40
  • 82
2
votes
1 answer

Using Boost, how can I put/get custom edge properties as a struct?

I've been over the documentation (https://www.boost.org/doc/libs/1_75_0/libs/graph/doc/using_adjacency_list.html) here and several stack overflow pages for two hours and am not making any forward progress here at all. I have a graph where edges have…
Joseph Schmidt
  • 119
  • 1
  • 10
2
votes
2 answers

How can I Iterate over Vertices & Edges in an Order Provided by a (Bundled) Property, in the BGL?

Say I have some boost graph #include struct Vertex { double property_1; int property_2; }; using Graph_t = boost::adjacency_list
gitchhiker
  • 161
  • 8
2
votes
1 answer

Unable to use integer edge weights with Kamada-Kawai layout

The question started here, but after all the updates it is already a different question with a different title. My Graph type is defined as follows: using Graph = boost::adjacency_list; where CostType…
AlwaysLearning
  • 7,257
  • 4
  • 33
  • 68
2
votes
1 answer

Accessing member function of std::shared_ptr in boost::graph?

I'm struggling transforming the usage of a boost::graph algorithm to a new set of implementation classes. I'm wondering: Is it even possible to access properties of an object, if the boost::graph only stores std::shared_ptr references? Like in the…
Hhut
  • 1,128
  • 1
  • 12
  • 24
2
votes
2 answers

boost A* visitor with a custom edge weight penalty?

I am playing with boost A* algorithm, started with the example found at: http://www.boost.org/doc/libs/1_37_0/libs/graph/example/astar-cities.cpp I see that you can override its heuristics and its visitor to have some sort of custom tweaks, just…
StormByte
  • 1,266
  • 1
  • 13
  • 33
1
2 3