javascript - 图的初始节点位置是否会影响 ForceAtlas2 算法中的渐近图配置?

标签 javascript algorithm graph

我正在尝试使用 sigma.js 可视化我的图形它提供了ForceAtlas2 algorithm plugin用于图形绘制。

我想知道节点的初始位置(x 和 y 坐标)是否会影响渐近结果图的布置。

我在使用这个算法插件时没有深入了解,所以我把有初始坐标的节点放在我自己的算法中粗略地绘制出我的目标图形形状的蓝图,然后让ForceAtlas2算法来调整并美化它。

如果图形的初始配置不影响 ForceAtlas2 生成的结果图形形状,那么我就不必为设置这些初始坐标进行不必要的计算。

最佳答案

是的 - 查看 the documentation :

The force-directed drawing has the specificity of placing each node depending on the other nodes. This process depends only on the connections between nodes. Eventual attributes of nodes are never taken into account. This strategy has its drawbacks. The result varies depending on the initial state. The process can get stuck in a local minimum. It is not deterministic, and the coordinates of each point do not reflect any specific variable. The result cannot be read as a Cartesian projection. The position of a node cannot be interpreted on its own, it has to be compared to the others.

举个例子,两个节点由一条边相连。 FA2会改变它们之间的距离,但不会影响边缘与水平面的 Angular ,所以这取决于初始值

举一个更有趣的例子,假设一个系统有五个节点,O、A、B、C 和 D,连接 O-A、O-B、O-C 和 O-D。一个渐近位置是 O 在原点,A、B、C 和 D 围绕它形成一个四 Angular 星。另一个将点按 B、A、C 和 D 的顺序排列。因此,结果同样取决于初始条件,但这次不能轻易转换。

关于javascript - 图的初始节点位置是否会影响 ForceAtlas2 算法中的渐近图配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30068291/

相关文章:

javascript - JavaScript 中用于 json post 的条件对象

javascript - ReactJS模块构建失败: SyntaxError: Unexpected token - ReactDOM.渲染

javascript - 将其正确放入方法中(TypeScript 新手)

performance - 使用回溯和分支定界的优势

algorithm - 寻找包含所有负循环的最小子图

algorithm - Dijkstra 与 Floyd-Warshall : Finding optimal route on all node pairs

javascript - 在 jquery 中使用 'this' 的 If 语句语法

java - 我如何在 J2ME 中拆分字符串?

java - 有没有办法让 Guice Grapher 工作?

graph - 查找所有 BFS/DFS 遍历