On mining distances in large-scale dynamic graphs