**3. Generating functions and analytic combinatorics overview**

In this section of the chapter, we are going to make a revision of the basic mathematical tools that have been developed and that facilitate the solution of many combinatorial enumeration problems. We are going to start with some basic conceptual definitions that can be found in many textbooks about this topic. In order to be able to clearly expose the mathematical tools used, it will be necessary to make use of some basic concepts about them that can be consulted more widely in texts such as [3]. One of these basic notions that can be found in [3] is the concept of *combinatorial class* whose definition is as follows:

Definition 1.1 A combinatorial class is a finite or denumerable set in which a size function is defined, satisfying the following conditions:

i. The size of an element is a nonnegative integer.

ii. The number of elements of any given size is finite.

On the other hand, it is necessary to know if two *combinatorial classes* are related in any way which can be determined using the concept of *isomorphism* and that can be defined as follows:

Definition 1.2 The combinatorial classes A and B are said to be (combinatorially) isomorphic which is written A ffi B if and only if their counting sequences are identical. This condition is equivalent to the existence of a bijection from A to B that preserves size, and one also says that A and B are bijectively equivalent.

The notion of ordinary generating functions (OGF) as P<sup>∞</sup> *<sup>i</sup>*¼<sup>0</sup> *aixi* where the coefficients *ai* are elements of the sequence A ¼ f g *a*0*; a*1*;* … or combinatorial class A. This function is also the generating function of the numbers A*<sup>n</sup>* whose sizes *an* ¼ cardð Þ A*<sup>n</sup>* such that the OGF of class A admits the combinatorial form

$$A(\mathfrak{x}) = \sum\_{a \in \mathcal{A}} \mathfrak{x}^{|a|}. \tag{1}$$

This means that the variable *x* marks size in the generating function. The OGF form (1) can be easily interpreted by observing that the term *xn* occurs as many times as there are objects in A of size *n*. A basic operation that can be defined is the one that allows to extract the coefficient of the term *xn* in the power series *A x*ð Þ¼ <sup>P</sup>*anx<sup>n</sup>* as follows:

$$[\boldsymbol{\pi}^n] \left(\sum\_{n\geq 0} a\_n \boldsymbol{\pi}^n\right) = a\_n. \tag{2}$$

then ð Þ *<sup>x</sup>*þ<sup>1</sup>

*h x*ð Þ¼ *g x*ð Þ� *<sup>x</sup>*<sup>2</sup> <sup>¼</sup> <sup>1</sup>

functions, we get

where <sup>2</sup>*<sup>x</sup>*

relation

*<sup>x</sup>*<sup>2</sup> <sup>¼</sup> <sup>1</sup>� ffiffi 5 p

have that

**225**

function of the succession 02

*Combinatorial Enumeration of Graphs DOI: http://dx.doi.org/10.5772/intechopen.88805*

ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup> is the generating function of the succession 12

some element of an associated succession. For example, if *g x*ð Þ¼ <sup>1</sup>

succession 1*;* 1*;* 0*;* 1*;* 1*;* 1*,* …. By the other side, if we know that *x x*ð Þ <sup>þ</sup><sup>1</sup>

*,* 1<sup>2</sup> *,* 22 *,* 3<sup>2</sup>

*x x*ð Þ þ 1 ð Þ <sup>1</sup> � *<sup>x</sup>* <sup>3</sup> <sup>þ</sup>

the coefficient extracting operator defined by 2, we can say that

that is the coefficient of *xn* in the expansion of the function

<sup>1</sup> � *<sup>x</sup>* � *<sup>x</sup>*<sup>2</sup> <sup>¼</sup> <sup>1</sup>

<sup>5</sup> <sup>p</sup> <sup>1</sup> � <sup>1</sup> <sup>þ</sup> ffiffi

*f x*ð Þ¼ *<sup>x</sup>*

*Fn* <sup>¼</sup> <sup>1</sup> ffiffi

manipulations that can be done with the generating functions allow us to cancel

function of the succession 0*;* 1*;* 2*;* 3*;* 4*,* …, then if we add these two generating

ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup> becomes the generating function of the succession

*xn* ½ � <sup>2</sup>*<sup>x</sup>*

*x* ð Þ 1 � *x*

<sup>0</sup>*;* <sup>2</sup>*;* <sup>6</sup>*;* <sup>12</sup>*;* <sup>20</sup>*;* <sup>30</sup>*;* <sup>42</sup>*,* … whose *<sup>n</sup>*th element can be expressed as *an* <sup>¼</sup> *<sup>n</sup>*<sup>2</sup> <sup>þ</sup> *<sup>n</sup>*. If we use

