View source: R/sample_kcores.R
sample_coreseq | R Documentation |
Similar to sample_degseq just with coreness
sample_coreseq(cores)
cores |
coreness sequence |
The code is an adaption of the python code from https://github.com/ktvank/Random-Graphs-with-Prescribed-K-Core-Sequences/
igraph object of graph with the same coreness sequence as the input
David Schoch
Van Koevering, Katherine, Austin R. Benson, and Jon Kleinberg. 2021. ‘Random Graphs with Prescribed K-Core Sequences: A New Null Model for Network Analysis’. ArXiv:2102.12604. https://doi.org/10.1145/3442381.3450001.
library(igraph)
g1 <- make_graph("Zachary")
kcores1 <- coreness(g1)
g2 <- sample_coreseq(kcores1)
kcores2 <- coreness(g2)
# the sorted arrays are the same
all(sort(kcores1) == sort(kcores2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.