Graph isomorphism is the problem of determining whether two graphs are topologically identical. It is in NP but not known to be NP-complete. The refinement heuristic iteratively partitions vertices into equivalence classes to reduce possible mappings between graphs. For trees, there is a linear-time algorithm that labels vertices based on subtree structure to test rooted and unrooted tree isomorphism.