As an example, let us take the sequence 0*;* 1*;* 1*;* 2*;* 3*;* 5*;* 8*;* 13*;* 21*;* 34*;* 55*,* … know as Fibonacci numbers. This succession can be generated by applying the recurrence

The goal is to obtain *n*th element of the succession of numbers generated by 12

*x*

<sup>2</sup> . Given that the generating function of the Fibonacci succession is 13, we

1 <sup>1</sup> � <sup>1</sup><sup>þ</sup> ffiffi 5 p <sup>2</sup> *x*

as a power series about the origin. The roots of 1 � *<sup>x</sup>* � *<sup>x</sup>*<sup>2</sup> are *<sup>x</sup>*<sup>1</sup> <sup>¼</sup> <sup>1</sup><sup>þ</sup> ffiffi

ffiffi 5 p

and the *n*th term of the Fibonacci succession is expressed in closed form as

5 p 2 � �*<sup>n</sup>*

The calculation of the n-th term of the Fibonacci sequence by using power series allows us to obtain a mathematical closed formula. Because of that we can calculate the n-th term of the Fibonacci sequence in a more efficient way given that the computer program to do it will consist in the direct application of the closed mathematical expression obtained, which is much more efficient than using a computer program based on the application of the Fibonacci recurrence.

*,* 1<sup>2</sup> *,* 22 *,* 3<sup>2</sup>

ð Þ <sup>1</sup>�*<sup>x</sup>* � *<sup>x</sup>*2, then *h x*ð Þ becomes the generating function of the

<sup>2</sup> <sup>¼</sup> <sup>2</sup>*<sup>x</sup>*

*Fn*þ<sup>1</sup> ¼ *Fn* þ *Fn*�<sup>1</sup> where *n*≥1*, F*<sup>0</sup> ¼ 0*, F*<sup>1</sup> ¼ 1*:* (12)

*,* … and that *<sup>x</sup>*

is the generating function of the succession 02

*,* 2<sup>2</sup> *,* 3<sup>2</sup>

ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>2</sup> is the generating

ð Þ <sup>1</sup> � *<sup>x</sup>* <sup>3</sup> <sup>¼</sup> *<sup>n</sup>*<sup>2</sup> <sup>þ</sup> *<sup>n</sup>* (11)

<sup>1</sup> � *<sup>x</sup>* � *<sup>x</sup>*<sup>2</sup> (13)

� <sup>1</sup> <sup>1</sup> � <sup>1</sup>� ffiffi 5 p <sup>2</sup> *x*

5 p 2 � �*<sup>n</sup>* " # (15)

" #

� <sup>1</sup> � <sup>1</sup> � ffiffi

5 p <sup>2</sup> and

(14)

ð Þ <sup>1</sup> � *<sup>x</sup>* <sup>3</sup> (10)

*,* … Other simple

*,* …, and *x x*ð Þ <sup>þ</sup><sup>1</sup> ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup>

ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup> is the generating

ð Þ <sup>1</sup>�*<sup>x</sup>* and

The concept of generating function can then be defined as: Definition 1.3 Let be *a*0*, a*0*,* … a succession of real numbers. The function

$$f(\mathbf{x}) = a\_0 + a\_1 \mathbf{x} + a\_2 \mathbf{x}^2 + \dots = \sum\_{i=0}^{\infty} a\_i \mathbf{x}^i \tag{3}$$

is the generating function of the given succession.

The idea comes from the development of Newton's binomial that con be defined as:

Definition 1.4

$$(\mathbf{1} + \mathbf{x})^n = \binom{n}{0} + \binom{n}{1}\mathbf{x} + \binom{n}{2}\mathbf{x}^2 + \dots + \binom{n}{n}\mathbf{x}^n \tag{4}$$

which is the generating function of the succession

$$\binom{n}{0}, \binom{n}{1}, \binom{n}{2}, \binom{n}{3}, \dots, \binom{n}{n}, 0, 0, 0, \dots \tag{5}$$

We can say, for example, that

$$\sum\_{i=0}^{n} \mathbf{x}^{i} = \mathbf{1} + \mathbf{x} + \mathbf{x}^{2} + \mathbf{x}^{3} + \dots + \mathbf{x}^{n} = \frac{\mathbf{1} + \mathbf{x}^{n+1}}{\mathbf{1} - \mathbf{x}} \tag{6}$$

is the generating function of the succession 1*;* 1*;* 1*,* …*,* 1*;* 0*;* 0*;* 0*,* … where the first *n* þ 1 terms are equal to 1. The upper limit of the generating function 6 can be extended to ∞ which is known as geometric series. This series is known to be convergent if *x*<1 and that case can be defined as

