#include <boost/graph/graphviz.hpp>
#include <boost/graph/grid_graph.hpp>
typedef boost::grid_graph<2> Grid;
int main()
{
boost::array<std::size_t, 2> lengths = { { 3, 5 } };
Grid grid(lengths);
std::ofstream gout;
gout.open("test.dot");
boost::write_graphviz(gout, grid);
}
并得到这样的输出。
最佳答案
我认为您很乐意将dot
替换为neato
:
http://www.graphviz.org/category/graphviz-terms/neato
关于c++ - 如何使用Boost显示网格图?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37608482/