We address the problem of community detection in networks by introducing a
general definition of Markov stability, based on the difference between the
probability fluxes of a Markov chain on the network at different time scales.
The specific implementation of the quality function and the resulting optimal
community structure thus become dependent both on the type of Markov process
and on the specific Markov times considered. For instance, if we use a natural
Markov chain dynamics and discount its stationary distribution -- that is, we
take as reference process the dynamics at infinite time -- we obtain the
standard formulation of the Markov stability. Notably, the possibility to use
finite-time transition probabilities to define the reference process naturally
allows detecting communities at different resolutions, without the need to
consider a continuous-time Markov chain in the small time limit. The main
advantage of our general formulation of Markov stability based on dynamical
flows is that we work with lumped Markov chains on network partitions, having
the same stationary distribution of the original process. In this way the form
of the quality function becomes invariant under partitioning, leading to a
self-consistent definition of community structures at different aggregation
scales