Returns the edge between the nodes with given id1 and id2.
(self, id1, id2)
| 410 | return self.get(id, None) |
| 411 | |
| 412 | def edge(self, id1, id2): |
| 413 | """ Returns the edge between the nodes with given id1 and id2. |
| 414 | """ |
| 415 | if isinstance(id1, Node) and id1.graph == self: |
| 416 | id1 = id1.id |
| 417 | if isinstance(id2, Node) and id2.graph == self: |
| 418 | id2 = id2.id |
| 419 | return id1 in self and id2 in self and self[id1].links.edge(id2) or None |
| 420 | |
| 421 | def paths(self, node1, node2, length=4, path=[]): |
| 422 | """ Returns a list of paths (shorter than or equal to given length) connecting the two nodes. |