We modified Hamilton's (1971) selfish herd model by introducing directional movement to the prey groups and the predators. The consequences of this modification with regards to differential predation risks are compared to Hamilton's original model (using stationary prey groups) and tested against empirical data. In model 1, we replicated Hamilton's original predator-prey system. In models 2 and 3, prey groups were mobile and predators were mobile (model 2) or stationary (model 3). Our results indicate that additional to the positive risk gradient from centre to periphery predicted by Hamilton's model for stationary groups, there might be another positive risk gradient from the rear to the front part in moving groups. Furthermore, models 2 and 3 suggest that moving groups should generally exhibit an elongated shape (longer than wide along the axis of locomotion) if risk minimisation is the only factor concerned. Also smaller inter-individual distances are predicted for front individuals than individuals elsewhere in the group. Empirical data based on the three-dimensional structure of fish shoals (using roach, Rutilus rutilus) were consistent with the above two predictions. A second experiment which involved lake chub, Semotilus atromaculatus, as prey and rock bass, Ambloplites rupestris, as predators, provided direct support for the hypothesis that individuals in front positions of groups incurred a significantly higher predation risk than fish in rear positions. Finally, we discuss the differential risks of different group positions in the context of potential foraging gains which provides the basis for a dynamic model of position preferences in group-living animals.