geodesic.mat {ElectroGraph}R Documentation

geodesic.mat

Description

Given a sociomatrix corresponding to social distance, calculate the minimum distance between any two points using the Floyd-Warshall Algorithm.

Usage

geodesic.mat(sociomatrix)

Arguments

sociomatrix An n-by-n sociomatrix corresponding to tie strength (or inverse distance).

Value

An n-by-n matrix; cell (i,j) contains the shortest distance from point i to point j.

Note

This function is automatically executed by the electrograph() initialization routine.

Author(s)

Andrew C. Thomas <act@acthomas.ca>

Examples


latt <- cbind(rep(1:5,5),sort(rep(1:5,5)))
latt.mat <- make.sociomatrix.from.lattice(latt)$sociomatrix
latt.geo <- geodesic.mat(latt.mat)


[Package ElectroGraph version 0.2.0 Index]