Skip to content

Commit

Permalink
A star weights warning (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle authored Jul 18, 2024
1 parent f97b4af commit aa3d197
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shortestpaths/astar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Return a vector of edges.
- `distmx::AbstractMatrix`: an optional (possibly sparse) `n × n` matrix of edge weights. It is set to `weights(g)` by default (which itself falls back on [`Graphs.DefaultDistance`](@ref)).
- `heuristic`: an optional function mapping each vertex to a lower estimate of the remaining distance from `v` to `t`. It is set to `v -> 0` by default (which corresponds to Dijkstra's algorithm). Note that the heuristic values should have the same type as the edge weights!
- `edgetype_to_return::Type{E}`: the type `E<:AbstractEdge` of the edges in the return vector. It is set to `edgetype(g)` by default. Note that the two-argument constructor `E(u, v)` must be defined, even for weighted edges: if it isn't, consider using `E = Graphs.SimpleEdge`.
!!! warning
Since a two-argument edge constructor `E(u, v)` is used to construct the path, metadata associated with the edge (like its weight) will be lost in the result. You might need to code a post-processing step yourself.
"""
function a_star(
g::AbstractGraph{U}, # the g
Expand Down

0 comments on commit aa3d197

Please sign in to comment.