$$\sum\_{i=0}^{\infty} \mathbf{x}^i = \mathbf{1} + \mathbf{x} + \mathbf{x}^2 + \mathbf{x}^3 + \dots + = \frac{\mathbf{1}}{\mathbf{1} - \mathbf{x}} \tag{7}$$

which is the geometric series of the succession 1*;* 1*;* 1*,* …. One of the nice properties of the generating functions is that they can be easily manipulated due to the fact that they are infinite polynomials.

For instance, if we take the first derivative of the generating function 7, we get

$$\frac{d}{dx}\frac{1}{1-x} = \frac{d}{dx}\left(1+x+x^2+x^3+...\right) = 1+2x+3x^2+4x^3+... = \frac{1}{\left(1-x\right)^2} \tag{8}$$

then <sup>1</sup> ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>2</sup> is the generating function of the succession 1*;* <sup>2</sup>*;* <sup>3</sup>*;* <sup>4</sup>*,* …, while *<sup>x</sup>* ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>2</sup> is the generating function of the succession 0*;* 1*;* 2*;* 3*;* 4*,* …. Similarly if we take the first derivative of the generating function *<sup>x</sup>* ð Þ <sup>1</sup>�*<sup>x</sup>* 2, we get

$$\frac{d}{d\mathbf{x}}\frac{\mathbf{x}}{\left(\mathbf{1}-\mathbf{x}\right)^{2}} = \frac{d}{d\mathbf{x}}\left(\mathbf{0} + \mathbf{x} + 2\mathbf{x}^{2} + 3\mathbf{x}^{3} + 4\mathbf{x}^{4} + \dots\right) = \frac{\left(\mathbf{x} + \mathbf{1}\right)}{\left(\mathbf{1} - \mathbf{x}\right)^{3}}\tag{9}$$

*Combinatorial Enumeration of Graphs DOI: http://dx.doi.org/10.5772/intechopen.88805*

*<sup>x</sup><sup>n</sup>* ½ � <sup>X</sup> *n*≥0

The concept of generating function can then be defined as:

is the generating function of the given succession.

0 � �

which is the generating function of the succession

*, <sup>n</sup>* 1 � � þ

*, <sup>n</sup>* 2 � �

ð Þ <sup>1</sup> <sup>þ</sup> *<sup>x</sup> <sup>n</sup>* <sup>¼</sup> *<sup>n</sup>*

*n* 0 � �

We can say, for example, that

that they are infinite polynomials.

derivative of the generating function *<sup>x</sup>*

*x* ð Þ 1 � *x*

<sup>2</sup> <sup>¼</sup> *<sup>d</sup>*

*d dx*

*d dx*

**224**

1 <sup>1</sup> � *<sup>x</sup>* <sup>¼</sup> *<sup>d</sup>*

then <sup>1</sup>

X*n i*¼0

convergent if *x*<1 and that case can be defined as

X∞ *i*¼0

defined as:

Definition 1.4

*Probability, Combinatorics and Control*

*anxn* !

Definition 1.3 Let be *a*0*, a*0*,* … a succession of real numbers. The function

*f x*ð Þ¼ *<sup>a</sup>*<sup>0</sup> <sup>þ</sup> *<sup>a</sup>*1*<sup>x</sup>* <sup>þ</sup> *<sup>a</sup>*2*x*<sup>2</sup> <sup>þ</sup> … <sup>¼</sup> <sup>X</sup><sup>∞</sup>

The idea comes from the development of Newton's binomial that con be

*n* 1 � �

*x* þ

*, <sup>n</sup>* 3 � �

*<sup>x</sup><sup>i</sup>* <sup>¼</sup> <sup>1</sup> <sup>þ</sup> *<sup>x</sup>* <sup>þ</sup> *<sup>x</sup>*<sup>2</sup> <sup>þ</sup> *<sup>x</sup>*<sup>3</sup> <sup>þ</sup> … <sup>þ</sup> *xn* <sup>¼</sup> <sup>1</sup> <sup>þ</sup> *xn*þ<sup>1</sup>

is the generating function of the succession 1*;* 1*;* 1*,* …*,* 1*;* 0*;* 0*;* 0*,* … where the first

*n* þ 1 terms are equal to 1. The upper limit of the generating function 6 can be extended to ∞ which is known as geometric series. This series is known to be

*xi* <sup>¼</sup> <sup>1</sup> <sup>þ</sup> *<sup>x</sup>* <sup>þ</sup> *<sup>x</sup>*<sup>2</sup> <sup>þ</sup> *<sup>x</sup>*<sup>3</sup> <sup>þ</sup> …þ ¼

which is the geometric series of the succession 1*;* 1*;* 1*,* …. One of the nice properties of the generating functions is that they can be easily manipulated due to the fact

For instance, if we take the first derivative of the generating function 7, we get

*dx* <sup>1</sup> <sup>þ</sup> *<sup>x</sup>* <sup>þ</sup> *<sup>x</sup>*<sup>2</sup> <sup>þ</sup> *<sup>x</sup>*<sup>3</sup> <sup>þ</sup> … � � <sup>¼</sup> <sup>1</sup> <sup>þ</sup> <sup>2</sup>*<sup>x</sup>* <sup>þ</sup> <sup>3</sup>*x*<sup>2</sup> <sup>þ</sup> <sup>4</sup>*x*<sup>3</sup> <sup>þ</sup> … <sup>¼</sup> <sup>1</sup>

ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>2</sup> is the generating function of the succession 1*;* <sup>2</sup>*;* <sup>3</sup>*;* <sup>4</sup>*,* …, while *<sup>x</sup>*

ð Þ <sup>1</sup>�*<sup>x</sup>* 2, we get

*dx* <sup>0</sup> <sup>þ</sup> *<sup>x</sup>* <sup>þ</sup> <sup>2</sup>*x*<sup>2</sup> <sup>þ</sup> <sup>3</sup>*x*<sup>3</sup> <sup>þ</sup> <sup>4</sup>*x*<sup>4</sup> <sup>þ</sup> … � � <sup>¼</sup> ð Þ *<sup>x</sup>* <sup>þ</sup> <sup>1</sup>

the generating function of the succession 0*;* 1*;* 2*;* 3*;* 4*,* …. Similarly if we take the first

*n* 2 � �

*,* …*, <sup>n</sup> n* � �

¼ *an:* (2)

*aixi* (3)

*xn* (4)

(6)

(7)

<sup>2</sup> (8)

ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>2</sup> is

ð Þ 1 � *x*

ð Þ <sup>1</sup> � *<sup>x</sup>* <sup>3</sup> (9)

*i*¼0

*<sup>x</sup>*<sup>2</sup> <sup>þ</sup> <sup>⋯</sup> <sup>þ</sup>

*n n* � �

1 � *x*

1 1 � *x*

*,* 0*;* 0*;* 0*,* … (5)

then ð Þ *<sup>x</sup>*þ<sup>1</sup> ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup> is the generating function of the succession 12 *,* 2<sup>2</sup> *,* 3<sup>2</sup> *,* …, and *x x*ð Þ <sup>þ</sup><sup>1</sup> ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup> is the generating function of the succession 02 *,* 1<sup>2</sup> *,* 22 *,* 3<sup>2</sup> *,* … Other simple manipulations that can be done with the generating functions allow us to cancel some element of an associated succession. For example, if *g x*ð Þ¼ <sup>1</sup> ð Þ <sup>1</sup>�*<sup>x</sup>* and *h x*ð Þ¼ *g x*ð Þ� *<sup>x</sup>*<sup>2</sup> <sup>¼</sup> <sup>1</sup> ð Þ <sup>1</sup>�*<sup>x</sup>* � *<sup>x</sup>*2, then *h x*ð Þ becomes the generating function of the succession 1*;* 1*;* 0*;* 1*;* 1*;* 1*,* …. By the other side, if we know that *x x*ð Þ <sup>þ</sup><sup>1</sup> ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup> is the generating function of the succession 02 *,* 1<sup>2</sup> *,* 22 *,* 3<sup>2</sup> *,* … and that *<sup>x</sup>* ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>2</sup> is the generating function of the succession 0*;* 1*;* 2*;* 3*;* 4*,* …, then if we add these two generating functions, we get

$$\frac{\varkappa(\varkappa+1)}{\left(1-\varkappa\right)^{3}} + \frac{\varkappa}{\left(1-\varkappa\right)^{2}} = \frac{2\varkappa}{\left(1-\varkappa\right)^{3}}\tag{10}$$

where <sup>2</sup>*<sup>x</sup>* ð Þ <sup>1</sup>�*<sup>x</sup>* <sup>3</sup> becomes the generating function of the succession <sup>0</sup>*;* <sup>2</sup>*;* <sup>6</sup>*;* <sup>12</sup>*;* <sup>20</sup>*;* <sup>30</sup>*;* <sup>42</sup>*,* … whose *<sup>n</sup>*th element can be expressed as *an* <sup>¼</sup> *<sup>n</sup>*<sup>2</sup> <sup>þ</sup> *<sup>n</sup>*. If we use the coefficient extracting operator defined by 2, we can say that

$$\left[\mathfrak{x}^{n}\right]\frac{2\mathfrak{x}}{\left(1-\mathfrak{x}\right)^{3}}=n^{2}+n\tag{11}$$

As an example, let us take the sequence 0*;* 1*;* 1*;* 2*;* 3*;* 5*;* 8*;* 13*;* 21*;* 34*;* 55*,* … know as Fibonacci numbers. This succession can be generated by applying the recurrence relation

$$F\_{n+1} = F\_n + F\_{n-1} \text{ where } n \ge 1, \ F\_0 = 0, \ F\_1 = 1. \tag{12}$$

The goal is to obtain *n*th element of the succession of numbers generated by 12 that is the coefficient of *xn* in the expansion of the function

$$\frac{\pi}{1-\varkappa-\varkappa^2} \tag{13}$$

as a power series about the origin. The roots of 1 � *<sup>x</sup>* � *<sup>x</sup>*<sup>2</sup> are *<sup>x</sup>*<sup>1</sup> <sup>¼</sup> <sup>1</sup><sup>þ</sup> ffiffi 5 p <sup>2</sup> and *<sup>x</sup>*<sup>2</sup> <sup>¼</sup> <sup>1</sup>� ffiffi 5 p <sup>2</sup> . Given that the generating function of the Fibonacci succession is 13, we have that

$$f(\mathbf{x}) = \frac{\mathbf{x}}{1 - \mathbf{x} - \mathbf{x}^2} = \frac{1}{\sqrt{5}} \left[ \frac{1}{1 - \frac{1 + \sqrt{5}}{2}\mathbf{x}} - \frac{1}{1 - \frac{1 - \sqrt{5}}{2}\mathbf{x}} \right] \tag{14}$$

and the *n*th term of the Fibonacci succession is expressed in closed form as

$$F\_n = \frac{1}{\sqrt{5}} \left[ \left( 1 - \frac{1 + \sqrt{5}}{2} \right)^n - \left( 1 - \frac{1 - \sqrt{5}}{2} \right)^n \right] \tag{15}$$

The calculation of the n-th term of the Fibonacci sequence by using power series allows us to obtain a mathematical closed formula. Because of that we can calculate the n-th term of the Fibonacci sequence in a more efficient way given that the computer program to do it will consist in the direct application of the closed mathematical expression obtained, which is much more efficient than using a computer program based on the application of the Fibonacci recurrence.

In [4] the problem of the various results that can be obtained using generating functions is addressed. The authors of [4] say that by using the tool of generating functions for obtaining the *n*th element of a succession, sometimes an exact formula can be obtained easily, and if it is not the case, a good estimation of the *n*th element can be obtained. It can happen also that we get a recurrence formula from where a generating function can be obtained, or it can happen that from the generating function a new recurrence is obtained giving us a deeper understanding about the succession. The use of generating functions provides statistical information about the succession. The authors of [4] also point out that when it is very difficult to mathematically obtain the n-th term of a given sequence as a closed mathematical expression, a good option is to use asymptotic methods to obtain an estimate of that term. For example, the *n*th prime number is approximately *n* log *n* when *n* is very big. The authors of [4] also also point out that using generating functions some properties of a succession such as unimodality or convexity can be proven. Another advantage of using generating functions is that some identities as, for example,

$$\sum\_{j=0}^{n} \binom{n}{j}^2 = \binom{2n}{n} \ (n = 0, 1, 2, \ldots),\tag{16}$$

In this chapter, there will be a particular interest in the application of generating functions tool for the enumeration of graphs that have some given properties. Let us start with the definition of a graph. A graph *G* ¼ h i *V; E* is a structure

n o n o if *<sup>G</sup>* is undirected or a set of ordered pairs of

whose edge set size is ∣*E*∣ ¼ *q*, that has no loops and that has no loops multiple edges. A graph *G* with *p* vertices and *q* edges is called a ð Þ *p; q* graph. In a labeled graph of order *p*, each vertex has a label that is an integer from 1 to *p*. Typical questions such as how many graphs can be constructed with *n* vertices, how many trees with *n* vertices can be obtained, and how many of these trees are binary can be answered using the generating functions, and a mathematically closed formula can be

obtained. In the case that a closed mathematical formula is very hard to be obtained,

There are two commonly used generating functions: the first is the ordinary generating functions (OFG) and the other is the exponential generating functions

An ordinary generating function is a mathematical function defined by the

*k*¼0

where the coefficients are elements of the succession of numbers *a*0*, a*1*, a*2*,* …. The ordinary generating functions are used for enumeration problems where the order of the objects is not important. An exponential generating function is a

> *k*¼0 *bk xk k*!

where the coefficients are elements of the succession of numbers *b*0*, b*1*, b*2*,* …. The exponential generating function are used for enumeration problems where the order of the objects matter. Graphs, words, trees, or integer partitions are some of the kinds of objects with which combinatorics deals. Combinatorics deals with discrete objects as, for example, graphs, words, trees, and integer partitions. Counting such objects is one of the most interesting tasks. Enumeration of graphs that have some structural property is the main purpose of the present chapter. The great mathematician George Pólya made huge contributions to the field of graph enumeration graphs. He obtained closed mathematical expressions for the enumeration of graphs with a given number of vertices and edges for many graph counting problems using group theory [7]. Pólya's formulas greatly facilitated the enumeration of rooted graphs, connected graphs, etc. The enumeration of number of triangulations of certain plane polygons was one of the first problems of enumeration that attracted the attention of the great mathematician Leonhard Euler [8] in the eighteenth century. Some years later, Kirchhoff in [9] discovered a method for enumerating spanning trees in a connected graph. After that, Arthur Cayley obtained a closed mathematical formula that enumerates labeled trees, rooted trees, and ordinary trees in [10]. The Cayley discovery will be covered with more detail in

*akxk*

*,* (17)

*,* (18)

*a x*ð Þ¼ <sup>X</sup><sup>∞</sup>

*b x*ð Þ¼ <sup>X</sup><sup>∞</sup>

of *G* and a set of unordered pairs of adjacent vertices, called edges,

*q*

an accurate asymptotic estimation formula can be a good option.

mathematical function defined by the following expression:

2 � �*;* …*; viq ; vj*

1 � �*; vi*<sup>2</sup> *; vj*

� � whose size <sup>∣</sup>*V*<sup>∣</sup> <sup>¼</sup> *<sup>p</sup>* it is called the order

*q* n o � � , if *<sup>G</sup>* is a directed graph,

with a set of vertices *V* ¼ *v*1*; v*2*;* …*; vp*

*Combinatorial Enumeration of Graphs DOI: http://dx.doi.org/10.5772/intechopen.88805*

> 2 � �*;* …*; viq ; vj*

*E* ¼ *vi*<sup>1</sup> *; vj*

(EGF).

**227**

following expression:

1 � �*; vi*<sup>2</sup> *; vj*

adjacent vertices *E* ¼ *vi*<sup>1</sup> *; vj*

are easy to obtain. Finally, the authors of [4] pointed out that by using generating function, the relationship between problems that have similar generating functions can be discovered.

As was mentioned in the last paragraph, sometimes it is hard to obtain mathematically closed formulas when using generating functions, and in that case, a good alternative is to the use asymptotic formulas. The mathematical tools used for this purpose are part of the field known as analytic combinatorics, and a good reference of this topic is [3]. The main objective of analytic combinatorics is to estimate with a high level of precision the properties of large structured combinatorial configurations by the use of mathematical analysis tools [3].Under this approach, we begin with an exact enumerative description of the combinatorial structure using the generating functions. This description is considered as an algebraic object. The next step is to take the generating function as an analytical object which is a mapping from the complex plane to itself. The singularities found in such a mapping allow to obtain the coefficients of the function in its asymptotic form, resulting in an excellent estimate on the count of the sequences. With this purpose, the authors of [3] classify the analytic combinatorics in the next three topics:


A large material concerning the subject of complex asymptotic analysis is addressed in [5]. A highly recommended text to consult because it covers the applications of the combinatorial tools enumerative to the analysis of algorithms is [6].

*Combinatorial Enumeration of Graphs DOI: http://dx.doi.org/10.5772/intechopen.88805*

In [4] the problem of the various results that can be obtained using generating functions is addressed. The authors of [4] say that by using the tool of generating functions for obtaining the *n*th element of a succession, sometimes an exact formula can be obtained easily, and if it is not the case, a good estimation of the *n*th element can be obtained. It can happen also that we get a recurrence formula from where a generating function can be obtained, or it can happen that from the generating function a new recurrence is obtained giving us a deeper understanding about the succession. The use of generating functions provides statistical information about the succession. The authors of [4] also point out that when it is very difficult to mathematically obtain the n-th term of a given sequence as a closed mathematical expression, a good option is to use asymptotic methods to obtain an estimate of that term. For example, the *n*th prime number is approximately *n* log *n* when *n* is very big. The authors of [4] also also point out that using generating functions some properties of a succession such as unimodality or convexity can be proven. Another advantage of using generating functions is that some identities as, for example,

> X*n j*¼0

*Probability, Combinatorics and Control*

tions can be discovered.

counting sequences

plane mentioned above

large random structures

**226**

*n j* � �<sup>2</sup>

classify the analytic combinatorics in the next three topics:

1.Symbolic methods that establish systematically relations of discrete

2.Complex asymptotics that allow for extracting asymptotic counting

