(self)
return dist
Calculates shortest path distances between all pairs of 
        higher-order nodes using the Floyd-Warshall algorithm.
Calculates shortest path distances between all pairs of 
        higher-order nodes using the Floyd-Warshall algorithm.
Calculates shortest path distances between all pairs of higher - order nodes using the Floyd - Warshall algorithm .
def getDistanceMatrix(self):
        """
        Calculates shortest path distances between all pairs of 
        higher-order nodes using the Floyd-Warshall algorithm.
        """

        Log.add('Calculating distance matrix in higher-order network (k = ' + str(self.order) + ') ...', Severity.INFO)

        dist = _co.defaultdict( lambda: _co.defaultdict( lambda: _np.inf ) )

        for v in self.nodes:
            dist[v][v] = 0

        for e in self.edges:
            dist[e[0]][e[1]] = 1

        for v in self.nodes:
            for w in self.nodes:
                for k in self.nodes:
                    if dist[v][w] > dist[v][k] + dist[k][w]:
                        dist[v][w] = dist[v][k] + dist[k][w]

        Log.add('finished.', Severity.INFO)

        return dist
def getDistanceMatrix ( self ) : Log . add ( 'Calculating distance matrix in higher-order network (k = ' + str ( self . order ) + ') ...' , Severity . INFO ) dist = _co . defaultdict ( lambda : _co . defaultdict ( lambda : _np . inf ) ) for v in self . nodes : dist [ v ] [ v ] = 0 for e in self . edges : dist [ e [ 0 ] ] [ e [ 1 ] ] = 1 for v in self . nodes : for w in self . nodes : for k in self . nodes : if dist [ v ] [ w ] > dist [ v ] [ k ] + dist [ k ] [ w ] : dist [ v ] [ w ] = dist [ v ] [ k ] + dist [ k ] [ w ] Log . add ( 'finished.' , Severity . INFO ) return dist