March 13, 2026
Semirings: One Algorithm, Six Graph Problems
A semiring has two monoidal operations linked by distributivity. Matrix multiplication over different semirings gives shortest paths, longest paths, widest paths, reachability, and path counting, all from the same code.