A banana tree is a connected loopless multigraph whose underlying simple graph is a tree. We give an exact algorithm that computes its divisorial gonality and an effective divisor attaining it in O(n^2) word operations and O(n^2) space after reading the input, where n is the number of vertices. Multiplicities may be supplied in binary. A rooted residue normal form reduces positive rank to positivity of one pile at every root. A dynamic program combines independent child costs conditional on the parent pile, and sliding-window minima evaluate the recurrence in quadratic time. The result covers arbitrary branching, extending the cubic path algorithm of Beougher et al. The gonality conjecture for banana trees was already proved in that work; this paper does not resolve the general multigraph conjecture. The proof is self-audited, AI-assisted and unrefereed.
