Generating connected and 2-edge connected graphs

We focus on the algorithm underlying the main result of (6). This is an algebraic formula to generate all connected graphs in a recursive and ecient manner. The key feature is that each graph carries a scalar factor given by the inverse of the order of its group of automorphisms. In the present paper, we revise that algorithm on the level of graphs. Moreover, we extend the result subsequently to further classes of connected graphs, namely, 2-edge connected, simple and loopless graphs. Our method con- sists of basic graph transformations only.


Introduction
The present paper is part of a program laid out in [5,6] with the focus on the combinatorics of different kinds of connected graphs and problems of graph generation. In particular, the main result of [5] is a recursion formula to generate all trees. This result is generalized to all connected graphs (with loops and multiple edges allowed) in [6]. The underlying structure is a Hopf algebraic representation of graphs. In both cases, in a recursion step, the formulas yield linear combinations of graphs with rational coefficients. The essential property is that the coefficients of graphs are given by the inverses of the orders of their groups of automorphisms. Other problems in this context are considered in [3,7], for instance.
In this paper, we express the algebraic recursion formula to generate all connected graphs given in [6], in terms of graphs. Moreover, we extend this result successively to 2-edge connected, simple connected and loopless connected graphs. Crucially, as in [5,6], the exact coefficients of graphs are obtained.
Our method is based on three elementary graph transformations to produce a graph with, say, m edges from a graph with m−1 edges. Namely, (a) assigning a loop to a vertex; (b) connecting a pair of vertices with an edge; (c) splitting a vertex in two, distributing the ends of edges assigned to the split vertex, between the two new ones in a given way, and connecting the two new vertices with an edge. In particular, the last operation is (equivalently) defined for simple graphs in [2].
Furthermore, we consider a definition of graph which is more general than the one given in most textbooks on graph theory. In particular, we allow edges not to be connected to vertices at both ends. Clearly, all results hold when the number of these external edges vanishes and the standard definition of graph is recovered. However, as in [5,6], external edges are fundamental for the (induction) proofs. This is due to the fact that vertices carrying (labeled) external edges are distinguishable and thus held fixed under any symmetry. This paper is organized as follows: Section 2 reviews the basic concepts of graph theory underlying much of the paper. Section 3 contains the definitions of the basic linear maps to be used in the following sections. Section 4 translates the recursion formula to generate all connected graphs given in [6], to the language of graph theory. Section 5 extends this result to 2-edge connected, simple connected and loopless connected graphs.

Graphs
We briefly review the basic concepts of graph theory that are relevant for the following sections. For more information on these we refer the reader to standard textbooks such as [1]. we denote the set of all 2-element subsets of A. Also, by 2 A , we denote the power set of A, i.e., the set of all subsets of A. By card(A), we denote the cardinality of the set A. Finally, we recall that the symmetric difference of the sets A and B is given by A B := (A ∪ B)\(A ∩ B).
Let V = {v i } i∈N and K = {e a } a∈N be infinite sets so that V ∩ K = ∅. Let V ⊂ V; V = ∅ and K ⊂ K be finite sets. Let E = E int ∪ E ext ⊆ [K] 2 and E int ∩ E ext = ∅. Also, let the elements of E satisfy {e a , e a } ∩ {e b , e b } = ∅. That is, e a , e a = e b , e b and e a = e a , e b = e b . In this context, a graph is a triple G = (V, K, E) together with the following maps: The elements of V and E are called vertices and edges, respectively. In particular, the elements of E int and E ext are called internal edges and external edges, respectively. Both internal and external edges are unordered pairs of elements of K. The elements of these pairs are called ends of edges. In other words, internal edges are edges that are connected to vertices at both ends, while external edges have one free end. Internal edges with both ends assigned to the same vertex are also called loops. Two distinct vertices connected together by one or more internal edges, are said to be adjacent. Two or more internal edges connecting the same pair of distinct vertices together, are called multiple edges. For instance, Figure 1 (a) shows a loop, while Figure 1 (b) shows a graph with both multiple edges and external edges. A graph with no loops nor multiple edges is called simple. The degree of a vertex is the number of ends of edges assigned to the vertex. Clearly, a loop adds 2 to the degree of a vertex.
Let G = (V, K, E); E = E int ∪ E ext , s := card(E ext ), together with the maps ϕ int and ϕ ext denote a graph. The external edges of the graph G are said to be labeled if their free ends are assigned labels x 1 , . . . , x s from a label set L = {x 1 , . . . , x s }. Labels on different ends of external edges are required to be distinct. More precisely, a labeling of the external edges of the graph G, is an injective map l : Figure 1 (c) shows a graph with two vertices and four labeled external edges.
. . , {v n−1 , v n }} and the vertices v 1 and v n have degree 1, while the vertices v 2 , . . . , v n−1 have degree 2. In this context, the vertices v 1 and v n are called the end point vertices, while the vertices v 2 , . . . , v n−1 are called the inner vertices. A cycle is . . , {v n−1 , v n }, {v n , v 1 }} and every vertex has degree 2. A graph is said to be connected if every pair of vertices is joined by a path. Otherwise, it is disconnected. Moreover, a tree is a connected graph with no cycles. A 2-edge connected graph (or edge-biconnected graph) is a connected graph that remains connected after erasing one and whichever internal edge. By definition, a graph consisting of a single vertex is 2-edge connected.
Furthermore, let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph. The set 2 Eint is a vector space over the field Z 2 so that vector addition is given by the symmetric difference. The cycle space C of the graph G is defined as the subspace of 2 Eint generated by all the cycles in G. The dimension of C is called the cyclomatic number of the graph G. Moreover, the cyclomatic number k := dim C yields in terms of the vertex number n := card(V ) and the internal edge number m := card(E int ) as k = m − n + c, where c denotes the number of connected components of the graph G [4]. Now, let L = {x 1 , . . . , x s } be a finite label set. Let G = (V, K, E); E = E int ∪ E ext , card(E ext ) = s, together with the maps ϕ int and ϕ ext , and G * = (V * , K * , E * ); E * = E * int ∪ E * ext , card(E * ext ) = s, together with the maps ϕ * int and ϕ * ext denote two graphs. Let l : E ext → [K, L] and l * : E * ext → [K * , L] be labelings of the elements of E ext and E * ext , respectively. An isomorphism between the graphs G and G * is a bijection ψ V : V → V * and a bijection ψ K : K → K * which satisfy the following three conditions: Clearly, an isomorphism defines an equivalence relation on graphs. In particular, a vertex (resp. edge) isomorphism between the graphs G and G * is an isomorphism so that ψ K (resp. ψ V ) is the identity map. In this context, a symmetry of a graph G is an isomorphism of the graph onto itself (i.e, an automorphism). The order of the group of automorphisms of a graph G is called the symmetry factor. This is denoted by S G . A vertex symmetry (resp. edge symmetry) of a graph G is a vertex (resp. edge) automorphism of the graph. The order of the group of vertex (resp. edge) automorphisms is called the vertex symmetry factor (resp. edge symmetry factor ) of the graph. This is denoted by S G vertex (resp. S G edge ). Furthermore, the orders of the groups of vertex and edge automorphisms of a graph G satisfy S G = S G vertex · S G edge (a proof is given in [6], for instance).

