  Analytic solution for the average path length in a large class of random
graphs is found. We apply the approach to classical random graphs of Erd\"{o}s
and R\'{e}nyi (ER) and to scale-free networks of Barab\'{a}si and Albert (BA).
In both cases our results confirm previous observations: small world behavior
in classical random graphs $l_{ER} \sim \ln N$ and ultra small world effect
characterizing scale-free BA networks $l_{BA} \sim \ln N/\ln\ln N$. In the case
of scale-free random graphs with power law degree distributions we observed the
saturation of the average path length in the limit of $N\to\infty$ for systems
with the scaling exponent $2< \alpha <3$ and the small-world behaviour for
systems with $\alpha>3$.
