Integrating the costs and benefits of collective behaviors is a fundamental challenge to understanding the evolution of group living. These costs and benefits can rarely be quantified simultaneously due to the complexity of the interactions within the group, or even compared to each other because of the absence of common metrics between them. The construction of ‘living bridges’ by New World army ants - which they use to shorten their foraging trails - is a unique example of a collective behavior where costs and benefits have been experimentally measured and related to each other. As a result, it is possible to make quantitative predictions about when and how the behavior will be observed. In this paper, we extend a previous mathematical model of these costs and benefits into a general framework for analyzing the optimal formation, and final configuration, of army ant living bridges. We provide experimentally testable predictions of the final bridge position, as well as the optimal formation process for certain cases, for a wide range of scenarios, which more closely resemble common terrain obstacles that ants encounter in nature. As such, our framework offers a rare benchmark for determining the evolutionary pressures governing the evolution of a naturally occurring collective animal behavior.