Elementary linear transformations
We introduce some linear maps and prove their fundamental properties.
Given an arbitrary set X, by QX, we denote the free vector space on the set X over Q. That is, (a) every vector in QX yields a linear combination of the elements of X with coefficients in Q; (b) the set X is linearly independent. Furthermore, by id X : X → X; x → x, we denote the identity map. By id V ⊆X : V → X; x → x, we denote the identity embedding of the subset V of the set X into X. Finally, given maps f : Let V = {v i } i∈N and K = {e a } a∈N be infinite sets so that V ∩ K = ∅. Fix integers t, s, k ≥ 0 and n ≥ 1. Let L = {x 1 , . . . , x s } be a label set. By V n,k,s , we denote the set of all graphs with n vertices, cyclomatic number k and s external edges whose free ends are labeled x 1 , . . . , x s . In all that follows, let V = {v 1 , . . . , v n } ⊂ V, K = {e 1 , . . . , e t } ⊂ K and E = E int ∪ E ext be the sets of vertices, ends of edges and edges, respectively, of all elements of V n,k,s . Also, let l : E ext → [K, L] be a labeling of their external edges. Moreover, by V n,k,s conn and V n,k,s disconn , we denote the subsets of V n,k,s whose elements are connected and disconnected graphs, respectively. Finally, by V n,k,s 2-edge , V n,k,s simple and V n,k,s loopless , we denote the subsets of V n,k,s conn whose elements are 2-edge connected, simple and loopless graphs, respectively.
We now define the following linear transformations.
(i) Assigning a loop to a vertex : Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in V n,k,s . For all i ∈ {1, . . . , n}, define where the graph G * = (V * , K * , E * ); E * = E * int ∪ E * ext , together with the maps ϕ * int and ϕ * ext satisfies the following conditions: (a) V * = V ; is a labeling of the elements of E * ext . The maps t i are extended to the whole of QV n,k,s by linearity. Since the map t i : QV n,k,s → t i (QV n,k,s ) is injective, the operation of erasing a loop is given by t i −1 .
(ii) Connecting a pair of distinct vertices with an internal edge: Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in V n,k,s ; n > 1. For all i, j ∈ {1, . . . , n} with i = j, define where the graph G * = (V * , K * , E * ); E * = E * int ∪ E * ext , together with the maps ϕ * int and ϕ * ext satisfies the following conditions: is a labeling of the elements of E * ext . The maps l i,j are extended to the whole of QV n,k,s by linearity. Since the map l i,j : QV n,k,s → l i,j (QV n,k,s ) is injective, the operation of erasing an internal edge distinct from a loop is given by l i,j −1 . Furthermore, for n > 1 and for all i, j ∈ {1, . . . , n} with i = j, define l a i,j := l i,j • δ i,j and l b i,j := l i,j • (id − δ i,j ), where id : QV n,k,s → QV n,k,s is the identity map and (iii) Splitting a vertex in two and distributing the ends of edges assigned to the split vertex, between the two new ones in all possible ways: Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int := η • ζ and ϕ ext denote a graph in V n,k,s . Let L i ⊆ E be the set of edges connected to the vertex v i ∈ V ; i ∈ {1, . . . , n}. Also, let L int,i and L ext,i be the subsets of L i whose elements are internal edges and external edges, respectively. Hence, L i = L int,i ∪ L ext,i and L int,i ∩ L ext,i = ∅. Moreover, let E i ⊆ K be the set of ends of edges assigned to the vertex v i . Also, let E int,i and E ext,i be the subsets of E i whose elements are ends of internal edges and ends of external edges, respectively. Thus, Ei denote the set of all ordered partitions of the set E i into two disjoint sets: Also, a partition of the set E ext,i generates a partition of the set L ext,i . Hence, L In this context, for all i ∈ {1, . . . , n}, define together with the maps ϕ * int and ϕ * ext satisfy the following conditions: The maps s i are extended to the whole of QV n,k,s by linearity. Moreover, we define the maps s c i (resp. s d i ) by restricting the image of , where ρ ≥ 1 is an integer. We combine the maps l i,n+1 ρ and s i to define the following maps: generalizes the basic operation given in [2] to all partitions of the set E i into two sets E (1) i and E (2) i , and to all vertices of the graph. Analogously, the maps q ) are given by the composition of l i,n+1 ρ with s c i (resp. s d i ). (iv) In addition, we revise the operation of contracting an internal edge connecting two distinct vertices, and fusing the two vertices into one [1]: Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in V n,k,s ; n > 1. Let {e a , e a } ∈ E int ; a, a ∈ {1, . . . , t} with a = a , denote an internal edge connecting two distinct vertices, say, Let L int,j , L ext,j and E int,j denote the sets of internal edges, external edges and ends of internal edges, re- Finally, let E free,j denote the set of free ends of the external edges in L ext,j . In this context, define together with the maps ϕ * int and ϕ * ext satisfies the following conditions: is a labeling of the elements of E * ext . The maps c i,j are extended to the whole of QV n,k,s by linearity.
(v) Distributing external edges between all elements of a given subset of vertices in all possible ways: Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in V n,k,s . Let V = {v z1 , . . . , v z n } ⊆ V ; with 1 ≤ z 1 < · · · < z n ≤ n. Let K ⊂ K be a finite set so that K ∩K = ∅.
together with the maps ϕ * int and ϕ * ext satisfy the following conditions: , with l * | Eext = l and l * | E ext = l , is a labeling of the elements of E * ext . The maps ξ E ext ,V are extended to the whole of QV n,k,s by linearity.
(vi) Assigning external edges to vertices which have none: Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in V n,k,s . Assume that there exists a set V ⊆ V ; s := card(V ) so that V ∩ϕ ext (E ext ) = ∅. Moreover, let K ⊂ K be a finite set so that K ∩K = ∅.
. , x s+s } be a label set so that L ∩ L = ∅. Finally, let l : E ext → [K , L ] be a labeling of the elements of E ext . In this context, define together with the maps ϕ * int and ϕ * ext satisfies the following conditions: , with l * | Eext = l and l * | E ext = l , is a labeling of the elements of E * ext . The maps E ext are extended to the whole of QV n,k,s by linearity.
The following lemmas are now established.
Lemma 1 Fix integers k, s ≥ 0 and n, ρ ≥ 1. Then, for all i, j ∈ {1, . . . , n} with i = j, the following statements hold: In particular, s i (G) is a linear combination of graphs, each of which is either connected or disconnected with two components. Applying the map l i,n+1 ρ to s i (G) yields connected graphs. This completes the proof.
together with the maps ϕ int and ϕ ext denote a graph in V n,k,s conn which is not simple. Then, for all i, j ∈ {1, . . . , n} with i = j, the following statements hold: Proof: (a) Clearly, the statement holds. (b) By assumption, the graph G has at least either one loop or multiple edges. Apply the map q to the graph G. In particular, s d i (G) is a linear combination of disconnected graphs, each of which is produced from the graph G by assigning all ends of internal edges belonging to the same cycles, from the vertex v i ∈ V to either v i or v n+1 . Therefore, at least one of the two components of the graphs in s d i (G) is not simple. Applying the map l i,n+1 to s d i (G) cannot produce simple graphs. This completes the proof.
Lemma 3 Fix integers k, s ≥ 0 and n ≥ 1. Then, for all i, j ∈ {1, . . . , n} with i = j, the following statements hold: Proof: Applying the maps l b i,j or q (1) i to a simple graph cannot introduce loops nor multiple edges.
together with the maps ϕ int and ϕ ext denote a graph in V n,k,s conn which is not 2-edge connected. Then, for all i ∈ {1, . . . , n}, the following statements hold: Proof: (a) Clearly, the statement holds. (b) First, by definition all connected graphs with only one vertex are 2-edge connected. Consequently, the maps q (1) i produce 2-edge connected graphs with two vertices only from 2-edge connected ones. Now, let n > 1. By assumption, the graph G has at least one internal edge which does not belong to any cycle. Therefore, it connects two (distinct) vertices that must be connected together with only one internal edge. Let these vertices is a linear combination of graphs, each of which is so that the vertex v j is connected with only one internal edge either to v i or v n+1 (but not to both). Clearly, only cycles containing the vertex v i , are affected by the map q (1) i . That is, the vertex v j cannot share a cycle with neither of the vertices v i or v n+1 . Hence, the graphs in q In particular, s c i (G) is a linear combination of graphs, each of which is produced from the graph G by transforming one or more cycles containing the vertex v i ∈ V , into paths whose end point vertices are v i and v n+1 . Moreover, every way to assign the remaining ends of internal edges in the process, from v i to either v i or v n+1 , defines new cycles. Therefore, applying the map l i,n+1 to s c i (G) restores the broken cycles and yields 2-edge connected graphs. This completes the proof.

