shrink package:algebraic-graphs

Construct an acyclic graph from a given adjacency map using scc. If the graph is acyclic, it is returned as is. If the graph is cyclic, then a representative for every strongly connected component in its condensation graph is chosen and these representatives are used to build an acyclic graph.
shrink . vertex      == vertex
shrink . vertices    == vertices
shrink . fromAcyclic == id