grAlg

Classical Graph Algos in Nim

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT/ISC
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Installation

nimble install grAlg
choosenim install grAlg
git clone https://github.com/c-blake/gralg

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
grAlg - - - - - - -

Source

Repository https://github.com/c-blake/gralg
Homepage https://github.com/c-blake/gralg
Registry Source nimble_official

README

This is a small collection of classical graph algorithms on digraphs in Nim.

The core abstractions representing a graph are some kind of not necessarily dense integer-like address space, some nodes iterator on the graph and some edges(graph, node) iterator on the kids of a node/destinations of arcs.

It also contains (also at the top level) gaPrioQ.nim since the shortest path algorithm made famous by Dijkstra needs a priority queue that can efficiently edit entry priorities and std/heapqueue does not allow this.

https://github.com/c-blake/thes has demos/tests of most of these algorithms, but a quick list is: * arc/edge reversal * topological sorting/testing for DAG/cyclicity * transitive closure * shortest path from beginning to end via BFS * shortest path from beginning to end via Dijkstra * components when viewed as an undirected graph * min cost spanning tree of weighted, undirected graph

Should probably grow Max Flow, and weak strong components algorithms.