Fishes that swim upstream in rivers to spawn must navigate complex fluvial velocity fields to arrive at their ultimate locations. One hypothesis with substantial implications is that fish traverse pathways that minimize their energy expenditure during migration. Here we present the methodological and theoretical developments necessary to test this and similar hypotheses. First, a cost function is derived for upstream migration that relates work done by a fish to swimming drag. The energetic cost scales with the cube of a fish's relative velocity integrated along its path. By normalizing to the energy requirements of holding a position in the slowest waters at the path's origin, a cost function is derived that depends only on the physical environment and not on specifics of individual fish. Then, as an example, we demonstrate the analysis of a migration pathway of a telemetrically tracked pallid sturgeon (Scaphirhynchus albus) in the Missouri River (USA). The actual pathway cost is lower than 105 random paths through the surveyed reach and is consistent with the optimization hypothesis. The implication—subject to more extensive validation—is that reproductive success in managed rivers could be increased through manipulation of reservoir releases or channel morphology to increase abundance of lower-cost migration pathways.