MyNixOS website logo
Description

Generates Dense and Sparse Graphs using Graphon Extensions.

Generates dense or sparse graphs using graphon mixtures and graphettes. Graphon mixtures uses two graphons U and W to generate graphs. Sparse graphs are generated in this case using the inverse line graph (root) operation. Graphettes have 3 components, the graphon W, a real-valued sequence and a graph edit function. Both techniques can generate dense or sparse graphs. Kandanaarachchi and Ong (2026) <doi:10.48550/arXiv.2505.13864>, Wijesinghe et al (2026) <doi:10.48550/arXiv.2602.23566>.

graphonmix graphonmix website

R-CMD-check

The goal of graphonmix is to generate dense or sparse graphs via different techniques. We explore $(U,W)$-mixture graphs and graphettes. $(U,W)$-mixture graphs are generated from a standard dense graphon $W$ and a disjoint clique graphon $U$, which acts as the sparse graph generator. Graphettes are a triple consisting of a graphon $W$, a sparsifing sequence ${\rho_n}_n$ with $\rho_n \to 0$ and graph edit function $f$. $(U,W)$-mixture graphs are discussed in (Kandanaarachchi and Ong 2026) and graphettes are discussed in (Wijesinghe et al. 2026).

Installation

You can install the development version of graphonmix from GitHub with:

# install.packages("pak")
pak::pak("sevvandi/graphonmix")

$(U,W)$ Mixture Example

This is a basic example on how to sample a $(U,W)$-mixture graph.

library(graphonmix)
library(igraph)
#> 
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#> 
#>     decompose, spectrum
#> The following object is masked from 'package:base':
#> 
#>     union
# create the dense graphon W(x,y) = 0.1
W <- matrix(0.1, nrow = 100, ncol = 100)
# create the sparse part - a disjoint set of stars
wts <- c(0.5, 0.3, 0.2)
# single function to generate a graph mixture
gr1 <- sample_mixed_graph(W, wts, nd = 100, ns = 300, p = 0.5, option = 2)
plot(gr1,
     edge.curved = 0.3,
     vertex.size = degree(gr1)*0.1,
     edge.color = "lightgray",     # Light colored edges
     vertex.label = NA,
     vertex.color = "lightblue",
     main = "(U,W) Graph mixture"
)

Graphette example

This is an example with $\rho_n = 10/n$ and $f = \text{star_f1}$. The graph edit function $\text{star_f1}$ adds stars using a Poisson process.

rho <- function(n) 20/n
gr <- sample_graphette(W, 
                       rho_n = rho, 
                       graph_edit_f = 'star_f1',
                       n = 200,
                       t_or_p = 2)

plot(gr, vertex.label = NA, vertex.size = 3)

Acknowledgements

A big thank you to Sashenka Fernando for helping me with the hex sticker.

References

Kandanaarachchi, Sevvandi, and Cheng Soon Ong. 2026. “Graphon Mixtures.” AISTATS.

Wijesinghe, Asiri, Sevvandi Kandanaarachchi, Daniel M Steinberg, and Cheng Soon Ong. 2026. “Flowette: Flow Matching with Graphette Priors for Graph Generation.” arXiv Preprint arXiv:2602.23566.

Metadata

Version

0.1.1

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows