**5. Enumeration and generating functions**

The field of combinatorial enumeration has aroused enormous interest among mathematicians who have worked in the area of discrete mathematics during the last decades [18–21]. Combinatorial enumerative technique developed by these brilliant researchers have allowed us to count words, permutations, partitions, sequences, and graphs. As was mentioned in Section 3, the mathematical tool frequently used for this purpose is the generating functions or formal power series.

The generating functions allow to connect discrete mathematics and continuous analysis in a very special way with complex variable theory. The typical situation that someone faces when trying to solve an enumeration problem is that you want to know the mathematically closed form that has the *n*th term of a given sequence of numbers *a*0*, a*1*, a*2*,* … For some sequences, we can do by inspection. For example, if the numerical sequence 1*;* 3*;* 5*;* 7*;* 9*,* …, it is easy to see that it is a sequence of odd numbers whose *n*th element is *an* ¼ 2*n* � 1.

A more complicated sequence is the set of prime numbers 2*;* 3*;* 5*;* 7*;* 11*;* 13*;* 17*;* 19*,* …, whose *an* is the *n*th prime number. A closed mathematical formula for *n*th prime number is not known, and it seems impossible to obtain in general.

In many cases it is very hard to get a simple formula just by inspection. However it can be very useful to use the generating functions whose coefficients are the elements of that sequence transforming it as follows:

$$\sum\_{i=0}^{\infty} a\_i \mathfrak{x}^i. \tag{40}$$

Eq. (40) defines an ordinary generating function. As mentioned in Section 3, since they are infinite polynomials, they can be algebraically manipulated easily.

In this chapter, the main interest will be the application of the generating functions tool as well as the analytic asymptotic methods for the enumeration of graphs accomplishing some given properties. Many questions about the number of graphs that have some specified property can be answered by the use of generating functions. Some typical questions about the number of graphs that fulfill a given property are, for example: How many different graphs can I build with *n* vertices? How many different connected graphs with *n* vertices exist? How many binary trees can be constructed with *n* vertices? [18, 19], etc. For some of these questions, the application of generating functions allows us to easily obtain a simple formula. For some other questions, the answer is an asymptotic estimation formula. The most commonly used generating functions are the *ordinary generating functions* and the *exponential generating functions*. The generating functions are the tool used for enumerating graphs. From the point of view of the generating functions, there are two types of graph enumerating problems:


The labeled graph problems can be easily solved with the direct application of the exponential generating functions. The case of the unlabeled enumeration problems can be solved by using ordinary generating functions but require the use of more combinatorial theory and the application of Pólya's theorem.
