def farness(user):
 return sum((len(paths[0]) for paths in user['shortest_paths'].values()))

def farness ( user ) : return sum ( ( len ( paths [ 0 ] ) for paths in user [ 'shortest_paths' ] . values ( ) ) )
the sum of the lengths of the shortest paths to each other user .