Learn R Programming

QuACN (version 1.8.0)

distanceMatrix: Distance Matrix

Description

This method calculates the distance Matrix of a given graph.

Usage

distanceMatrix(g, keep.weights=FALSE)

Arguments

g
The graphNEL object for which the distance matrix will be calculated.
keep.weights
A flag indicating whether weights should be considered when performing the conversion (DEFAULT= FALSE). currently ignored, added for later development

Value

Details

This method returns the distance Matrix of a given graph. If the graph is weighted it will be treated as if it was an unweighted graph.

References

F. Harary, Graph Theory, Addison-Wesley series in mathematics, Perseus Books, 1994.

Examples

Run this code

library(RBGL)
set.seed(123)
g <- randomGraph(1:8, 1:5, 0.36, weights=FALSE)

distanceMatrix(g)

Run the code above in your browser using DataLab