Boost graph with existing data structure or using it as the data structure

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 23:39:10
Tristram Gräbener

Nobody is intelligent enough for the boost::graph documentation ;) It takes a lot of time to learn how to use it.

You can créate a boost graph structure around your data, however, this will probably be rather painful. There is a documentation there : http://www.boost.org/doc/libs/1_52_0/libs/graph/doc/leda_conversion.html

I would suggest to go with the second approach, but I'm not sure to understand your data structure.

Did you see this question : adding custom vertices to a boost graph does it answers your needs ?

You can also do the following to create a node (or edge) and define the properties at once :

vertex_t u = boost::add_vertex(Block(42, "hi"), g);

You might need to maintain a map while parsing.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!