Tree isomorphism problem

Given data
We are given two trees $$T_1$$ and $$T_2$$, both described by means of their adjacency matrices.

Goal
We need to find whether there is a tree isomorphism between $$T_1$$ and $$T_2$$.

Problems that are solved using it

 * Bounded degree graph isomorphism: This is the graph isomorphism problem where the degrees of all vertices are bounded. Bounded degree graph isomorphism requires us to solve a tree isomorphism problem for bounded degree trees.

Problems it reduces to
The tree isomorphism problem can be solved by making repeated calls to the rooted tree isomorphism problem as discussed below.

Idea
We know that a tree can be viewed as a rooted tree about any vertex. Thus, the idea is:


 * Fix one vertex $$v_1$$ in $$T_1$$
 * Cycle over all possibilities for the vertex $$v_2$$ in $$T_2$$, and for each, use the rooted tree isomorphism problem to check whether $$(T_1,v_1)$$ is isomorphic to $$(T_2,v_2)$$.