def adj(self, missing=float('inf')):  # makes the adj dict will all possible cells, similar to matrix
        """
           G= { 0 : { 1 : 6, 2 : 4  }
                1 : { 2 : 3, 5 : 7  }
                2 : { 3 : 9, 4 : 1  }
                3 : { 4 : 1 }
                4 : { 5 : 5, 6 : 2  }
                5 : {  }
                6 : {  }
            }

            adj(G) >>
            { 0: {0: 0, 1: 6, 2: 4, 3: inf, 4: inf, 5: inf, 6: inf},
              1: {0: inf, 1: 0, 2: 3, 3: inf, 4: inf, 5: 7, 6: inf},
              2: {0: inf, 1: inf, 2: 0, 3: 9, 4: 1, 5: inf, 6: inf},
              3: {0: inf, 1: inf, 2: inf, 3: 0, 4: 1, 5: inf, 6: inf},
              4: {0: inf, 1: inf, 2: inf, 3: inf, 4: 0, 5: 5, 6: 2},
              5: {0: inf, 1: inf, 2: inf, 3: inf, 4: inf, 5: 0, 6: inf},
              6: {0: inf, 1: inf, 2: inf, 3: inf, 4: inf, 5: inf, 6: 0}
            }
        """
        vertices = self.v.keys()
        return {v1:
             {v2: 0 if v1 == v2 else self.v[v1].getNeighbours().get(v2, missing) for v2 in vertices
             }
             for v1 in vertices
            }

           G= { 0 : { 1 : 6, 2 : 4  }
                1 : { 2 : 3, 5 : 7  }
                2 : { 3 : 9, 4 : 1  }
                3 : { 4 : 1 }
                4 : { 5 : 5, 6 : 2  }
                5 : {  }
                6 : {  }
            }

            adj(G) >>
            { 0: {0: 0, 1: 6, 2: 4, 3: inf, 4: inf, 5: inf, 6: inf},
              1: {0: inf, 1: 0, 2: 3, 3: inf, 4: inf, 5: 7, 6: inf},
              2: {0: inf, 1: inf, 2: 0, 3: 9, 4: 1, 5: inf, 6: inf},
              3: {0: inf, 1: inf, 2: inf, 3: 0, 4: 1, 5: inf, 6: inf},
              4: {0: inf, 1: inf, 2: inf, 3: inf, 4: 0, 5: 5, 6: 2},
              5: {0: inf, 1: inf, 2: inf, 3: inf, 4: inf, 5: 0, 6: inf},
              6: {0: inf, 1: inf, 2: inf, 3: inf, 4: inf, 5: inf, 6: 0}
            }
        
recipes/Python/579141_Simple_Graph_library/recipe-579141.py