Releases · SMC17/zig-graph · GitHub
Skip to content

Releases: SMC17/zig-graph

zig-graph v1.2.0 — coverage-measured

Choose a tag to compare

@SMC17 SMC17 released this 18 May 21:48
v1.2.0
8363fb5

Adopts the zig-cobs v1.2.0 coverage-driver pattern. See CHANGELOG for the measured line-coverage number and methodology.

v1.1.0 — Full centrality / spectral / community / traversal API

Choose a tag to compare

@SMC17 SMC17 released this 14 May 02:51

The seven algorithms the original v0.1.0 README listed as out-of-scope are now all implemented.

Note on version chronology: v1.0.0 (also dated 2026-05-13) shipped earlier the same day as a hygiene-only milestone (CI / SECURITY / contributor docs / API freeze statement). This release is the first to ship the genuine algorithmic v1.0 content. Bumped to v1.1.0 to preserve the already-published v1.0.0 tag rather than rewrite history.

Added

  • betweennessCentrality — Brandes 2001 algorithm. BFS path for unweighted = true (O(V·E)); Dijkstra path otherwise. Optional [0, 1] normalisation.
  • closenessCentrality — Wasserman-Faust normalised closeness. Handles disconnected components.
  • fiedlerValue / fiedlerVector / fiedler — algebraic connectivity (second-smallest Laplacian eigenvalue) via deflated power iteration on M = τI − L with τ = 2·max_deg + 1. O(V + E) per iteration. Validated against closed-form λ₁ for Pₙ, Cₙ, K₁,ₙ₋₁, Kₙ, and a barbell reference.
  • louvain / modularity — Blondel et al. 2008 modularity-maximising community detection. Returns labels, community count, and Newman modularity Q.
  • directedPagerank — directed-edge PageRank respecting edge direction; sinks redistribute mass uniformly.
  • bfs / dfs / sssp / bfsPath — foundational traversal helpers.
  • buildAdjacency / buildDirectedAdjacency — CSR-style adjacency construction exposed as public API.

Changed

  • Test count: 16 → 50. Includes three new random-graph fuzz harnesses (betweenness non-negativity + upper bound; Fiedler spectral bound; Louvain modularity ∈ [-0.5, 1]).
  • Source factored into src/{traversal, centrality, spectral, community}.zig with src/root.zig as the re-export hub. Existing API preserved verbatim — purely additive.
  • Minimum Zig: 0.15.00.16.0.

Bench numbers (i7-1065G7 @ 1.30 GHz, busy laptop, ±2× variance)

Bench Size ms/run ops/sec
betweenness 100 nodes 3.9 257
betweenness 1 000 nodes 502 1
louvain 100 nodes 2.8 359
louvain 1 000 nodes 20 49
fiedler 100 nodes 8.1 123
fiedler 1 000 nodes 264 3
fiedler 10 000 nodes 1 366 0

Louvain modularity on 1k-node ER sparse graph: Q ≈ 0.33 across 16 communities. Fiedler λ₁ ≈ 0 on 10k-node disconnected ER graph (correct — k components → k zero eigenvalues).

Out of scope for this release

Honest list of what is not implemented: Leiden refinement, parallel-edge merging at construction time, hypergraphs, ILP-optimal community detection, CSR caching at the Graph level, GPU offload. Each is documented in the README with reasoning.

PRs welcome — the bar is "correctness against canonical small examples + invariant fuzz + benchmark on a medium graph".

v1.0.0 — Production-Grade Hygiene Milestone

Choose a tag to compare

@SMC17 SMC17 released this 14 May 02:02

v1.0.0 — 2026-05-13

Production-grade hygiene milestone.

  • LICENSE, README, CONTRIBUTING, SECURITY, CI all present.
  • Repo declared at v1.x milestone: existing surface stable; breaking changes bump to v2.x.
  • Engineering posture: Virgil work-in-progress convention adapted for OSS — v1.0 means we stand behind the existing surface; v1.x patches refine without breaking.

See CHANGELOG.md for full context.

zig-graph v0.1.0 — initial release

Choose a tag to compare

@SMC17 SMC17 released this 13 May 21:44

Initial release. See CHANGELOG.md for details. Cross-validated tests, CI, runnable example, MIT license. Minimum Zig: 0.16.0.