来自 graphml 的荣格加权边

发布于 2024-10-31 06:07:06 字数 134 浏览 1 评论 0原文

我正在使用荣格2.0。我有一个带有加权边缘的 graphml 文件。我正在使用 graphml 阅读器来读取文件并创建图表。当我使用 FRLayout 可视化该图时,我发现该图没有反映与边相关的权重。我是否必须专门为边缘分配权重?如果是这样,我该怎么做?

I am using Jung 2.0. I have a graphml file with weighted edges. I am using a graphml reader to read the file and create the graph. When I visualize the graph with a FRLayout, I observe that the graph does not reflect the weights associated with the edges. Do I have to specifically assign the weights to the edges? If so, how do I do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

胡渣熟男 2024-11-07 06:07:06

FRLayout 实际上并不支持当前设计的边缘权重(请参阅文档)。

也就是说,适应起来并不困难,因此它将采用每条边的“拉伸”因子,该因子可能是边权重的函数,而不是所有边的单个值(这是目前所具有的)。

您还需要从 GraphMLReader 构建的元数据中提取权重,然后将其传递给(修订后的)FRLayout。 Graph 仅保存图拓扑;诸如标签、权重或其他元数据之类的任何内容都需要显式传递给想要使用它的东西。查看 Transformer 接口的使用。

如果您需要更多详细信息,请告诉我。

FRLayout doesn't actually work with edge weights as currently designed (see the documentation).

That said, it would not be difficult to adapt so that it would take a per-edge 'stretch' factor that could be a function of edge weight, rather than a single value for all edges (which is what it currently has).

You would also need to extract the weights from the metadata that GraphMLReader builds, and then pass that along to the (revised) FRLayout. The Graph holds only the graph topology; anything like labels or weights or other metadata needs to be explicitly passed to something that wants to work with it. Take a look for uses of the Transformer interface.

Let me know if you need more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文