Return graph in adjacency format. >>> g = Graph() >>> g.add(range(3), range(3)) >>> str(g) '{0: {0, 1, 2}, 1: {0, 1, 2}, 2: {0, 1, 2}}' >>> g = Graph(VertexType=WVertex) >>> g.add(range(3), range(3)) >>> str(g) '{0: {0: 1, 1: 1, 2: 1},
(self)
| 551 | super(Graph, self).__delitem__(head) |
| 552 | |
| 553 | def __str__(self): |
| 554 | """Return graph in adjacency format. |
| 555 | |
| 556 | >>> g = Graph() |
| 557 | >>> g.add(range(3), range(3)) |
| 558 | >>> str(g) |
| 559 | '{0: {0, 1, 2}, 1: {0, 1, 2}, 2: {0, 1, 2}}' |
| 560 | >>> g = Graph(VertexType=WVertex) |
| 561 | >>> g.add(range(3), range(3)) |
| 562 | >>> str(g) |
| 563 | '{0: {0: 1, 1: 1, 2: 1}, 1: {0: 1, 1: 1, 2: 1}, 2: {0: 1, 1: 1, 2: 1}}' |
| 564 | """ |
| 565 | if _DEBUG: self._validate() |
| 566 | return super(Graph, self).__str__() |
| 567 | #return '{%s}' % ', '.join(map(str, self.itervalues())) |
| 568 | |
| 569 | def display(self): |
| 570 | """Display adjacency list. |