FunctionalBallDropping.DCHSBM_sampler
— MethodDCHSBM_sampler(Z, θ, kmax)
Create a hypergraph sampler whose probability distribution follows the specified degree corrected hyperstochastic block model.
Draw a hypergraph from the sampler with rand(sampler)
.
Arguments
Z::AbstractVector{<:Integer}
the group assignment of each nodeθ::AbstractVector{<:Real}
the degree correction weight of each node.kmax::Integer
is the largest possible hyperedge size the graph will generate
Z
and θ
must have the same length.
Runtime
This method: O(tensor_cells * kmax + nodes
) ≈ 400ns * tensor_cells * kmax + 30ns * nodes
Sampling: O(edges * kmax
) ≈ 150ns * edges * kmax + 1300ns * edges
FunctionalBallDropping.Kronecker_sampler
— MethodKronecker_sampler(initializer, power; T=Int, space=1)
Create an efficient edge sampler whose probability distribution follows the specified kroneker model.
Giving the sampler an adequite (but not excessive) amount of space may speed up generation by up to 2x. space = edge_count ÷ 100
may be a good heuristic. The sampler will take up O(sizeof(t)*ndims(initailizer)*space
) space with a constant factor around 4 bytes.
Draw a hypergraph from the sampler with rand(sampler, edges)
.
Base.rand
— Methodrand(s::DCHSBM_sampler[, edges::Integer])
Draw a hypergraph from the sampler s
with edges
edges
Base.rand
— Methodrand(s::Kronecker_sampler)
rand(s::Kronecker_sampler, e::Integer)
Draw an edge or a hypergraph with e
edges from the sampler s
.
FunctionalBallDropping.MEPS
— MethodMEPS(;generators, size=100_000, trials=5)
Generate graphs of given size
using each generator and report the number entries generated per second in millions (Millions of Entries Per Second)
The MEPS
function is user facing and not part of the public API subject to symver.
FunctionalBallDropping.er
— Methoder(n, m, k)
Sample a hypergraph with n
nodes and m
edges of edgesize ≤ k
from an extension of the Erdős-Rényi graph model to hypergraphs.
Edges are drawn with replacement and weighted according to the number of ways they can be represented as a list of k
nodes. For example, when k = 3
The edge joining nodes 1, 2, 3 has weight 6 with representations
[1, 2, 3]
[1, 3, 2]
[2, 1, 3]
[2, 3, 1]
[3, 1, 2]
[3, 2, 1]
The edge joining nodes 1 and 2 also has weight 6 with representations
[1, 1, 2]
[1, 2, 1]
[2, 1, 1]
[1, 2, 2]
[2, 1, 2]
[2, 2, 1]
While the edge containing only node 3 has weight 1 with the representation
[3, 3, 3]
FunctionalBallDropping.example
— Functionexample(Model, size)
generates an example graph using model Model
with hypergraphsize
of approximately size
.
The example
function is user facing and not part of the public API subject to symver.
Examples
example(DCHSBM_sampler, 100)
example(hyper_pa, 1_000_00)
example(Kronecker_sampler, 10)
example(Typing_sampler, 10_00)
example(er, 100_00)
FunctionalBallDropping.kronecker_power
— Methodkronecker_power(a, power)
returns a
kroneker producted with itself power
times. Does not copy when power == 1.
See also: kronecker_product
FunctionalBallDropping.kronecker_product
— Methodkronecker_product(a, b)
Returns a ⊗ b
, see: https://en.wikipedia.org/wiki/Kronecker_product.