get_degree_seq {multigraphr}R Documentation

Degree sequence of a multigraph

Description

Finds the degree sequence of the adjacency matrix of an observed graph or multigraph

Usage

get_degree_seq(adj, type = "multigraph")

Arguments

adj

matrix of integers representing graph adjacency matrix.

type

equals 'graph' if adjacency matrix is for graphs (default), equals 'multigraph' if it is the equivalence of the adjacency matrix for multigraphs (with matrix diagonal representing edge loops double counted).

Details

Gives the degree sequence of the adjacency matrix of an observed graph or multigraph. Note that the matrix diagonal should be even if the matrix represents a multigraph.

Value

Vector of integers representing the degree sequence of a (multi)graph.

Author(s)

Termeh Shafie

References

Shafie, T. (2015). A Multigraph Approach to Social Network Analysis. Journal of Social Structure, 16.

Shafie, T. (2016). Analyzing Local and Global Properties of Multigraphs. The Journal of Mathematical Sociology, 40(4), 239-264.

#' Shafie, T., Schoch, D. (2021). Multiplexity analysis of networks using multigraph representations. Statistical Methods & Applications 30, 1425–1444.

Examples

 # Adjacency matrix for undirected network with 3 nodes
 A <-  matrix(c(0, 1, 2,
                1, 2, 1,
                2, 1, 2), nrow=3, ncol=3)

 # If A represents a graph
 get_degree_seq(adj = A, type = 'graph')

 # If A represents a multigraph
 get_degree_seq(adj = A, type = 'multigraph')

[Package multigraphr version 0.2.0 Index]