A general algorithm is presented for determining values for unit cost coefficients that reflect water use priorities for network flow programming models of water resource systems. The overarching principle for setting unit penalties for priority-based operations is that senior unit penalties must exceed the combined junior unit penalties for any feasible competing space-time path through the system for any unit of water potentially available at the senior location. The algorithm accommodates both storage and flow related water uses over multiple periods and accounts for the effects of return flow on flow allocation, which can introduce a complexity that inhibits the use of intuitive or trial-and-error methods for determining cost coefficient values. The approach is formulated initially as a linear program that can be used as a preprocessor to the network flow modeling and is applied to a water-rights model of the Truckee-Carson system. The formulation is generalized for a location connectivity matrix and vector of use priorities.