code: def connect(self, A, B, distance=1):
          
          self.connect1(A, B, distance)
          if not self.directed: self.connect1(B, A, distance)
docs: Add a link from A and B of given distance, and also add the inverse
          link if the graph is undirected.