weight_distribution: Weight Distribution of a Graph

View source: R/graphs.R

weight_distributionR Documentation

Weight Distribution of a Graph

Description

Obtain the weight distribution of a graph, indicating for each strength from zero to the maximum strength of any vertex, the proportion of vertices with such a strength. This assumes positive integer weights.

Usage

weight_distribution(g, cumulative = FALSE, ...)

Arguments

g

the graph (an igraph object)

cumulative

TRUE if cumulative weights are to be used; default is FALSE

...

additional parameters to be passed to the igraph function strength

Value

A vector with the weighted degree distribution for the graph g.

Examples

g=igraph::graph_from_literal(1-2,2-3:4,3-4:5:6,5-1)
igraph::E(g)$weight=c(1,2,1,4,2,1,1)
table(igraph::strength(g))/6
weight_distribution(g)

smallstuff documentation built on June 2, 2022, 5:06 p.m.