mathematics constructions and operations on generating functions that encode

information from the generating functions by the mapping to the complex

3.Random structures concerning the probabilistic properties accomplished by

A large material concerning the subject of complex asymptotic analysis is addressed in [5]. A highly recommended text to consult because it covers the applications of the combinatorial tools enumerative to the analysis of algorithms is [6].

<sup>¼</sup> <sup>2</sup>*<sup>n</sup> n* � �

are easy to obtain. Finally, the authors of [4] pointed out that by using generating function, the relationship between problems that have similar generating func-

As was mentioned in the last paragraph, sometimes it is hard to obtain mathematically closed formulas when using generating functions, and in that case, a good alternative is to the use asymptotic formulas. The mathematical tools used for this purpose are part of the field known as analytic combinatorics, and a good reference of this topic is [3]. The main objective of analytic combinatorics is to estimate with a high level of precision the properties of large structured combinatorial configurations by the use of mathematical analysis tools [3].Under this approach, we begin with an exact enumerative description of the combinatorial structure using the generating functions. This description is considered as an algebraic object. The next step is to take the generating function as an analytical object which is a mapping from the complex plane to itself. The singularities found in such a mapping allow to obtain the coefficients of the function in its asymptotic form, resulting in an excellent estimate on the count of the sequences. With this purpose, the authors of [3]

ð Þ *n* ¼ 0*;* 1*;* 2*;* … *,* (16)

In this chapter, there will be a particular interest in the application of generating functions tool for the enumeration of graphs that have some given properties.

Let us start with the definition of a graph. A graph *G* ¼ h i *V; E* is a structure with a set of vertices *V* ¼ *v*1*; v*2*;* …*; vp* � � whose size <sup>∣</sup>*V*<sup>∣</sup> <sup>¼</sup> *<sup>p</sup>* it is called the order of *G* and a set of unordered pairs of adjacent vertices, called edges, *E* ¼ *vi*<sup>1</sup> *; vj* 1 � �*; vi*<sup>2</sup> *; vj* 2 � �*;* …*; viq ; vj q* n o n o if *<sup>G</sup>* is undirected or a set of ordered pairs of adjacent vertices *E* ¼ *vi*<sup>1</sup> *; vj* 1 � �*; vi*<sup>2</sup> *; vj* 2 � �*;* …*; viq ; vj q* n o � � , if *<sup>G</sup>* is a directed graph, whose edge set size is ∣*E*∣ ¼ *q*, that has no loops and that has no loops multiple edges. A graph *G* with *p* vertices and *q* edges is called a ð Þ *p; q* graph. In a labeled graph of order *p*, each vertex has a label that is an integer from 1 to *p*. Typical questions such as how many graphs can be constructed with *n* vertices, how many trees with *n* vertices can be obtained, and how many of these trees are binary can be answered using the generating functions, and a mathematically closed formula can be obtained. In the case that a closed mathematical formula is very hard to be obtained, an accurate asymptotic estimation formula can be a good option.

There are two commonly used generating functions: the first is the ordinary generating functions (OFG) and the other is the exponential generating functions (EGF).

An ordinary generating function is a mathematical function defined by the following expression:

$$a(\mathbf{x}) = \sum\_{k=0}^{\infty} a\_k \mathbf{x}^k,\tag{17}$$

where the coefficients are elements of the succession of numbers *a*0*, a*1*, a*2*,* …. The ordinary generating functions are used for enumeration problems where the order of the objects is not important. An exponential generating function is a mathematical function defined by the following expression:

$$b(\boldsymbol{x}) = \sum\_{k=0}^{\infty} b\_k \frac{\boldsymbol{x}^k}{k!},\tag{18}$$

where the coefficients are elements of the succession of numbers *b*0*, b*1*, b*2*,* …. The exponential generating function are used for enumeration problems where the order of the objects matter. Graphs, words, trees, or integer partitions are some of the kinds of objects with which combinatorics deals. Combinatorics deals with discrete objects as, for example, graphs, words, trees, and integer partitions. Counting such objects is one of the most interesting tasks. Enumeration of graphs that have some structural property is the main purpose of the present chapter.

The great mathematician George Pólya made huge contributions to the field of graph enumeration graphs. He obtained closed mathematical expressions for the enumeration of graphs with a given number of vertices and edges for many graph counting problems using group theory [7]. Pólya's formulas greatly facilitated the enumeration of rooted graphs, connected graphs, etc. The enumeration of number of triangulations of certain plane polygons was one of the first problems of enumeration that attracted the attention of the great mathematician Leonhard Euler [8] in the eighteenth century. Some years later, Kirchhoff in [9] discovered a method for enumerating spanning trees in a connected graph. After that, Arthur Cayley obtained a closed mathematical formula that enumerates labeled trees, rooted trees, and ordinary trees in [10]. The Cayley discovery will be covered with more detail in

