# Closure-sequence-lengths in graphs

There are three familiar operations on digraphs: symmetric closure, transitive closure, reflexive closure. If we call these $$S, T, R$$, then we can take sequences of them, computing things like $$TSTSR(G)$$, and the resulting graph may be different from $$G$$.

Inspired by this question, I'm wondering "For a fixed graph of $$n$$ nodes, if we consider all sequences of $$S,T,$$ and $$R$$ operations, of any finite length, we may get many distinct graphs. What is the largest number of distinct graphs that may arise? (possibly as a function of $$n$$)"

A weak upper bound one how many distinct graphs may arise from a starting graph $$G$$ is $$2^{n^2}$$, because that's the number of digraphs on $$n$$ nodes, but surely the number is far smaller. And $$R$$ is really just a red herring here, in the sense that once you apply $$R$$ once, it never has any further effect, so you can always "percolate" all the $$R$$s to the very end (or start) of the sequence, and if there are more than 1, you can replace with a single $$R$$.

Let's first focus on symmetric and transitive closures.

If we do some sequence of operations that contains a symmetric closure followed by a transitive closure, then every weakly connected component (other than an isolated vertex) will become a complete directed graph, with loops included. At that point, there's nothing more that can happen to the graph, because different weakly connected components never interact. So the possible distinct graphs we could get are:

• $$TS(G)$$, which gives us the result above, and
• $$G$$, $$S(G)$$, $$T(G)$$, $$ST(G)$$, which are the only combinations that don't contain the same operation twice in a row, and don't contain $$TS$$.

Also, $$R$$ commutes with both $$S$$ and $$T$$, so we might as well do it at the start if we do it at all. This gives us $$10$$ possibly-different combinations: $$G, S(G), T(G), ST(G), TS(G), R(G), SR(G), TR(G), STR(G), TSR(G).$$

For a graph where all $$10$$ of these are different, consider the $$5$$-vertex graph

$$a \gets b \to c \to d \phantom{{} \to {}} e$$

To check this efficiently, first check that doing a different subset of operations produces different results, because:

• Only the graphs with an $$R$$ operation contain the edge $$e \to e$$.
• Only the graphs with an $$S$$ operation contain the edge $$a \to b$$.
• Only the graphs with a $$T$$ operation contain the edge $$b \to d$$.

All that's left is to distinguish $$ST(G)$$ from $$TS(G)$$, and $$STR(G)$$ from $$TSR(G)$$, because the subset of operations done is the same in those cases. We have $$ST(G) \ne TS(G)$$ and $$STR(G) \ne TSR(G)$$ because $$ST(G)$$ and $$STR(G)$$ don't contain the edges $$a \to d$$ and $$d \to a$$, while $$TS(G)$$ and $$TSR(G)$$ do.

• Thanks, Misha. Now I can sleep tonight. :) – John Hughes Oct 20 at 22:13
• You mean only the graphs with an S operation contain a->b? – user253751 Oct 21 at 10:38
• @user253751 Yes, that, thank you. – Misha Lavrov Oct 21 at 14:05