Arbitrary connected graphs
The present section has substantial overlap with Section II of [6]. Its main result is a recursion formula to generate all connected graphs directly in the algebraic representation rooted in [5]. Here, we formulate that formula on the level of graphs. In a recursion step, the formula yields the linear combination of all graphs having the same vertex and cyclomatic numbers. Moreover, the sum of the coefficients of all graphs in the same equivalence class, corresponds to the inverse of the order of their group of automorphisms.
We use the maps t i and q (1) i defined in the preceding section to recursively generate all connected graphs following [6].
Theorem 6 Fix an integer s ≥ 0. Let L = {x 1 , . . . , x s } be a label set. For all integers k ≥ 0 and n ≥ 1, define ω n,k,s ∈ QV n,k,s conn by the following recursion relation: • ω 1,0,s is a single vertex with s external edges whose free ends are labeled x 1 , . . . , x s , and unit coefficient; • ω n,k,s := 1 Then, for fixed values of n and k, ω n,k,s = G∈V n,k,s conn α G G; α G ∈ Q and α G > 0 for all G ∈ V n,k,s conn . Moreover, G∈C α G = 1/S C , where C ⊆ V n,k,s conn denotes an arbitrary equivalence class of graphs and S C denotes their symmetry factor.
In the recursion equation above, the t i summand does not appear when k = 0. Theorem 6 and formula (1) correspond to Theorem 10 and formula (11) of [6], respectively. In particular, for k = 0, the former theorem and formula correspond to Lemma 10 and formula (12) of [5], respectively. Moreover, formula (1) is an instance of a double recursion. Therefore, its algorithmic implementation is that of any recursive function that makes two calls to itself, such as the defining recurrence of the binomial coefficients.
Proof: The proof is nearly the same as that of Theorem 10 of [6]. The procedure is also very analogous to the one given in [5]. We translate every lemma given in Section II of the former paper to the present setting.
Lemma 7 Fix integers s, k ≥ 0 and n ≥ 1. Let ω n,k,s = G∈V n,k,s conn α G G ∈ QV n,k,s conn be defined by formula (1). Then, α G > 0 for all G ∈ V n,k,s conn .
Proof: The proof proceeds by induction on the internal edge number m. Clearly, the statement holds for m = 0. We assume the statement to hold for a general number of internal edges m − 1. Let G = (V, K, E); E = E int ∪ E ext , m := card(E int ), together with the maps ϕ int and ϕ ext denote an arbitrary graph in V n,k,s conn , where m = k + n − 1. We now show that the graph G is generated by applying the maps t i to graphs occurring in ω n,k−1,s = G * ∈V n,k−1,s conn γ G * G * ; γ G * ∈ Q, or the maps q (i) Suppose that the graph G has at least one vertex with one or more loops. Let this vertex be v i ∈ V ; i ∈ {1, . . . , n}, for instance. Erasing any loop yields a graph t i −1 (G) ∈ V n,k−1,s conn . By induction assumption, γ ti −1 (G) > 0. Hence, applying the map t i to the graph t i −1 (G) produces again the graph G. That is, α G > 0.
(ii) Suppose that the graph G has no loops. There exists i ∈ {1, . . . , n − 1} so that {v i , v n } ∈ ϕ int (E int ). Applying the map c i,n to the graph G yields a graph c i,n (G) ∈ V n−1,k,s conn . By induction assumption, β ci,n(G) > 0. Hence, to the graph c i,n (G) produces a linear combination of graphs, one of which is the graph G. That is, α G > 0.
What remains in order to prove Theorem 6 is to show that the sum of the coefficients of all graphs in the same equivalence class, is given by the inverse of their symmetry factor. We start with a more restricted result.
Lemma 8 Fix integers k ≥ 0, n ≥ 1 and s ≥ n. Let C ⊆ V n,k,s conn denote an equivalence class. Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in C . Assume that V ∩ ϕ ext (E ext ) = V . Let ω n,k,s = G∈V n,k,s conn α G G ∈ QV n,k,s conn be defined by formula (1). Then, G∈C α G = 1/S C , where S C denotes the symmetry factor of every graph in C .
Proof: The proof proceeds by induction on the internal edge number m. Clearly, the statement holds for m = 0. We assume the statement to hold for a general number of internal edges m − 1. Consider the graph G = (V, K, E) ∈ C ; E = E int ∪ E ext , m := card(E int ) = k + n − 1, together with the maps ϕ int and ϕ ext . By Lemma 7, the coefficient of the graph G in ω n,k,s is positive, i.e., α G > 0. Moreover, the graph G ∈ C is so that every one of its vertices has at least one (labeled) external edge. Hence, the graph G has no non-trivial vertex symmetries: S C vertex = 1. That is, S C = S C edge for any symmetry is an edge symmetry. We proceed to show that G∈C α G = 1/S C . To this end, we check from which graphs with m − 1 internal edges, the graphs in the equivalence class C are generated by the recursion formula (1), and how many times they are generated. Choose any one of the m internal edges of the graph G ∈ C .
(i) If that internal edge is a loop, let this be assigned to the vertex v i ∈ V ; i ∈ {1, . . . , n}, for instance. Also, assume that the vertex v i has exactly 1 ≤ τ ≤ k loops as well as x ≥ 1 external edges whose free ends are labeled x a1 , . . . , x ax , with 1 ≤ a 1 < · · · < a x ≤ s. Erasing any one of these loops yields a graph t i −1 (G) ∈ V n,k−1,s conn whose symmetry factor is related to that of G ∈ C via S ti −1 (G) = S C /(2τ ). Let ω n,k−1,s = G * ∈V n,k−1,s conn γ G * G * ; γ G * ∈ Q. Also, let A ⊆ V n,k−1,s conn denote the equivalence class containing t i −1 (G). The map t i produces the graph G from the graph t i −1 (G) with coefficient α * G = γ ti −1 (G) ∈ Q. Each vertex of the graph t i −1 (G) has at least one labeled external edge. Hence, by induction assumption, G * ∈A γ G * = 1/S ti −1 (G) = 1/S A . Now, take one graph (distinct from the graph G) in C in turn, choose any one of the τ loops of the vertex having x external edges whose free ends are labeled x a1 , . . . , x ax , and repeat the procedure above. We obtain Therefore, according to formula (1), the contribution to G∈C α G is τ /(m· S C ). Distributing this factor between the τ loops considered yields 1/(m · S C ) for each loop.
(ii) If that internal edge is not a loop, let this edge be connected to the vertices, v i , v j ∈ V ; i, j ∈ {1, . . . , n} with i < j, for instance. Also, assume that v i has τ ≥ 0 loops as well as r ≥ 1 external edges whose free ends are labeled x a1 , . . . , x ar , with 1 ≤ a 1 < · · · < a r ≤ s, while v j has τ ≥ 0 loops as well as r ≥ 1 external edges whose free ends are labeled x b1 , . . . , x b r , with 1 ≤ b 1 < · · · < b r ≤ s and a z = b z for all z ∈ {1, . . . , r}, z ∈ {1, . . . , r }. Finally, assume that the two vertices are connected together with ρ ≥ 1 internal edges, so that 1 ≤ τ + τ + ρ ≤ k + 1. Contracting any one of these internal edges yields a graph c i,j (G) ∈ V n−1,k,s conn whose vertex v i has µ := τ + τ + ρ − 1 loops as well as r + r external edges whose free ends are labeled x a1 , . . . , x ar , x b1 , . . . , x b r . Consequently, the symmetry factor of the graph c i,j (G) is related to that of G ∈ C via Let ω n−1,k,s = G ∈V n−1,k,s conn β G G ; β G ∈ Q. Let B ⊆ V n−1,k,s conn denote the equivalence class containing c i,j (G). Apply the map q (1) i := 1 2 l i,n • s i to c i,j (G). Notice that there are two ways to distribute the r + r external edges assigned to the vertex v i of the graph c i,j (G) between the vertices v i and v n , so that one vertex is assigned with r external edges whose free ends are labeled x a1 , . . . , x ar , while the other is assigned with r external edges whose free ends are labeled x b1 , . . . , x b r . Therefore, there are two graphs in the linear combination of graphs q (1) i (c i,j (G)) which are isomorphic to the graph G ∈ C . To calculate the coefficient α G ∈ Q of each of these graphs in that linear combination, we need to count the number of ways to distribute the 2µ ends of internal edges assigned to the vertex v i of the graph c i,j (G) ∈ V n−1,k,s conn , between the vertices v i and v n , so that the vertex with the given r external edges is assigned with τ loops, the vertex with the given r external edges is assigned with τ loops, while the remaining ρ−1 internal edges are employed to connect the two vertices together. Now, there are µ τ = µ! (µ−τ )!τ ! ways to assign both ends of τ internal edges chosen among the µ internal edges in the process, to the vertex with the aforesaid r external edges. Besides, there are µ−τ τ = (µ−τ )! (µ−τ −τ )!τ ! ways to assign both ends of τ internal edges chosen among the µ − τ internal edges in the process, to the vertex with the aforesaid r external edges. Finally, there are two ways to distribute one end of each of the remaining ρ − 1 internal edges, per vertex. This yields 2 ρ−1 ways to connect the two vertices together with ρ − 1 internal edges. The final result is given by the product of all these factors. Hence, there are ways to distribute the 2µ ends of internal edges between the vertices v i and v n so as to produce a graph in the equivalence class C . Consequently, carries the factor 1/2. Moreover, each vertex of the graph c i,j (G) has at least one labeled external edge. Therefore, by induction assumption, G ∈B β G = 1/S ci,j (G) = 1/S B . Now, take one graph (distinct from G) in C in turn, choose any one of the ρ internal edges connecting together the pair of vertices so that one vertex has r external edges whose free ends are labeled x a1 , . . . , x ar , while the other has r external edges whose free ends are labeled x b1 , . . . , x b r , and repeat the procedure above. We obtain where the factor 2 on the right hand side of the first equality, is due to the fact that each graph in the equivalence class B generates two graphs in C . Therefore, according to formula (1), the contribution to G∈C α G is ρ/(m·S C ). Distributing this factor between the ρ internal edges considered yields 1/(m · S C ) for each edge.
We conclude that every one of the m internal edges of the graph G contributes 1/(m · S C ) to G∈C α G . Hence, the overall contribution is exactly 1/S C . This completes the proof. ω n,k,s satisfies the following property.
Lemma 9 Fix integers s, k ≥ 0 and n ≥ 1. Let V , K and E = E int ∪ E ext be the sets of vertices, ends of edges and edges, respectively, of all graphs in V n,k,s . Let L = {x 1 , . . . , x s } be a label set and let l : E ext → [K, L] be a labeling of the elements of E ext . Let ω n,k,s = G∈V n,k,s conn α G G ∈ QV n,k,s conn be defined by formula (1). Moreover, let K ⊂ K be a finite set so that K ∩ K = ∅. Let E ext ⊆ [K ] 2 ; s := card(E ext ). Assume that the elements of E ext satisfy {e a , e a } ∩ {e b , e b } = ∅. Also, let L = {x s+1 , . . . , x s+s } be a label set so that L ∩ L = ∅. Let l : E ext → [K , L ] be a labeling of the elements of E ext . Then, ω n,k,s+s = ξ E ext ,V (ω n,k,s ).
We proceed to show that G∈C α G = 1/S C , where C ⊆ V n,k,s conn denotes any equivalence class.
Lemma 10 Fix integers s, k ≥ 0 and n ≥ 1. Let C ⊆ V n,k,s conn denote an arbitrary equivalence class. Let ω n,k,s = G∈V n,k,s conn α G G ∈ QV n,k,s conn be defined by formula (1). Then, G∈C α G = 1/S C , where S C denotes the symmetry factor of every graph in C .
Proof: Choose a graph G = (V, K, E) ∈ C ; E = E int ∪ E ext , together with the maps ϕ int and ϕ ext . Let L = {x 1 , . . . , x s } be a label set and let l : E ext → [K, L] be a labeling of the elements of E ext . If ϕ ext (E ext ) = V , we simply recall Lemma 8. Thus, we may assume that there exists a set V ⊆ V ; s := card(V ) so that V ∩ ϕ ext (E ext ) = ∅. Let K ⊂ K be a finite set so that K ∩ K = ∅. Let E ext ⊆ [K ] 2 ; card(E ext ) = s . Assume that the elements of E ext satisfy {e a , e a }∩ {e b , e b } = ∅. Also, let L = {x s+1 , . . . , x s+s } be a label set so that L ∩ L = ∅. Finally, let l : E ext → [K , L ] be a labeling of the elements of E ext . Now, apply a map E ext to the graph G. Let D ⊆ V n,k,s+s conn denote the equivalence class containing E ext (G). Let ω n,k,s+s = G ∈V n,k,s+s conn β G G ; β G ∈ Q. By Lemma 8, G ∈D β G = 1/S E ext (G) = 1/S D . Since, in general, the maps E ext are not uniquely defined, assume that there are T distinct maps E ext (G) = α G > 0. Therefore, repeating the same procedure for every graph in C and recalling Lemma 9, we obtain That is, defines a vertex symmetry of the graph G. This can have no more than these vertex symmetries, since the vertices that already carry (labeled) external edges, are distinguishable and thus held fixed under any symmetry. Hence, S G vertex = S C vertex = T . Moreover, S D = S D edge = S C edge . Finally, from the identity S C = S C vertex · S C edge , follows that G∈C α G = 1/S C . This completes the proof of Theorem 6.

