在图形边缘交叉减少图形、边缘

2023-09-11 04:00:11 作者:靓仔准备就绪

我想问你,如果有任何的算法是如何最大限度地减少在图边交叉,例如,如果我有图的转换矩阵。

I'd like to ask you if there are any algorithms how to minimize edge crossings in graph, for example if I have a transition matrix of the graph.

我找到方法就像试图把周围的其他节点的节点,但我想知道一些其他的想法。谢谢你。

I found methods like trying to place the nodes around the other node, but I'd like to know some other ideas. Thanks.

推荐答案

有一系列完善的算法/库已开发绘制图形的应用程序,你可以得到一点背景的这里。

There's a range of well established algorithms/libraries that have been developed for graph drawing applications, you can get a bit of background here.

要绘制无向图的一个流行的选择是基于力的布局算法,在图形的边缘被视为弹簧(吸引力),而顶点被视为带电粒子(应用排斥力)。该算法的工作通过更新基于这些力的顶点位置,直到稳态为止。你可以在这里阅读更多关于力为基础的方法。由于这些算法寻找一个平衡的解决方案往往容易造成伪优化布局,没有太多的优势纠缠。

To draw undirected graphs a popular choice is the force-based layout algorithm, in which graph edges are treated as springs (attractive forces) while the vertices are treated like charged particles (applying repulsive forces). The algorithm works by updating the vertex positions based on these forces until a steady-state is reached. You can read more about force based methods here. Since these algorithms search for an equilibrium solution they often result in pseudo-optimal layouts, without much edge tangling.

您可能会感兴趣的利用了许多图形绘制库可用之一。该的Graphviz 包一般是pretty的好,支持多种不同的算法对不同的图形绘制的应用程序。

You might be interested in making use of one of the many graph drawing libraries that are available. The Graphviz package is generally pretty good and supports a number of different algorithms for different graph drawing applications.