Decomposition
Decomposition
MATHEMATICS
ELSEVIER Discrete Mathematics 139 (1995) 257-271
Abstract
A simple decomposition for graphs yields generating functions for counting graphs by edges
and connected components. A change of variables gives a new interpretation to the Tutte
polynomial of the complete graph involving inversions of trees. The relation between the Tutte
polynomial of the complete graph and the inversion enumerator for trees is generalized to the
Tutte polynomial of an arbitrary graph. When applied to digraphs, the decomposition yields
formulas for counting digraphs and acyclic digraphs by edges and initially connected
components.
1. Introduction
,'/ II \ ~ ,
_// II
/// I I \ \ x A
// XxXX
H 1 H 2 Hk
Fig. 1.
I.M. Gessel/ Discrete Mathematics 139 (1995) 257-271 259
the p r o p e r t y that if A = { a 1 < a2 < ' . . < a.) and B = { b ~ < b z < " " < b, }, and G is a graph
in F with vertex set A then the graph obtained from G by replacing each al with b i is in
F, and it has the same weight as G. Note that we do not require that m e m b e r s h i p in
F depend only on i s o m o r p h i s m class. If F is a class of weighted graphs, its exponential
generatingfunction is the formal power series
~ Snn['
n=O
where s, is the sum of the weights of all graphs in F with vertex set [n] = ~1, 2 . . . . . n~.
The 'exponential formula' for graphs (see, e.g., [10]) asserts that if f(u) is the
exponential generating function for a class F of connected graphs, then e I(") is the
exponential generating function for graphs all of whose connected c o m p o n e n t s are in
F (where the weight of a graph is the product of the weights of its connected
components). It follows that m o r e generally (as long as f(u) does not contain x) the
coefficient of x j in e ~ " ) is the exponential generating function for graphs with
j components, each in F.
The exponential formula for graphs follows easily from the fact if
then
~m
where the sum is over all partitions { I/1 . . . . . Vk}, for all k, of the set In].
N o w let c,(y)=z.,cy,,e(c), where the sum is over all connected graphs C on [n] and
e(C) is the n u m b e r of edges of C. Then the exponential formula implies the well-
k n o w n formula
Theorem 1.
n=O
c,+ l(y) ~. = e x p ((l+y)"--l)c,,(y)~..
"1 (2)
Proofi Let A be a finite set of size n and suppose vq~A.The depth-first decomposition
gives a bijection from connected graphs on {v} w A with edges weighted by y, which
are counted by c,+ 1(Y), to the set of graphs on A with 'extra' edges, each associated
with a single vertex, with at least one extra edge in each component. Applying the
exponential formula yields the theorem. []
260 LM. Gessel/Discrete Mathematics 139 (1995) 257-271
It is an easy exercise, which we leave to the reader, to derive (2) algebraically from
(1). A recurrence equivalent to (2) was given by Leroux [13, p. 15], who also
generalized it to species. The special case y = 1 was stated by H a r a r a y and Palmer [10,
p. 8], who attributed it to John Riordan, though it does not a p p e a r in the p a p e r of his
that they cite [14].
Since every connected graph with n vertices has at least n - 1 edges, c.(y) is divisible
by y"-1. Thus we m a y define a polynomial I,(y) by
The polynomial l.(y) is called the inversion enumerator for trees because of its
combinatorial interpretation, which we describe below. If we replace u with u/y in (2)
and then replace y with y - 1 we obtain the following theorem.
T h e o r e m 2.
u" yr,__ 1
I. + 1(Y) n.T= exp I,,(y)
.=o " = y--1
It is clear from (4) that the coefficients of I,(y) are nonnegative and that I , ( - 1) is
also nonnegative. In the next section we give combinatorial interpretations to these
quantities.
3. Inversions in trees
We first recall some standard terminology for rooted trees. Let T b e a tree rooted at
a vertex v and let ct and fl be vertices of 7". We say that fl is a descendant of ct, if e lies on
the unique path from v to ft. If in addition e ¢ fl then we call fl a proper descendant of ct.
We consider every vertex to be a descendant of itself and of v. If fl is a descendant of e,
and e and fl are adjacent, we call e the parent of fl and we call fl a child of ct.
N o w let T be a rooted tree on a totally ordered vertex set. An inversion in T is a pair
(e, fl) of vertices of T such that fl is a descendant of ct and e > ft. If T has no inversions,
it is called increasing. We define inversions in an u n r o o t e d tree (with a totally ordered
vertex set) by rooting the tree at its least vertex.
The next result is due to Mallows and Riordan [14]. (See also [5].)
In view of the combinatorial interpretations we have for c,(y) and l,(y), it is natural
to ask for a combinatorial interpretation of (3). Such a combinatorial interpretation
has been given by Gessel and Wang [9], and the approach taken there, which is
further studied in [7], can be used to give combinatorial proofs of the generalizations
of (3) that follow.
From Theorem 2 we can derive a formula for I,(y) in terms of increasing trees. For
each vertex ~ of an increasing tree T, let cSr(~) be the number of descendants of ~,
including ~. By iterating the recurrence for l,(y) implied by Theorem 2, we can express
l.(y) as a sum of products of 1 + y + . . . + y l .
Theorem 4.
Theorem 5. I . ( - 1) is the number of increasin9 trees on In] in which every vertex other
than the root has an even number of children.
Proof. It follows from Theorem 4 that I . ( - 1) is the number of increasing trees on [hi
that have the following property: any subtree consisting of a nonroot vertex and all its
descendants contains an odd number of vertices. This is easily seen to be equivalent to
the condition stated in the theorem. []
A bijective proof of Theorem 5 has been given by Pansiot [15]. Kreweras [12] and
Gessel [6] derived from (4) that ~.~=o I, + 1 ( - 1 ) u " / n ! = sec u + tan u. Some analogous
formulas for counting other types of trees by inversions can be found in [8].
4. Arbitrary graphs
t
We can also apply the depth-first decomposition to arbitrary (not necessarily
connected) graphs. In the general case, if H is a graph rooted at v then the number of
connected components of H is one more than the number of depth-first components
of H which are not connected to v. Let s.(x, y) = Y~HxC~mYe~m, where the sum is over all
graphs H on In]; here c(H) is the number of connected components of H and e(H) is
262 I.M. Gessel/ Discrete Mathematics 139 (1995) 257-271
the number of edges of H. Thus c.(y) is the coefficient of x in s.(x, y). As is well known,
the exponential formula gives
Theorem 6.
Substituting Cm(y ) = ym-1 Ira(1 + y), replacing u with u/y, ana then replacing y with
y - 1 in (5), we get
Theorem 7.
tn+l(x,y)~..=exp
un Imp=1 ( x + y + y 2 + ' " + y m + l ) I r n ( y ) ~um
. 1. (7)
n=O
It follows from (7) that t.(x, y) is a polynomial with nonnegative integer coefficients
and that t.(1, y)--I.(y). From Theorem 7 we derive a combinatorial interpretation for
t.(x, y) that refines our interpretation for I.(y).
Theorem 8. The coefficient of xiy ~ in t.(x,y) is the number of trees T on [n] with
j inversions such that vertex 1 is adjacent to exactly i vertices which are less than all their
proper descendants.
Theorem 9. For any increasing tree T on [n], let N r be the set of vertices adjacent to 1.
Then
t.(x,y)=~ I-I ( x + Y + ' " + Y ~T~)-I)
1-I (I+y+y2+'"+Y~T~-I),
T ~tENT fiE{2..... n} -N r
where the sum is over all increasing trees T on [n].
I.M. Gessel/ Discrete Mathematics 139 (1995) 257-271 263
2 2
2
4 3 3
x (x+y)x x(x+y) x+y+y 2
4
(x + y + y2)(1 + y)
Fig. 2.
Theorem 9 is illustrated in Fig. 2, which shows the six increasing trees on { 1,2, 3, 41
and their contributions to t4(x,y)=2x+2y+3x2+4xy+3y2+x3+y 3.
From Theorem 9 it is easy to derive a combinatorial interpretation for the
coefficients of t,(x+ 1 , - 1), which we leave to the reader.
In the next section we shall find similar formulas to those given here, when we
restrict ourselves to the subgraphs of a fixed connected graph. In this more general
setting, what we have done so far is the case of complete graphs. We shall see that
t,(x, y) is the instance for the complete graph on n vertices of a well-known polynomial
called the Tutte polynomial, which is defined for any graph (and more generally for any
matroid). Most of the formulas we obtained for t,(x, y) and its specializations can be
generalized to the Tutte polynomial of an arbitrary graph.
Let G be a graph with vertex set V. We shall assume that G has no loops or multiple
edges, though most of our results will hold in a slightly modified form if they are
allowed.
We consider the polynomial
s6(x, y)= ~ xc¢n)ye(n),
H
where the sum is over all spanning subgraphs H of G; here c(H) is the number of
connected components of H and e(H) is the number of edges of H. Now every
spanning subgraph of G has at least as many connected components as G, so
c(H) >~c(G). Moreover, a subgraph withj components must have at least [ V [ - j edges.
Thus e(H)>~l V[-c(H). The difference e ( H ) - [ VI +c(H) is sometimes called the cycle
rank or cyelomatic number of H; it is the m a x i m u m number of edges that can be
removed from H without increasing the number of components.
264 I.M. Gessel/ Discrete Mathematics 139 (1995,) 257-271
and
Note that each of the three graph polynomials sG, re, and ta is multiplicative in the
sense that its value for any graph is the product of its values for the connected
components of the graph. Thus with no loss of generality, we assume from now on
that G is connected.
We now derive analogs for an arbitrary connected graph of the formulas of
Sections 2, 3 and 4. Instead of exponential generating functions, we get formulas
involving sums over partitions. First we fix a vertex v of G and consider the depth-first
decomposition applied to connected subgraphs of G rooted at v. We see that every
connected subgraph of G can be obtained uniquely by first choosing a partition
{V1,..., Vk} of V--{v}, and then choosing, for each i from 1 to k, a connected
subgraph H~ of G with vertex set V~ and a nonempty subset of the set of edges in
G joining V~to v. N o w let ca(y) count connected subgraphs of G by edges, so that ca(y)
is the coefficient of x in s~(x,y), and let l~(y)=ta(1, v). Then by (9),
Theorem lO.
k
ca(y)= 17 ((l + Y ) ~ v ' ) - l)c~fv,J(Y), (11)
V a , V 2 . . . . Vk i = 1
k
I6(y)= ~. l-[ ( I + Y + ' " + Y ~ t V ' ) - I ) I G t v , J ( Y ) , (12)
V I , V 2 . . . . VU i = 1
where the sums are over all partitions { V1, ... , Vk), ./'°r all k > 0 , of V -~t,~"~ with the
property that each G[ Vii] is connected. (We interpret 1 + y + ... + ym-1 as Ofor m=0.)
Proof. Eq. (11) follows immediately from the depth-first decomposition. Then from
(10) and (11) we have
We can conclude from (12) that Ia(y) has nonnegative coefficients and deduce from
it a combintorial interpretation for IG(y). It follows easily from (12) that I~(1) is the
number of spanning trees of G. To give a combinatorial interpretation to IG(y ) via (12)
in terms of a statistic on spanning trees of G, we need inductively a combinatorial
interpretation to each lotv,j(y ) (which may depend on the choice of a root for G [ V~]),
and then we need a bijection between {0, 1. . . . . et V/)-1} and the set of et V/) edges
joining Vii to v. The following way to do this seems to be the simplest: We start by
totally ordering V and we root G at its least vertex, say v. Now to any edge f = {2, fl I of
a spanning tree T, where 13 is the parent of ~, we define ~T(f) to be the number of
vertices that are descendants of 2 in T, are less than ~, and are adjacent to 13 in G. We
define ~:(T) to be Z f ~¢r(f), where the sum is over all edges f of T.
It is easily seen that if G is a complete graph then ~:(T) is the number of inversions of
T. In the general case, ~:(T) may also be described as the number of inversions (2,/3) of
T such that the parent of 2 is adjacent in G to 13. Then we have the following
generalization of Theorem 3.
Theorem 11. The coefficient of y i in IG(y) is the number of spanning trees T of G with
K(T)=i.
Theorem 12. For any vertex 2 # v of a spanning tree T of G, let 6T, a(2) be the number of
descendants of ~ in T (including ~) that are adjacent in G to the parent of 2. Then
where the sum is over all spanning trees T of G with ~c(T)=0. Moreover, I G ( - 1) is the
number of spanning trees G of G with ~c(T)=0 and such that 6r, o(~) is odd for every
nonroot vertex ~ of T.
Franqois Jaeger [11] has pointed out that if M is any matroid without loops then
a simple deletion-contraction argument shows that tM(1, - 1) is nonnegative. Thus by
duality, if G is a graph with no isthmuses, t G ( - 1 , 1) is nonnegative. It would be
interesting to find a natural combinatorial interpretation to this quantity.
The generalization of Theorem 6 is completely straightforward.
Theorem 13.
k
sG(x,y)=x ~ 1-[ ((1 +y),~v,)_ 1 +x)s~Ev,l(1,y) (14)
V I , V 2 . . . . Vk i = 1
and the coefficient of x~y ~ in to(x, y) is the number of spanning trees T of G with ~( T)=j
and such that ~cr(f)=O for exactly ledges f incident with v.
6. Digraphs
We call a rooted digraph initially connected if there is a (directed) path from the root
to every other vertex. As usual, if a digraph on a totally ordered vertex set does not
already have a root, we root it at its least vertex.
Any digraph D on a totally ordered vertex set has a decomposition into initially
connected components: the first initially connected component of D is the induced
subdigraph on the set of all vertices reachable from the least vertex of D, and in
general, if the first i - 1 initially connected components of D do not contain all the
vertices of D, the ith initially connected component is the first initially connected
component of the digraph obtained from D by removing the first i - 1 initially
connected components and their incident edges. Note that in addition to edges within
initially connected components, a digraph may have edges from the jth initially
connected component to the ith for i < j.
In counting digraphs by edges, we shall use generating functions of the form
~n ,
,=o (1 +y)(~)n!
which we call graphic generating functions. (Here, as before, edges are weighted by y.)
There is an exponential formula for graphic generating functions: If f(u) is the graphic
generating function for a class of initially connected digraphs then e :~u) is the graphic
generating function for digraphs each of whose initially connected components is in
the class. Thus, for example, the graphic generating function for initially connected
digraphs is
log (1 + y ) . ( . - ~ ) . (17)
L.=o (1 + ~ n !
We will actually need a slightly more general form: Suppose we have a class A of
nonempty rooted initially connected digraphs, with graphic generating function f(u).
Then e s(u) is the graphic generating function for digraphs that can be obtained by
taking digraphs D1,D2 . . . . . Dk in A, rooted respectively at vl <v2 <---<t'k, and for
each i < j adding an arbitrary subset of the edges from Dj to Di. (Note that we do not
require that vi be the least vertex in D~.)
The exponential formula for graphic generating functions may be stated in a less
combinatorial but more precise form that is an immediate consequence of the
analogous formula for exponential generating functions. Let
Then
where the sum is over all partitions { V1 . . . . . Vk}, for all k, of the set [n], and
2
l<~i<j<~k
One might try to define the depth-first components of a digraph to be the initially
connected components after the root is removed, but a slightly more complicated
definition is necessary: Let D be a digraph on a totally ordered vertex set, rooted at v.
Let va be the least vertex adjacent from v. Let D1 be the induced subgraph on the set of
vertices reachable from vl without passing through v, and more generally, let vi be the
least vertex adjacent from v that is not in D1 u ... • Di_ 1, and let D~ be the set of all
vertices not in {v}uDlw...wDi_l that are reachable from vi without going
through v.
The depth-first components of D are then defined to be the digraphs Di
together with the initially connected components of D not containing v. If there are
k depth-first components reachable from v, let us call the additional ones
Dk+ 1 . . . . . Dk+ I. Note that for 1 <<.i<~k,vi is the least vertex in Di adjacent from v. If we
root D~ at v~ for 1 ~<i~<k and at the least vertex for k + 1 ~<i~<k + l then each Di is
initially connected.
The edges of D that are not in some depth-first component are of two types:
(i) edges incident with v (which can go in either direction) and (ii) edges from some Dj
to some Di with i <j. Note also that D is acyclic if and only if each Di is acyclic and
v has incoming edges only from the components Dk+ 1 . . . . . D k + l .
A digraph and its depth-first components are shown in Fig. 3.
N o w let d,(x, y)= Y~oxCtmyet°), where the sum is over all digraphs D on In]; c(D) is
the number of initially connected components of D and e(D) is the number of edges of
D. Let e,(y) be the coefficient of x in d,(x, y) so that e,(y) counts initially connected
digraphs.
Fig. 3.
1.M. Gessel/Discrete Mathematics 139 (1995) 257-271 269
Theorem 15.
un
e.+ l(y}
,=o (1 +y)(~)n!
=xexp [£ ,.=1
(1 + y)"((1 + y ) " - 1 +x)e,,,(y) --
(1 +y)('2)m!
. (19)
Proof. Since (18) follows immediately from (19), we prove only (19). We construct
a digraph on [-n + 1] by constructing its depth-first c o m p o n e n t s and connecting them
with edges appropriately. We first partition {2 . . . . . n + 1 } into blocks V1 . . . . . Vk+ t- For
each block Vii with 1 ~<i~<k, we pick a n o n e m p t y subset Ui and edges from 1 to the
elements of Ui. We now let vi be the least element of Ui for 1 <~i<~k and the least
element of V~ for k + 1 ~ i ~<k + l. Next for each i we construct an initially connected
digraph on V~, rooted at vl. Without loss of generality, we m a y assume that the blocks
are ordered so that vl<...<vk and V k + l < ' " < V k + ~ . Then for each i<j we take an
arbitrary subset of the set of edges from ~ to V~.
The digraph we obtain by this construction will have V~ . . . . . Vk+l as its depth-first
components, and will have l + 1 initially connected components. The generating
function identity (19) is an immediate consequence. [3
It follows from T h e o r e m 15 that d.(x, y ) = (1 + y)(~s,(x, y). This can also be derived
from
~ d"(x'Y)(1 + y)(~)nt
.=o . = (1 +y)(~)m! J
Theorem 16.
a.+l(x,y) u"
.=o (1 +y)(~)n!
Proof. We prove only (21), from which (20) follows easily. The proof is similar to that
of Theorem 15, so we need only explain the term ((1 + x)(1 + y ) " - 1)b,.(y), which must
be interpreted as the sum of ((1 +y)m__ 1)b,.(y) and x(1 +y)mbm(y). We proceed as in
the proof of Theorem 15, partitioning {2. . . . . n + 1} into blocks which are to be the
depth-first components of an acyclic digraph on [n]. Let V be a block of size m. If V is
to be reachable from 1, then we choose a nonempty subset U of V and add edges from
1 to the elements of U, and construct an initially connected acyclic digraph on
V rooted at the least element of U. The sum of the weights of these digraphs will be
((1 + y ) " - 1)b,.(y). If Vis to be unreachable from 1, we choose an arbitrary subset U of
V and add edges from the elements of U to 1. We then construct an initially connected
cyclic digraph on V rooted at the least element of V (not U). The contribution of these
digraphs will be x(1 +y)r"bm(y ). []
and it follows that y("~ b i ( y - 1 ) = I.(y), so that ]-.(y)=y("~ 1)I.(y-1), as shown in [9].
Similarly, by comparing (21) with (5) we find that
References
[1] J.S. Beissinger,On external activityand inversionsin trees,J. Combin. Theory Ser. B 33 (1982)87-92.
[2] N. Biggs,Algebraic Graph Theory (Cambridge University Press, Cambridge, 1974).
1.M. Gessel/ Discrete Mathematics 139 (1995) 2 5 ~ 2 7 1 271
[3] A. Bj6rner, The homology and shellability of matroids and geometric lattices, in: N. White, ed.,
Matroid Applications, Encyclopedia of Mathematics and its Applications, Vol. 40 (Cambridge
University Press, 1991) 226-283.
[4] T. Brylawski and J. Oxley, The Tutte polynomial and its applications, in: N. White, ed., Matroid
Applications, Encyclopedia of Mathematics and its Applications, Vol. 40 (Cambridge University
Press, 1991) 123-225.
[5] D. Foata, La s6rie g~n~ratrice exponentielle dans les probl~mes d'~num~ration, Presses de l'Universit6
de Montr6al, 1974.
[6] 1. Gessel, A noncommutative generalization and q-analog of the Lagrange inversion formula, Trans.
Amer. Math. Soc. 257 (1980) 455-482.
[7] I.M. Gessel and B.E. Sagan, The Tutte polynomial of a graph, depth-first search, and simplicial
complex partitions, preprint.
[8] I.M. Gessel, B.E. Sagan and Y.-N. Yeh, Enumeration of trees by inversions, J. Graph Theory, to be
published.
[9] I.M. Gessel and D.-L. Wang, Depth-first search as a combinatorial correspondence, J. Combin.
Theory Ser. A 26 (1979) 308-313.
[10] F. Harary and E.M. Palmer, Graphical Enumeration IAcademic Press, New York, 1973).
[11] F. Jaeger, Personal communication.
[12] G. Kreweras, Une famille du polyn6mes ayant plusieurs propriet6s 6numeratives, Period. Math.
Hungar. 11 (1980) 309-320.
[13] P. Leroux, Methoden der Anzahlbestimmung f/Jr einege Klassen von Graphen, Bayreuth. Math. Schr.
26 (1988) 1-36.
[14] C.L. Mallows and J. Riordan, The inversion enumerator for labeled trees, Bull Amer. Math. Soc. 74
(1968) 92-94.
[15] J.-J. Pansiot, Nombres d'Euler et inversions dans les arbres, European J. Combin. 3 (1982) 259-262.
[16] W.T. Tutte, A contribution to the theory of chromatic polynomials, Canad. J. Math. 6 (1953) 80-91.