walk

Crates.iowalk
lib.rswalk
version0.1.0
created_at2026-01-18 16:32:11.599249+00
updated_at2026-01-18 16:32:11.599249+00
descriptionGraph random-walk family primitives: PageRank, Personalized PageRank, and random walk generation.
homepagehttps://github.com/arclabs561/walk
repositoryhttps://github.com/arclabs561/walk
max_upload_size
id2052624
size127,533
Henry Wallace (arclabs561)

documentation

https://docs.rs/walk

README

walk

Graph random-walk primitives:

  • Unbiased random walks
  • Node2Vec / Node2Vec-style biased walks (including precomputed alias tables)
  • PageRank and personalized PageRank

Determinism

Most APIs take a WalkConfig { seed, .. }. For fixed seed and identical inputs, walk generation is intended to be reproducible.

Graph interfaces

  • Graph: returns owned neighbor lists (Vec<usize>) per query (simple but allocates per step)
  • GraphRef: returns borrowed neighbor slices (&[usize]) per query (faster for walking)

Sampling integration

This crate uses kuji for reservoir sampling via sample_start_nodes_reservoir, which is useful when node_count is too large to materialize 0..node_count just to choose a subset of starts.

Examples

  • cargo run --example ppr_hard_pool: generate a seeded SBM graph, compute PPR from an anchor, then sample a stochastic top-(k) candidate pool using Gumbel-top-k on (\log(\mathrm{PPR})).
    • uses testdata/karate_club.edgelist by default (small real graph)
    • set WALK_DATASET=lesmis or WALK_DATASET=florentine for other bundled graphs
    • set WALK_EDGELIST=/path/to/edges.txt to run on your own graph

References (starting points)

  • Page et al. (1999): PageRank.
  • Grover & Leskovec (2016): Node2Vec.
  • Walker (1974) / Vose (1991): alias method for O(1) categorical sampling.
Commit count: 23

cargo fmt