Examples
The present section overlaps the appendix of [6]. We show the result of computing all mutually non-isomorphic connected graphs without external edges as contributions to ω n,k,0 via formula (1), up to order n+k ≤ 4. The coefficients in front of graphs are the inverses of the orders of their groups of automorphisms.

Extensions
We generalize Theorem 6 to 2-edge connected, simple connected and loopless connected graphs. These three results were not obtained in previous papers using the Hopf algebraic approach given in [5,6].

2-edge connected graphs
By Lemmas 4 and 5, Theorem 6 specializes to 2-edge connected graphs by replacing the maps q Theorem 11 Fix an integer s ≥ 0. Let L = {x 1 , . . . , x s } be a label set. For all integers k ≥ 0 and n ≥ 1, define β n,k,s ∈ QV n,k,s 2-edge by the following recursion relation: • β 1,0,s is a single vertex with s external edges whose free ends are labeled x 1 , . . . , x s , and unit coefficient; • β n,k,s := 1 Then, for fixed values of n and k, β n,k,s = G∈V n,k,s denotes an arbitrary equivalence class of graphs and S C denotes their symmetry factor.

Examples
We show the result of computing all mutually non-isomorphic 2-edge connected graphs without external edges as contributions to β n,k,0 via formula (2), up to order n + k ≤ 5. The coefficients in front of graphs are the inverses of the orders of their groups of automorphisms.

Simple connected graphs
We generalize Theorem 6 to simple connected graphs. To this end, we combine the maps q d(1) i with the maps l b i,j in formula (1).
Theorem 12 Fix an integer s ≥ 0. Let L = {x 1 , . . . , x s } be a label set. For all integers k ≥ 0 and n ≥ 1, define σ n,k,s ∈ QV n,k,s simple by the following recursion relation: • σ 1,0,s is a single vertex with s external edges whose free ends are labeled x 1 , . . . , x s , and unit coefficient; • σ n,k,s := 1 Then, for fixed values of n and k, σ n,k,s = G∈V n,k,s simple α G G; α G ∈ Q and α G > 0 for all G ∈ V n,k,s simple . Moreover, G∈C α G = 1/S C , where C ⊆ V n,k,s simple denotes an arbitrary equivalence class of graphs and S C denotes their symmetry factor.
In the recursion equation above, the l b i,j summand does not appear when k = 0.
Proof: The proof is very analogous to that of Theorem 6. Actually, every lemma given in the preceding section remains valid by replacing ω n,k,s by σ n,k,s . Here, we only state and prove the two lemmas corresponding to Lemmas 7 and 8. The rest of the proof is implied by analogy.
Lemma 13 Fix integers s, k ≥ 0 and n ≥ 1. Let σ n,k,s = G∈V n,k,s simple α G G ∈ QV n,k,s simple be defined by formula (3). Then, α G > 0 for all G ∈ V n,k,s simple .
Proof: The proof proceeds by induction on the internal edge number m. Clearly, the statement holds for m = 0. We assume the statement to hold for a general number of internal edges m − 1. Let G = (V, K, E); E = E int ∪ E ext , m := card(E int ), together with the maps ϕ int and ϕ ext denote an arbitrary graph in V n,k,s simple , where m = k + n − 1. We now show that the graph G is generated by applying the maps q d(1) i := 1 2 l i,n • s d i to graphs occurring in σ n−1,k,s = G ∈V n−1,k,s simple β G G ; β G ∈ Q, or the maps l b i,j := l i,j • (id − δ i,j ) to graphs occurring in σ n,k−1,s = G * ∈V n,k−1,s simple γ G * G * ; γ G * ∈ Q.
(ii) If k > 0, choose any one of the internal edges of the graph G which belong at least to one cycle. Let this edge be connected to the vertices v i , v j ∈ V ; i, j ∈ {1, . . . , n} with i = j. Erasing such internal edge yields a graph l i,j −1 (G) ∈ V n,k−1,s simple . By induction assumption, γ li,j −1 (G) > 0. Hence, applying the map l b i,j to l i,j −1 (G) produces again the graph G. That is, α G > 0.
Lemma 14 Fix integers k ≥ 0, n ≥ 1 and s ≥ n. Let C ⊆ V n,k,s simple denote an equivalence class. Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in C . Assume that V ∩ ϕ ext (E ext ) = V . Let σ n,k,s = G∈V n,k,s simple α G G ∈ QV n,k,s simple be defined by formula (3). Then, G∈C α G = 1.
Proof: The proof proceeds by induction on the internal edge number m. Clearly, the statement holds for m = 0. We assume the statement to hold for a general number of internal edges m − 1. Consider the graph G = (V, K, E) ∈ C ; E = E int ∪ E ext , m := card(E int ) = k + n − 1, together with the maps ϕ int and ϕ ext . By Lemma 13, the coefficient of the graph G in σ n,k,s is positive: α G > 0. Moreover, S C = 1 for the graph G ∈ C is simple and has no non-trivial vertex symmetries. We proceed to show that G∈C α G = 1. To this end, choose any one of the m internal edges of the graph G ∈ C .
(i) If that internal edge does not belong to any cycle, by Lemma 8, it adds 1/m to G∈C α G .
(ii) If that internal edge belongs at least to one cycle, let this edge be connected to the vertices v i , v j ∈ V ; i, j ∈ {1, . . . , n} with i = j. Also, assume that v i has r ≥ 1 external edges whose free ends are labeled x a1 , . . . , x ar , with 1 ≤ a 1 < · · · < a r ≤ s, while v j has r ≥ 1 external edges whose free ends are labeled x b1 , . . . , x b r , with 1 ≤ b 1 < · · · < b r ≤ s and a z = b z for all z ∈ {1, . . . , r}, z ∈ {1, . . . , r }. Erasing such internal edge yields a graph l i,j −1 (G) ∈ V n,k−1,s simple so that S li,j −1 (G) = 1. Let σ n,k−1,s = Each vertex of the graph l i,j −1 (G) has at least one labeled external edge. Hence, by induction assumption, G * ∈A γ G * = 1. Now, take one graph (distinct from G) in C in turn, choose the internal edge connected to the vertex having r external edges whose free ends are labeled x a1 , . . . , x ar , and to the vertex having r external edges whose free ends are labeled x b1 , . . . , x b r , and repeat the procedure above. We obtain Therefore, according to formula (3), the contribution to G∈C α G is 1/m.
We conclude that every one of the m internal edges of the graph G adds 1/m to G∈C α G . Hence, the overall contribution is exactly 1. This completes the proof.
This completes the proof of Theorem 12.

