The irrigation problem is the problem of finding an efficient way to transport a measure μ+ onto a measure μ-. By efficient, we mean that a structure that achieves the transport (which, following [Bernot, Caselles and Morel, Publ. Mat. 49 (2005) 417-451], we call traffic plan) is better if it carries the mass in a grouped way rather than in a separate way. This is formalized by considering costs functionals that favorize this property. The aim of this paper is to introduce a dynamical cost functional on traffic plans that we argue to be more realistic. The existence of minimizers is proved in two ways: in some cases, we can deduce it from a classical semicontinuity argument; the other cases are treated by studying the link between our cost and the one introduced in [Bernot, Caselles and Morel, Publ. Mat. 49 (2005) 417-451]. Finally, we discuss the stability of minimizers with respect to specific variations of the cost functional. [ABSTRACT FROM AUTHOR]