There’s another more compact way to describe a graph. One of the most exciting graph packages that can simplify everything is Alga and its ports (available in Typescript, F#, Haskell, Scala, and probably more in the future). The core idea behind this is to express a graph with algebraic rules, not a listing of all edges.

There are two key operations: