How many different trees can be formed with N nodes?? I read somewhere it is N ^ (N — 2), But doesn't find any proof? May anyone elaborate how it is N ^ (N — 2).
# | User | Rating |
---|---|---|
1 | tourist | 3803 |
2 | jiangly | 3707 |
3 | Benq | 3627 |
4 | ecnerwala | 3584 |
5 | orzdevinwang | 3573 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | Radewoosh | 3542 |
9 | jqdai0815 | 3532 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | awoo | 163 |
2 | adamant | 161 |
2 | maomao90 | 161 |
4 | maroonrk | 152 |
5 | -is-this-fft- | 151 |
6 | nor | 149 |
7 | atcoder_official | 147 |
7 | SecondThread | 147 |
9 | TheScrasse | 146 |
10 | Petr | 144 |
How many different trees can be formed with N nodes?? I read somewhere it is N ^ (N — 2), But doesn't find any proof? May anyone elaborate how it is N ^ (N — 2).
Name |
---|
http://www-math.mit.edu/~djk/18.310/18.310F04/counting_trees.html
Is this formula is approximation??
This problem solution "number of spanning trees in labeled complete graph is $$$n^{n-2}$$$", is called Cayley's Formula, which is famous in graph theory field.
There is a famous proof by Heinz Prüfer (1918) which uses Prüfer Code. But we can able to count number of spanning trees in any undirected simple graph $$$G$$$ via determinant of matrix. This way is called Kirchhoff's Theorem.