Edit Dec 15 it's not obvious this problem is tractable when further restricting to trees, see cs.SE question
Suppose we need to sum out variables in a tensor network (a factor graph where each variable appears in 2 factors). I'm interested in the cost of finding an optimal summation strategy. Optimal in a sense of the number of arithmetic operations needed to compute the sum. This is equivalent to the cost of finding contraction tree which minimizes the sum over vertex congestions, see Eq. 5 of J Gray contraction paper.
For instance, compute the following $$\sum_{v_1,v_2,v_3,v_4} f_1(v_1,v_2)f_2(v_2,v_3)f_3(v_3,v_4)f_4(v_4,v_1)$$
Using tensor network diagram notation we represent each factor as a vertex, and connect two factors if they share a variable. This turns above summation into a cycle graph below.
Optimal elimination order reduces to optimal polygon triangulation, solvable in $O(n \log n)$ time. It is the matrix chain problem. What about other planar graphs?
This is also equivalent to the problem finding optimal carving decomposition. Ratcatcher algorithm takes $O(n^3)$ time to find minimum-width carving decomposition of an arbitrary planar graph. Can optimal decomposition also be done in $O(n^3)$?
Edit (to clarify discussion of Gorman's paper in the comments, adding diagram of problematic decomposition)