【发布时间】:2016-11-01 06:38:43
【问题描述】:
我正在尝试使用 boost Kamada-Kawai-spring-layout 算法来布局图。问题是某些图中的顶点相互碰撞。我添加了权重为 1.0 的所有边
add_edge(a,b,1.0,g);
然后我像这样布局图表:
minstd_rand gen;
topology_type topo(gen,0,0,widht,height);
random_graph_layout(g,position,topo);
bool kamada=kamada_kawai_spring_layout(g,position,get(edge_weight,g),topo,side_length(width),kamada_kawai_done());
我认为布局很好,但边缘的长度需要增加,但我不知道如何
【问题讨论】:
-
缺少很多信息。什么是拓扑?你是如何渲染图表的?你有SSCCE吗?
-
谢谢我解决了问题
标签: c++ boost boost-graph graph-layout