0

I've been recently dealing with graph drawing with C++. My question is, how can I fix the final error:

 required from here
/usr/include/boost/graph/random_layout.hpp:30:8: error: ‘const class boost::random::linear_congruential_engine<unsigned int, 48271u, 0u, 2147483647u>’ has no member named ‘random_point’
     put(position_map, v, topology.random_point());
        ^

For this little code snippet:

  boost::minstd_rand gen;
  PositionVec position_vec(num_vertices(component));
  PositionMap position(position_vec.begin(), get(vertex_index, component));
  topology_type topo(gen, -width/2, -height/2, width/2, height/2);
  boost::random_graph_layout(component, position, gen);

What am I doing wrong here?

Thank you very much.

sdgaw erzswer
  • 2,182
  • 2
  • 26
  • 45

1 Answers1

1

According to reference

template<typename Graph, typename PositionMap, typename Topology>
void
random_graph_layout(const Graph& g, PositionMap position_map,
                const Topology& space);  // <---

you should pass as third parameter of random_graph_layout Topology object not generator.

So call

boost::random_graph_layout(component, position, topo);
rafix07
  • 20,001
  • 3
  • 20
  • 33