  The paper by M. Baker and S. Norine in 2007 introduced a new parameter on
configurations of graphs and gave a new result in the theory of graphs which
has an algebraic geometry flavour. This result was called Riemann-Roch formula
for graphs since it defines a combinatorial version of divisors and their ranks
in terms of configuration on graphs. The so called chip firing game on graphs
and the sandpile model in physics play a central role in this theory.
  In this paper we give a presentation of the theorem of Baker and Norine in
purely combinatorial terms, which is more accessible and shorter than the
original one. An algorithm for the determination of the rank of configurations
is also given for the complete graph $K_n$. This algorithm has linear
arithmetic complexity. The analysis of number of iterations in a less optimized
version of this algorithm leads to an apparently new parameter which we call
the prerank. This parameter and the classical area parameter provide an
alternative description to some well known $q,t$-Catalan numbers. Restricted to
a natural subset of configurations, the two natural statistics degree and rank
in Riemann-Roch formula lead to a distribution which is described by a
generating function which, up to a change of variables, is a symmetric fraction
involving two copies of Carlitz q-analogue of the Catalan numbers.
