realize_bipartite_degseq | R Documentation |
Constructs a bipartite graph from the degree sequences of its partitions, if one exists. This function uses a Havel-Hakimi style construction algorithm.
realize_bipartite_degseq(
degrees1,
degrees2,
...,
allowed.edge.types = c("simple", "multiple"),
method = c("smallest", "largest", "index")
)
degrees1 |
The degrees of the first partition. |
degrees2 |
The degrees of the second partition. |
... |
These dots are for future extensions and must be empty. |
allowed.edge.types |
Character, specifies the types of allowed edges. “simple” allows simple graphs only (no multiple edges). “multiple” allows multiple edges. |
method |
Character, the method for generating the graph; see below. |
The ‘method’ argument controls in which order the vertices are selected during the course of the algorithm.
The “smallest” method selects the vertex with the smallest remaining degree, from either partition. The result is usually a graph with high negative degree assortativity. In the undirected case, this method is guaranteed to generate a connected graph, regardless of whether multi-edges are allowed, provided that a connected realization exists. This is the default method.
The “largest” method selects the vertex with the largest remaining degree. The result is usually a graph with high positive degree assortativity, and is often disconnected.
The “index” method selects the vertices in order of their index.
The new graph object.
igraph_realize_bipartite_degree_sequence()
.
realize_degseq()
to create a not necessarily bipartite graph.
g <- realize_bipartite_degseq(c(3, 3, 2, 1, 1), c(2, 2, 2, 2, 2))
degree(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.