Algebraic graphs

Alga is a library for algebraic construction and manipulation of graphs in Haskell. See
this Haskell Symposium paper and the
corresponding talk for the motivation
behind the library, the underlying theory and implementation details. There is also a
Haskell eXchange talk,
and a tutorial by Alexandre Moine.

Main idea

Consider the following data type, which is defined in the top-level module
Algebra.Graph
of the library:

Alternatively, we can give an algebraic semantics to the above graph construction primitives by defining the following
type class and specifying a set of laws for its instances (see module Algebra.Graph.Class):

This algebraic structure corresponds to unlabelled directed graphs: every expression represents a graph, and every
graph can be represented by an expression. Other types of graphs (e.g. undirected) can be obtained by modifying the
above set of laws. Algebraic graphs provide a convenient, safe and powerful interface for working with graphs in Haskell,
and allow the application of equational reasoning for proving the correctness of graph algorithms.

Here e is the type of edge labels. If e is a monoid (<+>, zero) then graph overlay can be recovered
as Connect zero, and <+> corresponds to parallel composition of edge labels.

How fast is the library?

Alga can handle graphs comprising millions of vertices and billions of edges in a matter of seconds, which is fast
enough for many applications. We believe there is a lot of potential for improving the performance of the library, and
this is one of our top priorities. If you come across a performance issue when using the library, please let us know.

#136: Remove vertexIntSet from the API of basic graph data types. Also
remove Algebra.Graph.adjacencyMap and Algebra.Graph.adjacencyIntMap.
This functionality is still available from the type class ToGraph.

#79: Improve the API consistency: rename IntAdjacencyMap to AdjacencyIntMap,
and then rename the function that extracts its adjacency map to
adjacencyIntMap to avoid the clash with AdjacencyMap.adjacencyMap,
which has incompatible type.