Skip to main content

hypergraph_random_walk

Function hypergraph_random_walk 

Source
pub fn hypergraph_random_walk<R: Rng>(
    hg: &IndexedHypergraph,
    start: usize,
    n_steps: usize,
    rng: &mut R,
) -> Result<Vec<usize>>
Expand description

Perform a random walk on an IndexedHypergraph.

At each step the walker at node v:

  1. Selects a hyperedge e containing v with probability ∝ w_e / deg_w(v).
  2. Moves uniformly to one of the other nodes in e (stays if singleton).

Returns the visited node sequence of length n_steps + 1.