Associative spectra of graph algebras II. Satisfaction of bracketing identities, spectrum dichotomy

A necessary and sufficient condition is presented for a graph algebra to satisfy a bracketing identity. The associative spectrum of an arbitrary graph algebra is shown to be either constant or exponentially growing.


Introduction to Part II
This paper continues our study, initiated in [2], of associative spectra of graph algebras. Introduced by Csákány and Waldhauser [1], the associative spectrum of a binary operation or of the corresponding groupoid is a method of quantifying the degree of (non)-associativity of the operation. Graph algebras were introduced by Shallon [4] as a way of encoding an arbitrary directed graph as an algebra with a binary operation. We refer the reader to the first part of this study [2] -henceforth called "Part I" -for formal definitions, background, motivations, and further details that will not be repeated in this outline. We continue the numbering of sections from Part I, so that we can conveniently refer to theorems, definitions, etc. of Part I simply by their numbers.
In Part I, we determined the possible associative spectra of undirected graphs and classified undirected graphs by their spectra; there are only three distinct possibilities: constant 1, powers of 2, and Catalan numbers. Furthermore, we characterized the antiassociative digraphs, and we determined the associative spectra of certain families of digraphs, such as paths, cycles, and graphs on two vertices.
In this paper, we turn our attention to graph algebras associated with arbitrary digraphs, which may be finite or infinite. In Section 7, we provide a necessary and sufficient condition for a graph algebra to satisfy a nontrivial bracketing identity. The condition is expressed in terms of several numerical structural parameters associated, on the one hand, with the digraph and, on the other hand, with a pair of bracketings. We discuss in Section 8 how some of the results of Part I are obtained as special cases of this condition.
This result seems a first step towards a general description of the associative spectra of graph algebras associated with arbitrary digraphs. Such a general result, however, eludes us. We can nevertheless establish bounds for the possible associative spectra of graph algebras. As we will see in Section 9, the associative spectrum of a graph algebra is either a constant sequence bounded above by 2 or it grows exponentially, the least possible growth rate of an exponential spectrum being α n , where α ≈ 1.755 is the following cubic algebraic integer: 14 ω t,t ′ 7.20 B G 7.17 λ t,t ′ 7.25 ω G 7.22 λ G 7.27 Table 1. Parameters of pairs of bracketings and graphs.
This stands in stark contrast with associative spectra of arbitrary groupoids, where various subexponential spectra such as polynomials of arbitrary degrees are possible.

