Skip to main content

Module islands

Module islands 

Source
Expand description

Simple interconnected islands random-graph generator (ALGO-GN-007).

Counterpart of igraph_simple_interconnected_islands_game() in references/igraph/src/games/islands.c:55-176.

§Model

Generates islands_n Erdős–Rényi G(n, p) “islands” each of size islands_size and probability islands_pin, then for every unordered pair of islands draws exactly n_inter bipartite edges uniformly at random from the islands_size × islands_size possible cross-island pairs. The resulting graph is always undirected and simple — within an island the geometric-skip walk produces strictly increasing pair-indices, and across islands the bipartite slice cannot collide with intra-island edges (the index spaces are disjoint by construction).

§Validation

  • islands_pin ∈ [0, 1]. NaN / non-finite rejected.
  • n_inter ≤ islands_size² (max-saturated bipartite slice).
  • islands_n · islands_size must fit in u32.

§Algorithm cost

Per island: Batagelj–Brandes geometric-skip is O(islands_size + |E_i|). Per inter-island pair: Floyd distinct-sample is O(n_inter) expected. Total: O(N + |E|) where N = islands_n · islands_size and |E| aggregates both intra- and inter-island edges.

§Determinism

Fully deterministic in (islands_n, islands_size, islands_pin, n_inter, seed) via SplitMix64.

Functions§

simple_interconnected_islands_game
Generate a random graph made of islands_n interconnected Erdős–Rényi islands.