(self)
return dist_first
Projects a distance matrix from a higher-order to 
        first-order nodes, while path lengths are calculated 
        based on the higher-order topology
Projects a distance matrix from a higher-order to 
        first-order nodes, while path lengths are calculated 
        based on the higher-order topology
Projects a distance matrix from a higher - order to first - order nodes while path lengths are calculated based on the higher - order topology
def getDistanceMatrixFirstOrder(self):
        """
        Projects a distance matrix from a higher-order to 
        first-order nodes, while path lengths are calculated 
        based on the higher-order topology
        """

        dist = self.getDistanceMatrix()
        dist_first = _co.defaultdict( lambda: _co.defaultdict( lambda: _np.inf ) )

        # calculate distances between first-order nodes based on distance in higher-order topology 
        for vk in dist:
            for wk in dist[vk]:
                v1 = self.HigherOrderNodeToPath(vk)[0]
                w1 = self.HigherOrderNodeToPath(wk)[-1]
                if dist[vk][wk] + self.order-1 < dist_first[v1][w1]:
                    dist_first[v1][w1] = dist[vk][wk] + self.order - 1

        return dist_first
def getDistanceMatrixFirstOrder ( self ) : dist = self . getDistanceMatrix ( ) dist_first = _co . defaultdict ( lambda : _co . defaultdict ( lambda : _np . inf ) ) # calculate distances between first-order nodes based on distance in higher-order topology  for vk in dist : for wk in dist [ vk ] : v1 = self . HigherOrderNodeToPath ( vk ) [ 0 ] w1 = self . HigherOrderNodeToPath ( wk ) [ - 1 ] if dist [ vk ] [ wk ] + self . order - 1 < dist_first [ v1 ] [ w1 ] : dist_first [ v1 ] [ w1 ] = dist [ vk ] [ wk ] + self . order - 1 return dist_first