Learn R Programming

QuACN (version 1.8.0)

variableZagreb: Variable Zagreb index

Description

This method calculates the variable Zagreb index.

Usage

variableZagreb(g, deg = NULL)

Arguments

g
a graph as a graphNEL object.
deg
the degree of each node of g. Will be automatically calculated if not supplied.

Value

as a double-precision floating point value.

References

S. Nikolic and G. Kovacevic and A. Milicevic and N. Trinajstic: The Zagreb Indices 30 Years After. Croatica Chemica Acta, 76:113-124, 2003

Examples

Run this code

library(graph)
set.seed(123)
g <- randomEGraph(as.character(1:8), 0.6)

# optional: pre-calculate degree of nodes in g
vec.degree <- graph::degree(g)

variableZagreb(g, vec.degree)

Run the code above in your browser using DataLab