## *Probability, Combinatorics and Control*

Section 4. The brilliant and unknown mathematician John Howard Redfield [11] discovered many enumeration formulas anticipating some of Pólya's contributions.

A question that arises naturally when working with labeled graphs is in how many ways can this be constructed from a certain number of vertices and edges. In order to give a possible answer, the number of symmetries or automorphisms must be taken into account. It is said that there is isomorphism between two graphs *G* and *G*<sup>1</sup> if there is a one-to-one map *A* : *V G*ð Þ↦*V G*ð Þ<sup>1</sup> between them that preserve adjacency. When *G*<sup>1</sup> ¼ *G*, then the mapping *A* is called automorphism of *G*. The set of all the automorphisms of *G*, represented by Γð Þ *G* , is called the group of *G*. The elements of Γð Þ *G* are permutations over *V*. Let *s G*ð Þ¼ ∣Γð Þ *G* ∣ be the order of the group or number of symmetries of *G*. Therefore, the number of ways in which a

*l G*ð Þ¼ *<sup>p</sup>*!

Another example of graph enumeration problem is to count the number of differently labeled connected graphs. The notion of path of length *n* is defined as a sequence of vertices f g *v*0*; v*1*;* …*; vn* where the edges *vi* f g *; vi*þ<sup>1</sup> for *i* ¼ 0*,* …*n* that belong to the path are distinct. It is said that a graph is connected if for any pair of vertices there is a path between them. To obtain the formula that counts all the connected graphs *Cp* of order *p*, it will be necessary to make use of the concept of

*E H*ð Þ⊂*E G*ð Þ. A subgraph that is maximally connected is called component. A rooted graph is a graph that has a distinguished vertex called root. When there exists an injective mapping *f* : *V H*ð Þ<sup>1</sup> ↦*V H*ð Þ<sup>2</sup> between two rooted graphs *H*<sup>1</sup> and *H*<sup>2</sup> that preserves the adjacency among vertices as well as the roots, it is said that the two rooted graphs are isomorphic. Let us make the assumption that *ak* for *k* ¼ 1*;* 2*;* 3*,* … represents the number of ways in which we can label all graphs of order that accomplish the property *P a*ð Þ and whose exponential generating function is

subgraph. It is said that a *H* is a subgraph of a graph *G* if *V H*ð Þ⊂*V G*ð Þ and

*a x*ð Þ¼ <sup>X</sup><sup>∞</sup>

*b x*ð Þ¼ <sup>X</sup><sup>∞</sup>

If we make the product of series (24) and (25), the coefficients of *<sup>x</sup><sup>k</sup>*

*C x*ð Þ¼ <sup>X</sup><sup>∞</sup>

*k*¼1

then *C x*ð Þ*C x*ð Þ becomes the generating function that counts all the ordered pairs of connected graphs with labels. If you divide by 2, equation (26) that is, we divide it by 2, we get the generating function for labeled graphs that have exactly two components.

*Ckx<sup>k</sup>*

nential generating function for labeled connected graphs

*k*¼1

Let us also assume that *bk* for *k* ¼ 1*;* 2*;* 3*,* … is the number of ways of labeling all graphs of order that accomplish the property *P b*ð Þ and whose exponential generat-

*k*¼1

is the number of ordered pairs ð Þ *G*1*; G*<sup>2</sup> of two disjoint graphs, where *G*<sup>1</sup> meets the property *P a*ð Þ, *G*<sup>2</sup> fulfills the property *P b*ð Þ, *k* is the number of vertices in *G*<sup>1</sup> ∪ *G*2, and the labels from 1 to *k* have been distributed over *G*<sup>1</sup> ∪ *G*2. If *C x*ð Þ is the expo-

*akx<sup>k</sup>*

*bkx<sup>k</sup>*

*s G*ð Þ*:* (23)

*<sup>k</sup>*! *:* (24)

*<sup>k</sup>*! *:* (25)

*<sup>k</sup>*! *,* (26)

*<sup>k</sup>*! in *a x*ð Þ*b x*ð Þ

graph *G* of order *p* can be labeled is

*Combinatorial Enumeration of Graphs DOI: http://dx.doi.org/10.5772/intechopen.88805*

ing function is

**229**

Some enumeration problems of objects that are not graphs (automata, Boolean functions, or chemical isomers) can be solved by cleverly transforming them to graphs. The generating functions are the tool used for enumerating graphs. There are two types of graphs associated with combinatorial graph enumeration problems:
