# Cayley’s Theorem: Enumeration of Graphs

Hope you all are doing well.

Today, I am going to write the proof of Cayley’s Theorem which counts the number of labelled trees. Cayley’s Theorem is very important topic in graph theory. If you study Graph theory and don’t know Cayley’s theorem then it would be very surprising.

Ok, So lets start having a look on some terminologies:

Tree: A connected graph without any cycle.

Prufer Sequence:  A sequence S of length n-2 defined on n elements is called Prufer sequence. It was used to prove Cayley’s theorem.

Prufer sequence of a labelled tree is unique sequence associated with that tree.z

Labelled Tree:  A tree in which each vertex is assigned a unique name or label (i.e no two vertices have the same label) is called a labelled tree.

Traditionally, the vertices of a tree are labelled by integers 1,2,3,……,n where n is the number of vertices in tree.

So, we can arise a natural question,

How many labelled trees are there with n number of vertices?

Cayley’s formula for enumeration of Graphs gives the answer of this question.

Lets discuss the proof of Cayley’s Theorem in easy way as follows:

Cayley’s Theorem:  There are n^(n-2) labelled trees with n vertices.

Proof: Basic idea of this proof is to show that a labelled tree T has one to one correspondence with Prufer sequence. If yes then ofcourse number of labelled trees is equal to number of Prufer sequences.

Now find how many such Prufer sequences on n elements of length n-2?

To find it, let us take n-2 boxes.

Each box can be filled with any of n elements. So for each box, there are n possibilities.

Thus, total number of such Prufer sequences = n× n× n× n×……….×n (n times)

= n^(n-2)

So number of labelled trees on n vertices  =  n^(n-2) if there exist one to one correspondence between labelled tree with n vertices and Prufer sequence on n elements.

So only thing is now to prove that Labelled tree⇔ Prufer sequence

One way: Given a labelled tree on n vertices, determine uniquely a Prufer sequence on n elements.

Step 1. Find a pendant vertex say v of T with smallest label

Add the adjacent vertex of v to S and delete the pendant vertex from T.

Step 2. Repeat step 1 until our tree T is K_2.

example Converse: Given a Prufer sequence on n elements, determine uniquely a labelled tree on n vertices.

Let S be a Prufer sequence of length n-2 using n elements so take S={b1,b2,b3,….b(n-2)}, where each bi∈ L={1,2,3,…..n}.

now follow the following algorithm :

Step 1. Find the smallest element x∈L which is not in S.

Join x to the Ist element of S s.t. (x, b1) is an edge.

Delete b1 from S and delete x from L and update S and L.

Step 2.  Repeat step 1 untill 2 elements remain in L.

Step 3. Finally join these two remaining vertices in L via an edge.

example. Hope you really understood.

Stay Connected, Stay learnt

Thank you

Dr. Namita Tiwari
{"ft_lang_label":"__label__en","ft_lang_prob":0.8696378,"math_prob":0.9504057,"size":2853,"snap":"2022-05-2022-21","text_gpt3_token_len":722,"char_repetition_ratio":0.16672517,"word_repetition_ratio":0.019493178,"special_character_ratio":0.23869611,"punctuation_ratio":0.12718602,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9978396,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,4,null,4,null,4,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-21T14:59:53Z\",\"WARC-Record-ID\":\"<urn:uuid:41899e16-20fa-40fc-aab8-08751e1d5a84>\",\"Content-Length\":\"111383\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:24478b46-7f47-4929-970b-554809888064>\",\"WARC-Concurrent-To\":\"<urn:uuid:56e11486-9b6d-45e8-9ac2-4aadaaec3ea4>\",\"WARC-IP-Address\":\"192.0.78.12\",\"WARC-Target-URI\":\"https://namitatiwaridotorg.wordpress.com/2017/04/20/cayleys-theorem-enumeration-of-graphs/\",\"WARC-Payload-Digest\":\"sha1:YMPZN43DJKBZMRUWA3Q2PJIJHVXDSGQ4\",\"WARC-Block-Digest\":\"sha1:ATPHWH6Y4OMUNVC2XGGPGTYYVPFDBZ75\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662539131.21_warc_CC-MAIN-20220521143241-20220521173241-00199.warc.gz\"}"}