  We present a conceptually clear and algorithmically useful framework for
parameterizing the costs of tensor network contraction. Our framework is
completely general, applying to tensor networks with arbitrary bond dimensions,
open legs, and hyperedges. The fundamental objects of our framework are rooted
and unrooted contraction trees, which represent classes of contraction orders.
Properties of a contraction tree correspond directly and precisely to the time
and space costs of tensor network contraction. The properties of rooted
contraction trees give the costs of parallelized contraction algorithms. We
show how contraction trees relate to existing tree-like objects in the graph
theory literature, bringing to bear a wide range of graph algorithms and tools
to tensor network contraction. Independent of tensor networks, we show that the
edge congestion of a graph is almost equal to the branchwidth of its line
graph.
