我有一个大的有向无环图,我想在位图图像中可视化。
理想情况下,我希望所有根节点都位于图像顶部,所有叶节点都位于底部,即图形边缘都指向向下。
是否有一种很好的算法可以计算出满足这些约束的所有节点的坐标并产生良好的可视化效果?
我有一个大的有向无环图,我想在位图图像中可视化。
理想情况下,我希望所有根节点都位于图像顶部,所有叶节点都位于底部,即图形边缘都指向向下。
是否有一种很好的算法可以计算出满足这些约束的所有节点的坐标并产生良好的可视化效果?
我建议你使用Gephi。
这个软件可以做你想做的所有事情,尤其是图形布局!
查看Graphviz软件集合。它包含几个渲染图形的程序。
最简单的方法是以 Graphviz 的一种文本格式将图形写入磁盘。然后执行其中一个渲染程序,并将生成的图像加载到您的应用程序中。
贝叶斯网络也有类似的要求。您可能会寻找贝叶斯网络的算法。 例如,这篇论文可能会有所帮助。
If the graph is fairly simply then bitmaps will serve you fairly well. For very dense graphs however you'll want something with vector graphics, such as a SVG file that will support zooming in and out of fine details in a more friendly manner. Better yet is to use an interactive tool dedicated to navigating a graph such as gephi like someone mentioned above or yED
If you're trying to visualize a software dependency graph the best tool I've found for navigating is the DGML tools that are part of Visual Studio. They use a very powerful Sugiyama tree layout that does a fine job of making the flow of the graph directional. They have powerful interactive features with these edge hopping links that are bar none. You can also organize subgraphs and collapse them down, etc.
There's several graph description languages covered in Wikipedia with checking out https://en.wikipedia.org/wiki/Category:Graph_description_languages. If you have a good chunk of RAM the DGML tools can render very pleasantly and make the interaction and exploration of the graph very intuitive.
There's a decent overview of layout techniques to be seen here particularly #2 Layered Graph Drawing from Kozo Sugiyama.
您可能对分层图形绘制(也称为“分层图形绘制”或“杉山式图形绘制”)感兴趣。该算法太长,无法在这里描述,但谷歌搜索带来了许多可靠的解释。
你可以试试我写的这个 Go 包:https ://github.com/h8liu/e8tools/tree/master/dagvis
一个例子: http: //lonnie.io/gostd/dagvis/