Skip to content

Commit

Permalink
Use array of concrete type in function a_star
Browse files Browse the repository at this point in the history
Previously the Array was of type `Integer`. Tests show a_star is
much faster after this commit.
  • Loading branch information
jlapeyre committed Oct 19, 2021
1 parent d2d6d29 commit 80ddf65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shortestpaths/astar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function a_star(g::AbstractGraph{U}, # the g
f_score = fill(Inf, nv(g))
f_score[s] = heuristic(s)

came_from = -ones(Integer, nv(g))
came_from = fill(-one(s), nv(g))
came_from[s] = s

a_star_impl!(g, t, open_set, closed_set, g_score, f_score, came_from, distmx, heuristic)
Expand Down

0 comments on commit 80ddf65

Please sign in to comment.