Can you consider change the position of
self.edges.append([0] * (len(self.edges)+1))
after this line
self.vertices[vertex.name] = vertex
Since
self.edges.append([0] * (len(self.edges)+1))
is for initializing the matrix to zeros. Especially, adding the first edge, it is not easy to understand. Because when this line changes position it follows the initializing, appending new initialized edges, fill the weight number logic. That will be more easy for comprehension.