for v in range(self.num_verts()):
- for w in range(v, self.num_verts()):
+ for w in range(v + 1, self.num_verts()):

and also, you can do

- ValueError: This method is not known to work on graphs with loops. Perhaps this method can be updated to handle them, but in the meantime if you want to use it please disallow loops using allow_loops().
+ ValueError: This method is not known to work on graphs with
+ multiedges. Perhaps this method can be updated to handle them, but
+ in the meantime if you want to use it please disallow multiedges
+ using allow_multiple_edges().

and

- The (`i` , `j`) entry of the matrix gives the number of common
+ The `(i , j)` entry of the matrix gives the number of common