Learn R Programming

QuACN (version 1.8.0)

wiener: Wiener index

Description

This method calculates the Wiener index.

Usage

wiener(g, dist = NULL)

Arguments

g
a graph as a graphNEL object.
dist
the distance matrix of the graph. If the parameter is empty the distance matrix will be calculated within the function.

Value

References

H. Wiener, Structural Determination of Paraffin Boiling Points, Journal of the American Chemical Society, vol. 69, no. 1, pp. 17-20, Jan. 1947.

Examples

Run this code

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

wiener(g)

Run the code above in your browser using DataLab