def floyds(self):
        """
            All pair shortest Path
            Idea:
            for k in (0, n):
                for i in (0, n):
                    for j in (0, n):
                    g[i][j] = min(graph[i][j], graph[i][k]+graph[k][j])
            Find the shortest distance between every pair of vertices in the weighted Graph G
        """
        d =  self.adj()  # prepare the adjacency list representation for the algorithm

        vertices = self.v.keys()

        for v2 in vertices:
            d = {v1: {v3: min(d[v1][v3], d[v1][v2] + d[v2][v3])
                     for v3 in vertices}
                 for v1 in vertices}
        return d

            All pair shortest Path
            Idea:
            for k in (0, n):
                for i in (0, n):
                    for j in (0, n):
                    g[i][j] = min(graph[i][j], graph[i][k]+graph[k][j])
            Find the shortest distance between every pair of vertices in the weighted Graph G
        
recipes/Python/579141_Simple_Graph_library/recipe-579141.py