def METHOD_NAME(self):
    n = self.nr_leaf_nodes()
    D = [[0 for _ in range(n)] for _ in range(n)]
    self.path_weight(self.path(0,2))
    for i in range(n):
        for j in range(i+1,n):
            path = self.path(i,j)
            w = self.path_weight(path)
    D[i][j], D[j][i] = w, w
    return DistanceMatrix(D)