使用斐波那契堆,是否可以/容易地表示邻居以及最小距离

发布于 2024-10-01 11:26:55 字数 125 浏览 2 评论 0原文

我正在尝试设计一个带有斐波那契堆的 dijkstras 实现。我想了解的是,除了 O(logn) (带删除)中的最小距离之外,是否可以表示任何给定节点的邻居?或者这违反了斐波那契堆结构?否则我将不得不建立一个邻居列表以及一个斐波那契堆。

I am trying to devise an implementation of dijkstras with fibonacci heaps. What I am trying to understand is if it is possible to represent, other than the minimum distance in O(logn) (with delete) but the neighbors of any given node? Or does this violate the fibonacci heap structure? Otherwise I would have to build a neighbor-list aswell as a fibonacci heap.

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

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

发布评论

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

评论(1

固执像三岁 2024-10-08 11:26:55

你似乎不明白斐波那契堆是什么!

该结构独立于 Dijkstra 或任何其他最短路径算法,并且仅用于通过加快获取距离最小的顶点的时间来加速 Dijkstra 算法。

谈论维护邻居的邻接列表作为斐波那契堆结构的一部分几乎是无稽之谈。

当然,您始终可以维护与该顶点对应的堆节点(从技术上讲,这不是堆结构的一部分)中每个顶点对应的邻居列表。

You don't seem to understand what fibonacci heaps are!

This sturcture is independent of Dijkstra or any other shortest path algorithm, and is only used to speed up Dijkstra's algorithm, by speeding up the time to get the vertex with smallest distance.

Talking about maintain the adjacency list of neighbours as part of the the fibonacci heap structure borders on nonsense.

Of course, you could always maintain the list of neighbours corresponding to each vertex in the heap node (which is technically, not part of the heap structure) corresponding to that vertex..

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