How many different trees can we form from given graph?
There is a simple algebraic algorithm based on the Matrix Tree Theorem.  Just make the Laplacian matrix of the graph and compute $N^{-1}$ times the product of its non-zero eigenvalues.