Compute a distance matrix for all node pairs in a graph using cppRouting.
Arguments
- graph_df
A data frame representing a graph with columns:
from,to, andcost.- directed
Logical (default: FALSE). If TRUE, treats the graph as directed; if FALSE, treats it as undirected.
- cost.column
Character string (optional). Name of the cost column in
graph_df. Alternatively, a numeric vector of edge costs with length equal tonrow(graph_df).- ...
Additional arguments passed to
distances(), such asv(from) andtoto compute paths between specific nodes.
Value
A matrix of distances between all node pairs, where rows and columns
correspond to node IDs. The matrix contains the shortest path distances
(based on the cost column) between all pairs of nodes.
