boost-graph

Forming reference to void when getting property map from a bundled property

浪尽此生 提交于 2019-12-02 10:36:49
My Graph type is defined as follows: using Graph = boost::adjacency_list<vecS, setS, directedS, State, CostType>; where CostType happens to be int . I am trying to obtain the Kamada-Kawai spring layout as follows: template <class PointMap> PointMap layout() const { PointMap res; boost::associative_property_map<PointMap> temp(res); circle_graph_layout(g_, temp, 10.0); // http://www.boost.org/doc/libs/1_59_0/libs/graph/doc/bundles.html bool ok = kamada_kawai_spring_layout( g_, temp, get(edge_bundle, g_), square_topology<>(50.0), side_length(50.0)); (void)ok; //boost::BOOST_CHECK(ok); return res;

How to use boost::graph dijkstra's algorithm if vertex properties are pointers?

别说谁变了你拦得住时间么 提交于 2019-12-02 09:53:05
问题 I use boost graph to manage graphs and I need to make a maxmin tree. Now I'm trying to use boost dijkstra's algorithm, but I use a pointer to my class as a vertex property instead of using typedef property<vertex_index_t, int> my_prop , and I can't change it now. So how can I create predecessor_map and distance_map for my graph? My code looks like this (and these predecessor and distance maps don't work): struct LinkStruct {...}; class Node {...}; typedef Node* NodePtr; typedef adjacency_list

Recording predecessors in a DFS search in an undirected graph

寵の児 提交于 2019-12-02 08:26:29
I was trying to use the code from this thread: Boost DFS back_edge , to record the cycles in an undirected graph. To do this I need to store the predecessors for each dfs tree when it finds a back_edge. Since this is an undirected graph I think we can not use directly on_back_edge() from EventVisitor Concept . So I was thinking to record the predecessors in the void back_edge() method of below code. But I am not sure how to do this and return the cycle vertices. Here is the code and the part I added for recording predecessors: #include <boost/config.hpp> #include <boost/graph/adjacency_list

boost::associative_property_map() compile error

 ̄綄美尐妖づ 提交于 2019-12-02 08:17:19
using this link on boost website, I am able to compile the code here . and even get the answer (example). But when I do the same by defining in a class, I get the error as follows: #include < as usual in the code > class Test{ std::map<std::string, std::string> name2address; boost::const_associative_property_map< std::map<std::string, std::string> > address_map(name2address); }; error is as follows: error: ‘name2address’ is not a type I have to use typedef and typename as follows to compile the code correctly. but I am still unable to use (insert, or the foo function (as provided in example)

Error in building boost MPI in msvc 2010

ぐ巨炮叔叔 提交于 2019-12-02 07:23:42
问题 I have installed openmpi in C:\Program Files\OpenMPI_v1.5.4-win32\ and want to compile boost to produce graph-parallel library. But got the following error: The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. MPI auto-detection failed: unknown wrapper compiler C:/Program Files/OpenMPI_v1. 5.4-win32/bin/mpic++.exe Please report this error to the Boost mailing list: http://www

Make a boost filtered_graph by vertex label property

巧了我就是萌 提交于 2019-12-02 07:04:38
问题 Currently, I have a graph, that I keep tracking of vertices and labels by means of an external map . So anytime I need to access the label property, I find the label in the map and get the mapped vertex . /// vertex properties struct VertexData { std::string label; int num; }; /// edges properties struct EdgeData { std::string edge_name; double edge_confidence; }; /// define the boost-graph typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost:

Make a boost filtered_graph by vertex label property

流过昼夜 提交于 2019-12-02 07:01:50
Currently, I have a graph, that I keep tracking of vertices and labels by means of an external map . So anytime I need to access the label property, I find the label in the map and get the mapped vertex . /// vertex properties struct VertexData { std::string label; int num; }; /// edges properties struct EdgeData { std::string edge_name; double edge_confidence; }; /// define the boost-graph typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost::edge_index_t , size_t , VertexData>, boost::property<boost::edge_weight_t, double, EdgeData> > Graph; //

Error in building boost MPI in msvc 2010

北城余情 提交于 2019-12-02 06:47:33
I have installed openmpi in C:\Program Files\OpenMPI_v1.5.4-win32\ and want to compile boost to produce graph-parallel library. But got the following error: The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. The system cannot find the path specified. MPI auto-detection failed: unknown wrapper compiler C:/Program Files/OpenMPI_v1. 5.4-win32/bin/mpic++.exe Please report this error to the Boost mailing list: http://www.boost.org You will need to manually configure MPI support. MPI launcher: mpirun -np when I ran in a

adjacency_list with VertexList different from vecS

ぃ、小莉子 提交于 2019-12-02 03:14:24
问题 I have two structs containing some fields: struct MyNodeData, and struct MyEdgeData. When I create a graph with VertexList as vecS, there is no problem to access the descriptor of vertices etc. For example: typedef adjacency_list<setS, vecS, undirectedS, MyNodeData, MyEdgeData> Graph; typedef Graph::vertex_descriptor MyNodeDataID; typedef Graph::edge_descriptor MyEdgeDataID; typedef graph_traits < Graph >::vertex_iterator VertexIterator; typedef graph_traits < Graph >::edge_iterator

Overloading streaming operators for a Boost Graph bundle output for GraphViz

回眸只為那壹抹淺笑 提交于 2019-12-02 02:49:43
问题 Is it possible to use bundled properties in the Boost Graph Library, with a standard library type, while also using that type's overload of the << stream operator to satisfy write_graphviz ? #include <boost/graph/graphviz.hpp> namespace boost { namespace detail { namespace has_left_shift_impl { template <typename T> inline std::ostream &operator<<(std::ostream &o, const std::array<T,2> &a) { o << a[0] << ',' << a[1]; return o; } } } } static_assert(boost::has_left_shift< std::basic_ostream