Energy is often considered the primary resource constraint in a wireless sensor network. Compared to sensing and data processing, the cost of communication is among the highest in energy consumption. In this paper, we study the effects of relaying data in a wireless sensor network according to two different strategies. The first strategy allows traffic splitting, in which data can be sent on multiple paths from the source to the destination. The second strategy disallows traffic splitting, in which data must be sent on a single path from the source to the destination. We present algorithms based on linear and integer programming for finding an optimal allocation of splittable and unsplittable traffic in a wireless sensor network that minimizes total energy consumption. The technique provides optimal solutions, and can be used by designers of communication protocols to assess the energy efficiency of a data relaying scheme for a given network configuration. We also perform an empirical analysis to quantify the comparative performance gains and losses of a splittable and unsplittable traffic allocation strategy for wireless sensor networks. Results show that although the energy savings of a splittable traffic allocation strategy is relatively small when compared to the unsplittable case (on average, ranging from 0% to 1.82%), an allocation of splittable traffic can tolerate up to an additional 14.1% increase in network traffic load until any further load increase returns no feasible solutions.