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