Skip to content

Commit aa3d197

Browse files
authored
A star weights warning (#392)
1 parent f97b4af commit aa3d197

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/shortestpaths/astar.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ Return a vector of edges.
7070
- `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)).
7171
- `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!
7272
- `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`.
73+
74+
!!! warning
75+
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.
7376
"""
7477
function a_star(
7578
g::AbstractGraph{U}, # the g

0 commit comments

Comments
 (0)