A Depth-first Algorithm to Reduce Graphs in Linear Time

A redex in a graph G is a triple r=(u,c,v) of distinct vertices that determine a 2-star. Shrinking r means deleting the center c and merging u with v intoone vertex. Reduction of G entails shrinking all of its redexes in a recursive way, and, at the same time, deleting all loops that are created during this process. It is shown that reduction can be implemented in O(m)time, where m is the number of edges in G.