  Tree tensor network (TTN) provides an essential theoretical framework for the
practical simulation of quantum many-body systems, where the network structure
defined by the connectivity of the isometry tensors plays a crucial role in
improving its approximation accuracy. In this paper, we propose a TTN algorithm
that enables us to automatically optimize the network structure by local
reconnections of isometries to suppress the bipartite entanglement entropy on
their legs. The algorithm can be seamlessly implemented to such a conventional
TTN approach as density-matrix renormalization group. We apply the algorithm to
the inhomogeneous antiferromagnetic Heisenberg spin chain having a hierarchical
spatial distribution of the interactions. We then demonstrate that the
entanglement structure embedded in the ground-state of the system can be
efficiently visualized as a perfect binary tree in the optimized TTN. Possible
improvements and applications of the algorithm are also discussed.
