Incorrect A* pathfinding with undirected graph
@bitwalker 已经在做这个了。
开始于 2017年12月2日。
评估
这个 Issue 还没有评估数据。
描述
Hi there, I am just getting started with libgraph but I have noticed that I seem to be getting wrong results for the a_star function.
What I am doing basically:
g = Graph.new(type: :undirected)
|> Graph.add_edges([{:dp1, :dp2, [weight: 3]}, {:dp2, :dp3, [weight: 6]}, {:dp3, :dp4, [weight: 5]}])
|> Graph.add_edges([{:dp4, :dp5, [weight: 4]}, {:dp4, :dp6, [weight: 5]}, {:dp5, :dp6, [weight: 6]}])
|> Graph.add_edges([{:dp6, :dp7, [weight: 5]}, {:dp7, :dp8, [weight: 4]}, {:dp8, :dp9, [weight: 2]}])
|> Graph.add_edges([{:dp9, :dp10, [weight: 6]}, {:dp3, :dp5, [weight: 3]}, {:dp5, :dp1, [weight: 7]}])
|> Graph.add_edges([{:dp6, :dp3, [weight: 7]}])
iex(1)> Graph.a_star(g, :dp1, :dp6, fn v -> 0 end)
The result I get is:
[:dp1, :dp2, :dp3, :dp4, :dp6]
However, the correct result would be:
[:dp1, :dp2, :dp3, :dp6]
Thanks in advance.
PS.: If you need a picture of the graph created above just ask.
- 主要语言
- Elixir
- 星标
- 571
- 派生
- 76
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bitwalker/libgraph 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
Failing tests未关闭
难度 3/5 1-2 天 新手友好度 35/100
-
Poor performance of Graph.delete_vertex/2 in large graphs可能已有人在做 @stevensonmt 于 640 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 25/100
查看 bitwalker/libgraph 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
electric-sql/electric#4830 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
难度 2/5 1-3 小时 新手友好度 76/100
dependabot/dependabot-core#16547 ·
维护者通常 1 天内回复
-
github_actions
难度 1/5 1 小时以内 新手友好度 94/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
team-alembic/clarity#146 ·