pathlengths: Characteristic Path Lengths

pathlengthsR Documentation

Characteristic Path Lengths

Description

Computes global average shortest path length, local average shortest path length, eccentricity, and diameter of a network

Usage

pathlengths(A, weighted = FALSE)

Arguments

A

An adjacency matrix of network data

weighted

Is the network weighted? Defaults to FALSE. Set to TRUE for weighted measures

Details

Based on the MATLAB function charpath.m (Olaf Sporns and Mika Rubinov) in the Brain Connectivity Toolbox (Rubinov & Sporns, 2010).

Value

Returns a list containing:

ASPL

Global average shortest path length

ASPLi

Local average shortest path length

ecc

Eccentricity (i.e., maximal shortest path length between a node and any other node)

diameter

Diameter of the network (i.e., the maximum of eccentricity)

Author(s)

Alexander Christensen <alexpaulchristensen@gmail.com>

References

Rubinov, M., & Sporns, O. (2010). Complex network measures of brain connectivity: Uses and interpretations. NeuroImage, 52, 1059-1069.

Examples

# Pearson's correlation only for CRAN checks
A <- TMFG(neoOpen, normal = FALSE)$A

#Unweighted
PL <- pathlengths(A)

#Weighted
PL <- pathlengths(A, weighted = TRUE)


NetworkToolbox documentation built on Oct. 28, 2026, 5:06 p.m.