get_degree_seq {multigraphr} | R Documentation |
Finds the degree sequence of the adjacency matrix of an observed graph or multigraph
get_degree_seq(adj, type = "multigraph")
adj |
matrix of integers representing graph adjacency matrix. |
type |
equals |
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.
Vector of integers representing the degree sequence of a (multi)graph.
Termeh Shafie
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.
# 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')