Distributed computation of mobility patterns in a smart city environment