We define an algebraic theory of hierarchical graphs, whose axioms characterise graph isomorphism: two terms are equated exactly when they represent the same graph. Our algebra can be understood as a high-level language for describing graphs with a nested structure, and it is then well suited for defining sound and complete graphical representations of nominal calculi, in particular those with nested features such as sessions, transactions, locations, ambients or membranes.