A fundamental challenge in neuroscience is to understand how biologically salient motor behaviors emerge from properties of the underlying neural circuits. Crayfish, krill, prawns, lobsters, and other long-tailed crustaceans swim by rhythmically moving limbs called swimmerets. Over the entire biological range of animal size and paddling frequency, movements of adjacent swimmerets maintain an approximate quarter-period phase difference with the more posterior limbs leading the cycle. We use a computational fluid dynamics model to show that this frequency-invariant stroke pattern is the most effective and mechanically efficient paddling rhythm across the full range of biologically relevant Reynolds numbers in crustacean swimming. We then show that the organization of the neural circuit underlying swimmeret coordination provides a robust mechanism for generating this stroke pattern. Specifically, the wave-like limb coordination emerges robustly from a combination of the half-center structure of the local central pattern generating circuits (CPGs) that drive the movements of each limb, the asymmetric network topology of the connections between local CPGs, and the phase response properties of the local CPGs, which we measure experimentally. Thus, the crustacean swimmeret system serves as a concrete example in which the architecture of a neural circuit leads to optimal behavior in a robust manner. Furthermore, we consider all possible connection topologies between local CPGs and show that the natural connectivity pattern generates the biomechanically optimal stroke pattern most robustly. Given the high metabolic cost of crustacean swimming, our results suggest that natural selection has pushed the swimmeret neural circuit toward a connection topology that produces optimal behavior. locomotion | coupled oscillators | phase locking | metachronal waves I t is widely believed that neural circuits have evolved to optimize behavior that increases reproductive fitness. Despite this belief, few studies have clearly identified the neural mechanisms producing optimal behaviors. The complexity of behaviors generally makes it difficult to assess their optimality, and neural circuits are often too complicated to concretely link neural mechanisms to the overt behavior. Energy-intensive locomotion such as steady swimming, walking, and flying provides important model systems for studying optimality because the goal of the behavior is clear and it is likely to have been optimized for efficiency (1). For example, the kinematics of locomotion has been shown to be optimal in the cases of the undulatory motion of the sandfish lizard and the lamprey (2, 3). On the other hand, the neural circuits underlying locomotion in most organisms are not sufficiently characterized to understand how they give rise to the optimal motor behavior. Because of the distinct frequency-invariant stroke pattern and the relative simplicity of the neuronal circuit, limb coordination of long-tailed crustaceans during steady swimming provides an ideal model system ...