Examples
We show the result of computing all mutually non-isomorphic simple connected graphs without external edges as contributions to σ n,k,0 via formula (3), up to order n + k ≤ 6. The coefficients in front of graphs are the inverses of the orders of their groups of automorphisms.

Loopless connected graphs
The present section gives two algorithms to generate all loopless connected graphs. The second one is amenable to direct implementation via Hopf algebra in the sense of [5,6].

Main recursion formula
We generalize Theorem 6 to loopless connected graphs. To this end, we replace the maps t i by the maps l a i,j in formula (1).

(4)
Then, for fixed values of n and k, θ n,k,s = G∈V n,k,s loopless α G G; α G ∈ Q and α G > 0 for all G ∈ V n,k,s loopless . Moreover, G∈C α G = 1/S C , where C ⊆ V n,k,s loopless denotes an arbitrary equivalence class of graphs and S C denotes their symmetry factor.
In the recursion equation above, the l a i,j summand does not appear when k = 0.
Proof: As in the preceding section, every lemma given in Section 4 holds when stated for θ n,k,s . Hence, we restrict the proof of Theorem 15 to the following two lemmas.
Proof: The proof proceeds by induction on the internal edge number m. Clearly, the statement holds for m = 0. We assume the statement to hold for a general number of internal edges m − 1. Let G = (V, K, E); E = E int ∪ E ext , m := card(E int ), together with the maps ϕ int and ϕ ext denote an arbitrary graph in V n,k,s loopless , where m = k + n − 1. We now show that the graph G (1) i := 1 2 l i,n • s i to graphs occurring in θ n−1,k,s = G ∈V n−1,k,s loopless β G G ; β G ∈ Q, or the maps l a i,j := l i,j • δ i,j to graphs occurring in θ n,k−1,s = G * ∈V n,k−1,s loopless γ G * G * ; γ G * ∈ Q.
(i) Suppose that the graph G has no multiple edges. By Lemma 7, α G > 0.
(ii) Suppose that the graph G has at least one pair of vertices, say, v i , v j ∈ V ; i, j ∈ {1, . . . , n} with i = j, connected together by multiple edges. Erasing any one of those edges yields a graph l i,j −1 (G) ∈ V n,k−1,s loopless . By induction assumption, γ li,j −1 (G) > 0. Hence, applying the map l a i,j := l i,j • δ i,j to l i,j −1 (G) produces again the graph G. That is, α G > 0.
Lemma 17 Fix integers k ≥ 0, n ≥ 1 and s ≥ n. Let C ⊆ V n,k,s loopless denote an equivalence class. Let G = (V, K, E); E = E int ∪ E ext , together with the maps ϕ int and ϕ ext denote a graph in C . Assume that V ∩ ϕ ext (E ext ) = V . Let θ n,k,s = G∈V n,k,s loopless α G G ∈ V n,k,s loopless be defined by formula (4). Then, G∈C α G = 1/S C , where S C denotes the symmetry factor of every graph in C .
Proof: The proof proceeds by induction on the internal edge number m. Clearly, the statement holds for m = 0. We assume the statement to hold for a general number of internal edges m − 1. Consider the graph G = (V, K, E) ∈ C ; E = E int ∪ E ext , m := card(E int ) = k + n − 1, together with the maps ϕ int and ϕ ext . By Lemma 16, the coefficient of the graph G in θ n,k,s is positive: α G > 0. Moreover, S C = S C edge for the graph G ∈ C has no non-trivial vertex symmetries. We proceed to show that G∈C α G = 1/S C . To this end, choose any one of the m internal edges of the graph G ∈ C .
(i) If that internal edge is the only one connecting a given pair of vertices together, by Lemma 8, it adds 1/(m · S C ) to G∈C α G .
(ii) If that internal edge is one of the, say, 1 < ρ ≤ k + 1, multiple edges connecting together the vertices v i , v j ∈ V ; i, j ∈ {1, . . . , n} with i = j, assume that v i has r ≥ 1 external edges whose free ends are labeled x a1 , . . . , x ar , with 1 ≤ a 1 < · · · < a r ≤ s, while v j has r ≥ 1 external edges whose free ends are labeled x b1 , . . . , x b r , with 1 ≤ b 1 < · · · < b r ≤ s and a z = b z for all z ∈ {1, . . . , r}, z ∈ {1, . . . , r }. Erasing any one of the given internal edges yields a graph l i,j −1 (G) ∈ V n,k−1,s loopless whose symmetry factor is related to that of the graph G ∈ C via S li,j −1 (G) = S C /ρ. Let θ n,k−1,s = G * ∈V n,k−1,s loopless γ G * G * ; γ G * ∈ Q. Also, let A ⊆ V n,k−1,s loopless denote the equivalence class containing l i,j −1 (G). The map l a i,j := l i,j • δ i,j produces the graph G from the graph l i,j −1 (G) with coefficient α * G = γ li,j −1 (G) ∈ Q. Each vertex of the graph l i,j −1 (G) has at least one labeled external edge. Therefore, by induction assumption, G * ∈A γ G * = 1/S li,j −1 (G) = 1/S A . Now, take one graph (distinct from G) in C in turn, choose any one of the ρ internal edges connecting together the pair of vertices so that one vertex has r external edges whose free ends are labeled x a1 , . . . , x ar , while the other has r external edges whose free ends are labeled x b1 , . . . , x b r , and repeat the procedure above. We obtain Hence, according to formula (4), the contribution to G∈C α G is ρ/(m · S C ). Distributing this factor between the ρ internal edges considered yields 1/(m · S C ) for each internal edge.
We conclude that every one of the m internal edges of the graph G adds 1/(m · S C ) to G∈C α G . Therefore, the overall contribution is exactly 1/S C . This completes the proof.
This completes the proof of Theorem 15.