Satisfaction of bracketing identities by digraphs
We now turn to the general case of arbitrary directed graphs. We are going to define several numerical parameters pertaining, on the one hand, to a pair of distinct bracketing terms t, t ′ ∈ B n and, on the other hand, to a digraph G. For easy reference, the various parameters are collected in Table 1 with cross-references to their definitions. With the help of these parameters, we can provide necessary and sufficient conditions for the graph algebra of a digraph to satisfy a bracketing identity. These conditions are put together in Theorem 7.31.
Recall the parameters H t,t ′ , M t,t ′ , and L t,t ′ from Definition 4.2. The following lemma extends Lemma 4.4.
Lemma 7.1. Let t, t ′ ∈ B n , t = t ′ , and let G be a digraph such that A(G) satisfies the identity t ≈ t ′ . Denote H := H t,t ′ , M := M t,t ′ , L := L t,t ′ . Let r be the integer provided by Lemma 4.4. Then there exists an integer s with L + 1 ≤ s ≤ r and s ≡ L (mod M ) such that the following holds: and v ′ s → v L+1 are edges in G. In particular, v L+1 and v ′ L+1 belong to the same nontrivial strongly connected component.
Proof. By the definition of L, there exists a vertex x d ∈ X n such that either d T (x d ) = L + 1 < d T ′ (x d ) or d T ′ (x d ) = L + 1 < d T (x d ). By changing the roles of T and T ′ , if necessary, we may assume that d T (x d ) = L + 1 < d T ′ (x d ). Let x p be the parent of x d in T , and let x q be the parent of x d in T ′ . Assume are closed walks in G. Let W be the walk that starts with v 0 → · · · → v L and continues by going around the closed walk v L+1 → · · · → v r → v L+1 until it reaches length h(T ), and let W ′ be the closed walk v ′ L+1 → · · · → v ′ r → v ′ L+1 . Let ϕ : X n → V (G) be the collapsing map of (T, x d ) on (W, W ′ ). Since ϕ is a homomorphism of T into G, it is also a homomorphism of T ′ into G by Proposition 2.1.
This means, in particular, that v L+1 and v ′ L+1 belong to the same nontrivial strongly connected component.
Definition 7.2. For a digraph G, let M G be the least common multiple of the set of all numbers m for which there exists a strongly connected component of G that is an m-whirl, with the convention that the least common multiple of the empty set is 1. If there is no finite upper bound on such numbers m, then define M G := ∞.
Example 7.3. Consider the graph G shown in Figure 1. Highlighted as shaded regions, the nontrivial strongly connected components are a 3-whirl and a 4-whirl. Consequently, M G = lcm(3, 4) = 12.
Definition 7.4. Let G = (V, E) be a digraph. Recall that a walk in G is pleasant, if all its vertices belong to trivial strongly connected components. A walk in G is winding, if all its vertices belong to a single nontrivial strongly connected component of G.
Denote by P G , E G and O G the length of the longest pleasant path, entryway, and outlet in G, respectively. If there is no finite upper bound on the length of pleasant paths, entryways, or outlets in G, then define P G := ∞, E G := ∞, O G := ∞, respectively. If there is no pleasant path, entryway, or outlet in G, then let Example 7.5. In the graph G of Figure 1, the longest pleasant path is p 0 → p 1 → · · · → p 9 , the longest entryway is e 0 → e 1 → e 2 → e 3 → e 4 , and the longest outlet Lemma 7.6. If a digraph G satisfies the identity t ≈ t ′ for t, t ′ ∈ B n , t = t ′ , then M G | M t,t ′ and P G < H t,t ′ .
Proof. This follows immediately from Lemmata 4.8 and 4.11.
Lemma 7.7. Let t, t ′ ∈ B n , t = t ′ , and let G be a digraph such A(G) satisfies the identity t ≈ t ′ . Then E G ≤ L t,t ′ + 1.
Proof. Denote H := H t,t ′ , L := L t,t ′ . Suppose, to the contrary, that there is an entryway W : v 0 → v 1 → · · · → v k , where k > L + 1. Then v k belongs to a nontrivial strongly connected component K and the other vertices of W belong to trivial strongly connected components. Extending W , if necessary, with vertices of K, we obtain a walk v 0 → v 1 → · · · → v H , and Lemma 4.4 implies that v L+1 belongs to a nontrivial strongly connected component. This is a contradiction.
In other words, the rooted induced subtrees of T and T ′ of height at most Y t,t ′ are identical. Note that −1 ≤ Y t,t ′ < H t,t ′ , and the equality Y t,t ′ = −1 holds if and only if T and T ′ have different sets of leaves.
Example 7.9. Figure 2 shows two DFS trees corresponding to certain terms t, t ′ ∈ B 14 . It is easy to verify that Y t,t ′ = 3: all subtrees of height at most 3 are identical in the two trees, but the subtrees rooted at x 3 are distinct and have height 4.
Lemma 7.10. Let t, t ′ ∈ B n , t = t ′ , and let G be a digraph such that A(G) satisfies . We may assume, by changing the roles of t and t ′ if necessary, that h(T . An easy inductive argument shows that . Suppose, to the contrary, that G has an outlet W : v 0 → v 1 → · · · → v k with k > Y + 1. Then v 0 belongs to a nontrivial strongly connected component K and the remaining vertices of W belong to trivial strongly connected components. In particular, there exists a cycle C in K to which v 0 belongs.
Consider first the case when e < e ′ . Let W ′ : v 1 → · · · → v k , let x p be the parent of x d in T , and let ϕ : X n → V (G) be the collapsing map of (T, Since ϕ(x d ) = v 1 and ϕ(x e+1 ) belongs to C, this implies that v 1 belongs to the strongly connected component K, a contradiction.
The case when e > e ′ is treated similarly. Let W ′ : v 1 → · · · → v k , let x p ′ be the parent of x d in T ′ , and let ϕ : X n → V (G) be the collapsing map of (T ′ , x d ) on A similar argument as above now shows that (ϕ(x d ), ϕ(x e ′ +1 )) ∈ E(G), which implies that v 1 belongs to the strongly connected component K, a contradiction.
Definition 7.11. Let t, t ′ ∈ B n , t = t ′ , and denote T := G(t), T ′ := G(t ′ ). Let Z t,t ′ be the smallest nonnegative number m such that there exists x i ∈ X n with T xi = T ′ xi , h(T xi ) = h(T ′ xi ) = m, and x i has distinct parents in T and T ′ . Such a number m always exists (see Lemma 7.13 below) and it must clearly be smaller than the heights of T and T ′ . Hence 0 ≤ Z t,t ′ < H t,t ′ .
Example 7.12. For the DFS trees of Figure 2, it holds that Z t,t ′ = 2, as witnessed by the subtrees rooted at x 11 . The next lemma shows that the parameter Z t,t ′ is well defined: for distinct DFS trees T and T ′ of size n, there always exists a vertex x i ∈ X n such that T xi = T ′ xi and x i has distinct parents in T and T ′ .
Lemma 7.13. Let T and T ′ be DFS trees of size n. Assume that for all x i ∈ X n \ {x 1 }, it holds that if T xi = T ′ xi then x i has the same parent in T and in T ′ . Then T = T ′ .
Proof. We proceed by induction on n. The statement obviously holds for n = 1 and n = 2. Assume that the statement holds for all DFS trees of size k. Let T and T ′ be DFS trees of size k + 1 satisfying the condition that for all xi then x i has the same parent in T and T ′ .
Since x k+1 is a leaf in both T and T ′ , we have T x k+1 = T ′ x k+1 ; hence x k+1 has the same parent in T and T ′ , say x p . Consider T : Clearly T and T ′ are DFS trees of size k, and T = T + (x p , x k+1 ) and T ′ = T ′ + (x p , x k+1 ) (where the notation T + (x p , x k+1 ) stands for adjoining a new vertex x k+1 and a new edge (x p , x k+1 ) to T ). Let x i ∈ X k and assume that In either case, our assumption on T and T ′ implies that x i has the same parent in T and T ′ and hence also in T and T ′ . Consequently, T and T ′ satisfy the condition of the inductive hypothesis, Definition 7.14. For a digraph G, let Z G be the largest nonnegative integer m such that there exist a strongly connected component K of G that is a whirl, a block B of K, vertices u, w ∈ B and a walk u Example 7.15. In the graph G of Figure 1, vertices u and w belong to the same block of a whirl. The path u → z 0 → z 1 and the non-edge (w, z 0 ) witness that Z G = 1.
Lemma 7.16. Let t, t ′ ∈ B n , t = t ′ , and let G be a digraph such that A(G) satisfies the identity t ≈ t ′ . Assume that u and w are vertices belonging to the same block of a nontrivial strongly connected component.
Proof. Denote M := M t,t ′ , Z := Z t,t ′ . By Lemma 4.8, the strongly connected component K containing u and w is an m-whirl for some divisor m of M ; let B a be the block containing u and w. By the definition of Z, there exists be the collapsing map of (T, x d ) on (C, W ) with ϕ(x p ) = u (also ϕ(x q ) = u). Let ψ : X n → V (G) be the map that coincides with ϕ everywhere except at x q and satisfies ψ(x q ) = w. Moreover, since T x d = T ′ x d , the vertex x q lies outside of T x d and so do its children in T (because x d is not a child of x q in T ) and its parent in T (because if the parent of x q lay in T x d , then so would x q , as T x d is closed under descendants). Therefore the images of these vertices under ϕ lie in K (actually in C). Since u and w belong to the same block B a , the inneighbours (outneighbours, resp.) of u and w within K are the same. Consequently, ψ is a homomorphism of T into G, so, by Example 7.18. In the graph G of Figure 1 and v ′ L+1 belong to nontrivial strongly connected components K and K ′ , respectively, then K = K ′ . Consequently, Proof. Denote H := H t,t ′ , L := L t,t ′ . Using the given walks and vertices of K and K ′ , we can build Moreover, ω t,t ′ is a nonincreasing function, and we may specify ω t,t ′ by writing down the first few values of ω t,t ′ until ξ t,t ′ is reached.
Example 7.23. It is not difficult to verify that for the graph G of Figure 1, the parameter ω G (ℓ, r) has the value presented in the table in Figure 1. For the values not shown in the table, that is, for ℓ, r ∈ N such that ℓ ≥ 6 and ℓ ≥ r ≥ 1, it holds that ω G (ℓ, r) = ℓ + 2.
Let B a be the block of K containing v L+1 , and let B a−1 be the predecessor block of B a .
If ω(r) ≥ H, then the claim follows immediately from Lemma 4.4. We can thus assume that ω(r) < H. By the definition of ω(r) and Ω t,t ′ , there exists a vertex . We may assume, by changing the roles of t and t ′ if necessary, that We are going to make use of the homomorphism ϕ : T → G that is defined as follows. Fix an m-cycle C in K that contains the vertex v L+1 , and let W be a walk that starts We will consider several cases and subcases.
Case 1: i.e., e < e ′ . Then necessarily r = d T (x d ) = L + 1 and with vertices of K so that we obtain a walk of length H, and Lemma 4.4 implies that v ′ L+1 belongs to a nontrivial strongly connected component, in fact, to K by Lemma 4.9.
Case 2: is a closed walk in G. It then follows easily from Lemma 4.4 that v ′ L+1 belongs to a nontrivial strongly connected component.
We consider separately these two cases.
, then we can repeat the above argument with the roles of t and t ′ switched, and we will reach Case 1 and we are done. We can now assume that Observe that now the roles of t and t ′ are symmetric; we would reach this point in the argument even if t and t ′ were switched, and we may swap them if necessary. Since ; assume that the index q is the smallest possible. Swapping the roles of t and t ′ , if necessary, we may assume that dq is a closed walk in G. It then follows easily from Lemma 4.4 that v ′ L+1 belongs to a nontrivial strongly connected component.
. Define homomorphisms ψ : T → G and ψ ′ : T ′ → G as follows. Let ψ be the collapsing map of (T, x d ) on (C, W ′ ) that maps the parent of x d in T to w, and let ψ ′ be the collapsing map of (T ′ , x d ) on (C, W ′ ) that maps the parent of x d in T ′ to w.
Recall that we are assuming that , then using a similar argument as in Case 1 with the homomorphism ψ ′ in place of ϕ, we can find an edge from W ′ to K, from which it follows that v ′ L+1 belongs to a nontrivial strongly connected component. We can thus assume , then using a similar argument as in Case 2.1 with the homomorphism ψ ′ in place of ϕ, we can find a closed walk in W ′ , from which it follows that v ′ L+1 belongs to a nontrivial strongly connected component. We can thus assume that h(T x d ) = h(T ′ x d ). Now, using a similar argument as in Case 2.2.1 with the homomorphism ψ or ψ ′ in place of ϕ, we can find a closed Figure 4. Illustration for Lemma 7.29.
walk in W ′ , from which it again follows that v ′ L+1 belongs to a nontrivial strongly connected component.
Example 7.26. For the DFS trees of Figure 3, it holds that Definition 7.27. Let G be a digraph. Let λ G be the largest integer m such that there exist an entryway u 0 → u 1 → · · · → u EG (of maximal length E G ) to a nontrivial strongly connected component K, a vertex w in K with w → u EG and a walk v 0 → v 1 → · · · → v m such that exactly one of the pairs (w, v 0 ) and (u EG−1 , v 0 ) is an edge and the other is not. If there is no upper bound for such numbers m, then define λ G := ∞. If no such number m exists (this holds in particular when E G ≤ 0), then define λ G := −∞.
Proof. Denote M := M t,t ′ , L := L t,t ′ , λ := λ t,t ′ . By the definition of λ, there exists an element x d ∈ X n such that L By changing the roles of t and t ′ if necessary, we may assume that d T (x d ) = L + 1 < d T ′ (x d ). Let x p and x q be the parents of x d in T and T ′ , respectively. Then d T ( Denote by W the entryway u 0 → u 1 → · · · → u L → u L+1 and by W ′ the walk v 0 → v 1 → · · · → v λ . By Lemma 4.8, K is an m-whirl for some divisor m of M . Let C be an m-cycle in K that includes the vertices w and u L+1 .
If (u L , v 0 ) ∈ E(G), then let W ′′ be the walk that extends W with vertices of C to a walk of length h(T ), and consider the collapsing map ϕ : X n → V (G) of (T, x d ) to (W ′′ , W ′ ). Observe that ϕ(x q ) = w. (In order to see this, we need to verify that If (w, v 0 ) ∈ E(G), then let W ′′ be the walk that extends W with vertices of C to a walk of length h(T ′ ), and consider the collapsing map ϕ ′ : X n → V (G) of (T ′ , x d ) to (W ′′ , W ′ ). Observe that ϕ ′ (x p ) = u L . (In order to see this, we need to verify that d T ′ (x p ) = L. We know that d T ( Remark 7.30. Note that the walk v 0 → v 1 → · · · → v λ in Lemma 7.29 may include vertices in the nontrivial strongly connected component K. In particular, Lemma 7.29 asserts that if G satisfies t ≈ t ′ , L := L t,t ′ , E G = L + 1, and u 0 → u 1 → · · · → u L → u L+1 is an entryway, then there is an edge u L → v for every vertex v in the block B of u L+1 in K. This follows by choosing any vertex w from the predecessor block of B and taking v 0 → v 1 → · · · → v λ to be any walk starting at v and going around K until it reaches length λ.
We have established above several necessary conditions for a digraph to satisfy a bracketing identity. We show next that these conditions are also sufficient.
Theorem 7.31. Let G be a digraph, and let t, t ′ ∈ B n with t = t ′ . Then A(G) satisfies the identity t ≈ t ′ if and only if the following conditions hold: (i) Every nontrivial strongly connected component of G is a whirl.
(ii) There is no path from a nontrivial strongly connected component of G to another.
The necessity of the conditions is established in Lemmata 4.9, 7.6, 7.7, 7.10, 7.16, 7.19, 7.24, 7.29. For sufficiency, assume that the digraph G = (V, E) and the bracketings t, t ′ ∈ B n satisfy the conditions. In order to show that A(G) satisfies the identity t ≈ t ′ , it suffices, by Proposition 2.1, to show that a map ϕ : X n → V is a homomorphism of T into G if and only if it is a homomorphism of T ′ into G. So, assume that ϕ : X n → V is a homomorphism of T into G. We need to verify that ϕ is a homomorphism of T ′ into G. The image of any path in T under ϕ is a walk in G. By conditions (ii), (v) and (vi), it is either a pleasant path, or it comprises an entryway (of length at most L + 1, possibly 0) to a nontrivial strongly connected component K, followed by a winding walk in K, again followed by an outlet from K (of length at most Y + 1, possibly 0). Since T contains a path of length h(T ) ≥ H, condition (iv) implies that the image of ϕ contains a vertex belonging to a nontrivial strongly connected component of G.
Our goal is to show that for any edge (a, b) of T ′ , its image (ϕ(a), ϕ(b)) is an edge of G. Since T and T ′ are identical up to level L, it holds that if (a, b) is an edge of T ′ with d T ′ (a) < L, then (a, b) is also an edge of T and hence (ϕ(a), ϕ(b)) ∈ E(G). Therefore we can focus on edges (a, b) ∈ E(T ′ ) with d T ′ (a) ≥ L.
Let x ℓ ∈ X n be an arbitrary vertex with d T ′ (x ℓ ) = L. Then also d T ( We will be done if we show that (ϕ(a), ϕ(b)) ∈ E(G) holds for every edge (a, b) of the rooted induced subtree T ′ x ℓ . The remainder of the proof is a case analysis. The first case distinction is made according to which vertices of T x ℓ , if any, are mapped to nontrivial strongly connected components. Each case leads to several subcases. Figure 5 illustrates several main cases and subcases, showing relevant parts of the tree T and highlighting vertices that are mapped to nontrivial strongly connected components.
Case 1: Assume that ϕ maps no vertex of T x ℓ to a nontrivial strongly connected component of G. Let x 1 =: u 0 → u 1 → · · · → u L := x ℓ be the path from x 1 to x ℓ in T ′ (equivalently, in T ). We make a further case distinction on whether any vertex on this path is mapped to a nontrivial strongly connected component. Case 1.1: Assume that there is an index i ∈ {0, . . . , L − 1} such that ϕ(u i ) lies in a nontrivial strongly connected component of G. It follows from condition (vi) that h(T x ℓ ) ≤ Y ; hence T x ℓ = T ′ x ℓ by the definition of Y . Therefore (ϕ(a), ϕ(b)) is clearly an edge of G for every edge (a, b) of T ′ x ℓ . Case 1.2: Assume that for all i ∈ {0, . . . , L − 1}, ϕ(u i ) belongs to a trivial strongly connected component. Since the image of ϕ contains a vertex belonging to a nontrivial strongly connected component of G, there exists an index j ∈ {0, . . . , L − 1} such that T uj contains a vertex that is mapped by ϕ to a nontrivial strongly connected component (at least T x1 = T u0 satisfies this). Assume that j is the largest such index. By condition (v), T uj contains a vertex w such that ϕ(w) lies in a nontrivial strongly connected component K and Continuing this in a suitable way with vertices from K, we obtain a walk of length L + 1 in G, the last vertex of which belongs to K. Let then y be a vertex of maximum depth in T uj+1 , let d := d T (y), and consider the path is pleasant. It follows from condition (ix) that d < ω(j + 1). By the definition of ω and Ω t,t ′ we have T uj+1 = T ′ uj+1 and hence T x ℓ = T ′ x ℓ , and it follows that (ϕ(a), ϕ(b)) ∈ E(G) for every edge (a, b) of T ′ x ℓ . Case 2: Assume that ϕ(x ℓ ) belongs to a nontrivial strongly connected component K of G. By conditions (i) and (iii), K is an m-whirl for a divisor m of M . By condition (ii), ϕ maps each vertex of T x ℓ to K or to an outlet from K. Let (a, b) be an edge of T ′ x ℓ . We consider the different cases according to whether a and b are mapped to K or not.
We must also have ϕ(c) ∈ K. (Suppose, to the contrary, that ϕ(c) / ∈ K. Then h(T c ) ≤ Y by condition (vi); hence T c = T ′ c by the definition of Y , so (c, b) is an edge of both T and T ′ . This contradicts the fact that a is the unique parent of b in T ′ .) . Therefore ϕ(a) and ϕ(c) belong to the same block of the m-whirl K, and it now follows from condition (vii) that (ϕ(a), ϕ(b)) ∈ E(G).
Case 3: Assume that ϕ maps some vertices of T x ℓ to nontrivial strongly connected components of G but ϕ(x ℓ ) belongs to a trivial strongly connected component. If v is a vertex of T x ℓ such that ϕ(v) ∈ K, where K is a nontrivial strongly connected component, and x 1 =: u 0 → u 1 → · · · → u L → · · · → u q := v is the path from x 1 to v in T , then ϕ(u i ) ∈ K for all i ∈ {L + 1, . . . , q} by conditions (ii) and (v). Together with condition (viii), this implies that if v and v ′ are vertices of T x ℓ such that ϕ(v) ∈ K, ϕ(v ′ ) ∈ K ′ , where K and K ′ are nontrivial strongly connected components, then K = K ′ . So, let us assume that K is the unique nontrivial strongly connected component with nonempty intersection with ϕ(V (T x ℓ )). By conditions (i) and (iii), K is an m-whirl for a divisor m of M . Moreover, ϕ(u 0 ) → ϕ(u 1 ) → · · · → ϕ(u L+1 ) is an entryway of length L + 1, so condition (v) implies E G = L + 1. Now condition (x) in turn implies λ G < λ.
., x r is a child of x ℓ in T ′ , and let x ℓ =: v 0 → v 1 → · · · → v z := x r be the path from x ℓ to x r in T . We are going to show that (ϕ(x ℓ ), ϕ(x r )) ∈ E(G) and that (ϕ(a), ϕ(b)) ∈ E(G) for every edge (a, b) of T ′ xr . Since x r was chosen arbitrarily among the children of x ℓ , this will cover all edges of T ′ x ℓ and we will be done. We consider different possibilities. Case 3.1: Assume that ϕ(x r ) / ∈ K. Case 3.1.1: Assume that ϕ(v i ) ∈ K for some i ∈ {1, . . . , z − 1}. Then necessarily z > 1; hence d T (x r ) > L + 1. In particular, ϕ(v 1 ) ∈ K by condition (v) and ϕ(x r ) lies on an outlet, so h(T xr ) ≤ Y by condition (vi). Consequently, T xr = T ′ xr by the definition of Y ; therefore, (ϕ(a), ϕ(b)) ∈ E(G) for every edge (a, b) of T ′ xr . It remains to show that (ϕ(x ℓ ), ϕ(x r )) ∈ E(G).
We are going to show that ϕ maps T ′ xr homomorphically into G. We go through the vertices in T ′ xr in depth-first-search order, and we show that every edge of T ′ xr is mapped to an edge of G. As we will see, it suffices to go along each branch of T ′ xr only so far until we reach a vertex v such that ϕ(v) / ∈ K; once such a vertex is reached, the induced subtree rooted at v will automatically be mapped homomorphically into G.
So, let (a, b) ∈ E(T ′ xr ) and assume that we have already shown that every vertex on the path x r → · · · → a in T ′ is mapped into K by ϕ and every edge along this path is mapped to an edge of G. In particular, ϕ(a) ∈ K. Let c be the parent of b in T ; (c, b) ∈ E(T ). If a = c, then we clearly have (ϕ(a), ϕ(b)) = (ϕ(c), ϕ(b)) ∈ E(G). Assume from now on that a = c. We need to consider several cases. 1, that is, ϕ(a) and ϕ(b) lie in consecutive blocks of K; then clearly (ϕ(a), ϕ(b)) ∈ E(G).
it follows that ϕ maps all edges of the subtree T ′ b to edges of G. Case 3.2.2.2: Assume that ϕ(c) / ∈ K. We claim that c = x ℓ . Suppose, to the contrary, that the path x ℓ =: y 0 → y 1 → · · · → y p := c from x ℓ to c in T has length p ≥ 1. Then ϕ(y i ) / ∈ K for all i ∈ {0, 1, . . . , p} (otherwise ϕ(c) would lie in an outlet, so h(T c ) ≤ Y , whence T c = T ′ c , which is clearly a contradiction since (c, b) is an edge in T but not in T ′ ). In fact, is also an edge of T ′ , a contradiction. Since Using again the fact that x ℓ → v 1 is an edge of T , ϕ(v 1 ) ∈ K, and d T (v 1 ) = L + 1, condition (ix) implies , so ϕ(a) and ϕ(v 1 ) lie in consecutive blocks of K, that is, ϕ(a) → ϕ(v 1 ) is an edge. Now the inequality λ G < λ implies that (ϕ(a), ϕ(b)) ∈ E(G). From T b = T ′ b it follows that ϕ maps all edges of the subtree T ′ b to edges of G. This exhausts all cases, and we conclude that ϕ is a homomorphism of T ′ to G. Switching the roles of T and T ′ , the same argument shows that every homomorphism of T ′ to G is a homomorphism of T to G. Proposition 2.1 now yields A(G) |= t ≈ t ′ .

Special cases
As an illustration of the parameters and results of the previous section, we now present how some of the main results of Part I can be derived as special cases of Theorem 7.31. When restricted to undirected graphs, Theorem 7.31 is reduced to the following proposition, which together with Lemma 3.1 leads to Theorem 3.3. Proof. The strongly connected components of an undirected graph are just its connected components, and every symmetric edge is part of a cycle. Therefore, an undirected graph G has no pleasant path of nonzero length and consequently no entryway nor outlet of nonzero length; thus P G ≤ 0, E G ≤ 0, O G ≤ 0. It also clearly holds that B G = −∞, λ G = −∞, and ω G (ℓ, r) = −∞ for all ℓ, r ∈ N with ℓ ≥ r ≥ 1. The only whirls with symmetric edges are 1-whirls (i.e., complete graphs with loops) and 2-whirls (i.e., complete bipartite graphs). From this it also easy to see that Z G = −∞, For this reason, condition (ii) of Theorem 7.31 is automatically satisfied, and conditions (iv)-(x) obviously hold for any t, t ′ ∈ B n with t = t ′ , Therefore it is only conditions (i) and (iii) that matter.
Consider first the case that every nontrivial connected component of G is a 1whirl. Then M G = 1. Since 1 | M t,t ′ for any t, t ′ ∈ B n , t = t ′ , it holds that A(G) satisfies every bracketing identity.
Consider now the case that every nontrivial connected component of G is a 1whirl or a 2-whirl and at least one of the components is a 2-whirl. Then M G = 2, so A(G) satisfies a nontrivial bracketing identity t ≈ t ′ if and only if 2 | M t,t ′ .
Finally, in the case when G has a nontrivial connected component that is not a whirl, A(G) satisfies no nontrivial bracketing identity.
An equivalent characterization of associative digraphs is obtained as a special case of Theorem 7.31.
and only if the nontrivial strongly connected components of G are complete graphs with loops, and for every vertex v ∈ V (G), the outneighbourhood of v is a nontrivial strongly connected component.
Proof. Denote t := x 1 (x 2 x 3 ) and t ′ := (x 1 x 2 )x 3 . It is straightforward to verify that this pair of bracketings has the following parameters (see Figure 3 of Part I): With these parameters, the conditions of Theorem 7.31 for A(G) to satify the identity t ≈ t ′ are reduced to the following: (i) Every nontrivial strongly connected component of G is a whirl.
(ii) There is no path from a nontrivial strongly connected component of G to another.
(This is also a consequence of (i) and (vi).) (viii) B G = −∞. In view of conditions (iv) and (vi), this means that all outneighbours of a vertex belong to the same nontrivial strongly connected component.
(This is also a consequence of (iv) and (vi).) (x) If E G = 1, then λ G = −∞. This means that for any vertex v belonging to a trivial strongly connected component, if (v, u) is an edge, then (v, w) is an edge for all vertices w in the strongly connected component of u. The above conditions are easily seen to be equivalent to the following: the nontrivial strongly connected components of G are complete graphs with loops, and for every vertex v ∈ V (G), the outneighbourhood of v is an entire nontrivial strongly connected component.

Spectrum dichotomy
Theorem 7.31 provides a necessary and sufficient condition for a graph algebra to satisfy a nontrivial bracketing identity. However, the theorem does not directly give information on the number of distinct term operations of a graph algebra induced by the bracketings of a given size. Although a general description of the associative spectra of digraphs still eludes us, we can find some bounds for the possible associative spectra. In fact, as we will see in Theorem 9.6, the associative spectrum of a graph algebra is either constant at most 2 or it grows exponentially.
In preparation for this dichotomy result, we shall determine the associative spectrum of the graph algebra corresponding to a certain graph on three vertices (see Proposition 9.3).
Lemma 9.1. For n ≥ 2 let R n be the set of words ρ of length n over the alphabet {0, 1} that satisfy the following three conditions: (i) ρ does not start with 01, (ii) ρ does not end with 10, (iii) ρ does not contain 101. Then |R n | is asymptotically Θ(α n ) 1 , where α ≈ 1.755 is the unique positive root of the polynomial Proof. It is straightforward to verify that the map ψ defined by the following formula is a bijection from R n−1 ∪ R n−2 ∪ R n−4 to R n for all n ≥ 6: Thus we have the recurrence relation |R n | = |R n−1 | + |R n−2 | + |R n−4 |. The characteristic polynomial of this linear recurrence is x 4 − x 3 − x 2 − 1, and its roots are α ≈ 1.755, β ≈ 0.123 + 0.745i, γ ≈ 0.123 − 0.745i, δ = −1. Therefore, |R n | = a · α n + b · β n + c · γ n + d · δ n for suitable complex numbers a, b, c, d. Since α is the only characteristic root of absolute value greater than one, the dominant term is a · α n ; hence we have |R n | = Θ(α n ).
Remark 9.2. The sequence of values |R n | appears as sequence A005251 in the OEIS [5].
Proposition 9.3. The associative spectrum s n of the graph algebra corresponding to the graph G given by Proof. For any DFS tree T of size n, a map ϕ : X n → {u, v, w} is a homomorphism of T into G if and only if either ϕ(X n ) = w, or ϕ(x 1 ) = u and all vertices mapped to v are leaves of depth one in T : ∀p ∈ X n : ϕ(p) = v =⇒ d T (p) = 1 and h(T p ) = 0.
By Proposition 2.1, this implies that A(G) satisfies a bracketing identity t ≈ t ′ if and only if the corresponding DFS trees G(t) and G(t ′ ) have the same leaves on level one. Thus s n counts the number of subsets of S ⊆ {x 2 , . . . , x n } that can occur as the set of "depth-one leaves" of a DFS tree of size n. We claim that such sets S are characterized by the following three conditions: It is clear that these conditions are necessary. Conversely, assume that S = {x i1 , . . . , x is } ⊆ {x 2 , . . . , x n } with 2 ≤ i 1 < · · · < i s ≤ n satisfies the three conditions above. Let us construct a DFS tree T of size n as follows. For each x i k ∈ S, let x i k be a child of the root x 1 , and let x i k have no children. If k < s and i k+1 > i k +1, then let x i k +1 be also a child of x 1 , and let x i k +2 , . . . , x i k+1 −1 be the children of x i k +1 . Note that condition (c) guarantees that this is a nonempty set of children; hence x i k +1 is not a leaf. In addition, if x 2 / ∈ S (i.e., i 1 > 2), then let x 2 be a child of x 1 , and let x 3 , . . . , x i1−1 be the children of x 2 . Again, condition (a) ensures that at least x 3 will be a child of x 2 , hence x 2 is not a leaf in this case. Similarly, if x n / ∈ S (i.e., i s < n), then let x is+1 be a child of x 1 , and let x is+2 , . . . , x n be the children of x is+1 . Condition (b) guarantees that x is+1 is not a leaf. This construction yields a DFS tree T whose depth-one leaves are exactly the elements of S.
Proof. We need to count sets S ⊆ {x 2 , . . . , x n } that can occur as the set of depthone vertices of a DFS tree of size n. Clearly, x 2 ∈ S holds for such sets. We claim that this condition is also sufficient. Indeed, let S = {x i1 , . . . , x is } ⊆ {x 2 , . . . , x n } with 2 = i 1 < · · · < i s ≤ n, and let us construct a DFS tree T as follows. For each x i k ∈ S, let x i k be a child of the root x 1 , and let x i k +1 , . . . , x i k+1 −1 be the children of x i k (it is possible that this is an empty set of children). Then the depth-one vertices of T are exactly the elements of S. We can conclude that |B n /∼| is the number of subsets of {x 2 , . . . , x n } that contain x 2 , and this is obviously 2 n−2 .
By a directed bipartite graph we mean a bipartite graph G = (V, E) with bipartition V = V 1 ∪ V 2 such that E ⊆ V 1 × V 2 (i.e., all edges go to the "same direction"). The weakly connected components of a digraph G are its induced subgraphs on (the vertex sets of) the connected components of the underlying undirected graph of G.
Theorem 9.6. For any digraph G we have the following three mutually exclusive cases. Proof. Let G be an arbitrary digraph, and let s n = s n (A(G)) denote the associative spectrum and σ n = σ n (A(G)) denote the fine associative spectrum of the corresponding graph algebra. Let us assume that s n does not grow exponentially. Then G satisfies conditions (i) and (ii) of Theorem 7.31 (otherwise the associative spectrum would consist of the Catalan numbers). If M G ≥ 2, then G contains an induced subgraph that is isomorphic to the directed cycle C m for some m ≥ 2; hence s n ≥ s n (C m ) ≥ s n (C 2 ) = 2 n−2 by Proposition 5.4 and Remark 5.5, contradicting our assumption on the growth of the spectrum. If P G ≥ 2, then condition (iv) of Theorem 7.31 shows that all bracketings corresponding to DFS trees of height at most 2 fall into different equivalence classes of the fine spectrum σ n . Therefore, Lemma 9.4 implies that s n ≥ 2 n−2 , a contradiction. If E G ≥ 2, then by condition (v) of Theorem 7.31, bracketings t, t ′ ∈ B n fall into different equivalence classes of the fine spectrum whenever the corresponding DFS trees differ at level one. Hence, by Lemma 9.5, we have s n ≥ 2 n−2 , which is a contradiction again. A similar argument using condition (vi) of Theorem 7.31 and Lemma 5.6 shows that O G ≥ 1 also leads to the contradiction s n ≥ 2 n−2 .
We have proved thus far that if A(G) has a subexponential spectrum, then G satisfies conditions (i) and (ii) of Theorem 7.31 and the (in)equalities M G = 1, P G ≤ 1, E G ≤ 1, O G ≤ 0. Let us assume that the latter hold, and let V 0 be the union of the vertex sets of the nontrivial strongly connected components of G (if there are any). From P G ≤ 1, E G ≤ 1 and O G ≤ 0 we can see that no vertex of V \ V 0 can have an inneighbour and an outneighbour at the same time. Let V 1 be the set of vertices that have an outneighbour, and let V 2 := V \ (V 0 ∪ V 1 ). Thus V = V 0 ∪ V 1 ∪ V 2 (some of these sets might be empty), and the subgraph induced on V 1 ∪ V 2 is a directed bipartite graph, whereas the subgraph induced on V 0 is a disjoint union of complete graphs with loops by conditions (i) and (ii) of Theorem 7.31 and by M G = 1. Since O G ≤ 0, there is no edge from V 0 to V 1 ∪ V 2 , and there is no edge from V 2 to V 0 by the definition of V 2 , but we may have edges from V 1 to V 0 .
Let (v 1 , v 0 ) be such an edge (i.e., v 1 ∈ V 1 and v 0 ∈ V 0 ). If v ′ 0 is another vertex in the strongly connected component of v 0 , then we must have the edge (v 1 , v ′ 0 ). Indeed, if this was not the case, then subgraph induced on {v 1 , v 0 , v ′ 0 } would be isomorphic to the graph of Proposition 5.9, and it has an exponential spectrum. (Note that the spectrum of any induced subgraph provides a lower estimate of the spectrum of the whole graph.) On the other hand, if v ′ 0 belongs to another nontrivial strongly connected component, then the presence of the edge (v 1 , v ′ 0 ) would give rise to an induced subgraph isomorphic to that of Proposition 5.8, again contradicting our assumption about the subexponential growth of the spectrum. Thus we have proved that if a vertex of V 1 has outneighbours in V 0 , then these outneighbours form a nontrivial strongly connected component.
Finally, if a vertex v 1 ∈ V 1 has an outneighbour v 0 ∈ V 0 and also an outneighbour v 2 ∈ V 2 , then the subgraph induced on {v 1 , v 2 , v 0 } is isomorphic to the graph of Proposition 9.3, forcing again an exponential spectrum. Thus some vertices of V 1 have outneighbours only in V 0 , while others have outneighbours only in V 2 . The former vertices together with V 0 form an associative graph (see Proposition 8.2), while the latter vertices together with V 2 form a directed bipartite graph. This proves that every digraph with a subexponential associative spectrum belongs to cases (i) or (ii) of the current theorem.
It only remains to prove that the spectrum of a directed bipartite graph with at least one edge is constant 2. But this is easily done with the help of Theorem 7.31. All conditions except for (iv) are satisfied trivially for all t, t ′ ∈ B n with t = t ′ . Condition (iv) gives 1 = P G < H t,t ′ , which means that σ n has two equivalence classes: {t} and B n \ {t}, where t = ((· · · ((x 1 x 2 )x 3 ) · · · )x n−1 )x n is the bracketing that corresponds to the unique DFS tree of size n and height 1.
Remark 9.7. Theorem 9.6 implies that there are only two different bounded spectra of graph algebras, namely constant 1 and constant 2. For arbitrary groupoids, all sequences of the form (2, . . . , 2, 1, 1, . . . ) can occur as associative spectra, and there are other bounded spectra (e.g., constant 3), too [1]. Theorem 9.6 also implies that unboundeded spectra of graph algebras grow exponentially, the smallest growth rate being Θ(α n ). This is not true for arbitrary groupoids either: there exist groupoids with polynomial spectra of arbitrary degrees [3].