Skip to contents

Reconstructs the gradient trajectory from a vertex to the extremum by following predecessor links backwards.

Usage

extract.gradient.trajectory(basin, vertex.id)

Arguments

basin

A single basin structure from basins.of.attraction object

vertex.id

Integer vertex identifier (1-based indexing)

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)
} # }