Extract Gradient Trajectory from Basin
Source:R/gradient_basin_utilities.R
extract.gradient.trajectory.RdReconstructs the gradient trajectory from a vertex to the extremum by following predecessor links backwards.
Value
Integer vector representing the path from extremum to vertex.id, or NULL if vertex.id is not in the basin. The first element is the extremum, the last element is vertex.id.
Examples
if (FALSE) { # \dontrun{
basins <- compute.basins.of.attraction(adj.list, weight.list, y)
# Extract trajectory from minimum at vertex 5 to vertex 23
traj <- extract.gradient.trajectory(basins$lmin_basins[[1]], 23)
# traj might be: c(5, 7, 12, 18, 23)
} # }