From aa3d19767a280520bbc305fab7404867537efd8f Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Thu, 18 Jul 2024 09:13:44 +0200 Subject: [PATCH] A star weights warning (#392) --- src/shortestpaths/astar.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shortestpaths/astar.jl b/src/shortestpaths/astar.jl index c1c799a47..d42bd442c 100644 --- a/src/shortestpaths/astar.jl +++ b/src/shortestpaths/astar.jl @@ -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