Alternative recursion formula
We give an alternative recursion formula for loopless connected graphs. The underlying algorithm is amenable to direct implementation using the algebraic representation of graphs defined in [5,6].
Theorem 18 Fix an integer s ≥ 0. Let L = {x 1 , . . . , x s } be a label set. For all integers k ≥ 0 and n ≥ 1, defineθ n,k,s ∈ QV n,k,s loopless by the following recursion relation: •θ 1,0,s is a single vertex with s external edges whose free ends are labeled x 1 , . . . , x s , and unit coefficient; •θ 1,k,s := 0, k > 0; •θ n,k,s := 1 Then, for fixed values of n and k,θ n,k,s = G∈V n,k,s loopless α G G; α G ∈ Q and α G > 0 for all G ∈ V n,k,s loopless . Moreover, G∈C α G = 1/S C , where C ⊆ V n,k,s loopless denotes an arbitrary equivalence of graphs class of graphs and S C denotes their symmetry factor.
Proof: As in the previous sections, every lemma given in Section 4 holds for θ n,k,s . Here, details are only given for the following two lemmas. graphs, two of which are isomorphic to the graph G. Clearly, the coefficient of each of these two graphs in that linear combination, is α G = β G 2(ρ−1)! ∈ Q. Each vertex of the graph G has at least one labeled external edge. Hence, by induction assumption, G ∈B β G = 1/S G = 1/S B . Now, take one graph (distinct from G) in C in turn, choose any one of the ρ internal edges connected to the vertex having r external edges whose free ends are labeled x a1 , . . . , x ar , and to the vertex having r external edges whose free ends are labeled x b1 , . . . , x b r , and repeat the procedure above. We obtain where the factor 2 on the right hand side of the first equality, is due to the fact that each graph in the equivalence class B generates two graphs in C . Therefore, according to formula (5), the contribution to G∈C α G is ρ/(m·S C ). Distributing this factor between the ρ internal edges considered yields 1/(m·S C ) for each edge.
We conclude that every one of the m internal edges of the graph G adds 1/(m · S C ) to G∈C α G . Hence, the overall contribution is exactly 1/S C . This completes the proof.
This completes the proof of Theorem 18.

Examples
We show the result of computing all mutually non-isomorphic loopless connected graphs without external edges as contributions to θ n,k,0 orθ n,k,0 via formulas (4) and (5), respectively, up to order n + k ≤ 5. The coefficients in front of graphs are the inverses of the orders of their groups of automorphisms.

Algorithmic considerations
The two algorithms underlying the recursive definitions (1) and (5) given in Sections 4 and 5.3.2, respectively, are amenable to direct implementation using the Hopf algebraic representation of graphs given in [5,6]. This representation can be used directly and efficiently in implementing concrete calculations of graphs. For a discussion of some algorithmic aspects of the recursive structure of formula (1) we refer the reader to Section IV of [6], and to Section VI C of [5] if only trees are considered. In the present section, we extend the results of those papers to loopless connected graphs.
An important aspect for the efficiency of concrete calculations is to discard graphs that do not contribute. For instance, assume that one is only interested in calculating loopless connected graphs so that all vertices have a minimum degree, say, ν > 1. In particular, in the recursive definition (5), the number of ends of edges assigned to a vertex changes after applying the maps q (ρ) i . The only graphs with degree 1 ≤ ρ ≤ k + 1 vertices are those produced by the maps s i when one of the new vertices receives no ends of edges at all. This, thus, acquires degree ρ after being connected to the other vertex with ρ internal edges. Hence, to eliminate the irrelevant graphs with degree ν < ν vertices, replace the maps q  (5), where the maps s i≥ν−ρ are defined as the maps s i except that the former are required to partition the set E i of ends of edges assigned to the vertex v i of a graph G, into two sets, each of cardinality equal or greater than ν − ρ and, s i≥ν−ρ (G) = 0 if 0 ≤ card(E i ) < 2(ν − ρ). Moreover, by Lemma 9, one can even impose independent lower bounds on the numbers of internal and external edges assigned to every vertex of a loopless connected graph with n > 1 vertices. In this context, suppose that one is interested in calculating all loopless connected graphs (up to a maximal cyclomatic number) with n > 1 vertices and s external edges, so that every vertex has minimum degree ν int + ν ext , where ν int > 1 and ν ext ≥ 0 are the minimum numbers of internal and external edges, respectively, assigned to every vertex of a graph. To this end, first, use the maps q (ρ) i ≥νint in formula (5) to calculate all loopless graphs with n > 1 vertices and no external edges, so that every vertex has minimum degree ν int . Then, use the map ξ Eext,V ≥νext , where card(V ) = n and card(E ext ) = s ≥ nν ext , to distribute s external edges between the vertices of each graph in all possible ways so that every vertex is assigned with at least ν ext external edges. Accordingly, the map ξ Eext,V ≥νext is defined as ξ Eext,V except that the former is required to partition the set E ext into n sets, each of cardinality equal or great than ν ext .