Removes all nodes with less or equal links than depth.
(self, depth=0)
| 483 | return [n for w, n in nodes] |
| 484 | |
| 485 | def prune(self, depth=0): |
| 486 | """ Removes all nodes with less or equal links than depth. |
| 487 | """ |
| 488 | for n in (n for n in self.nodes if len(n.links) <= depth): |
| 489 | self.remove(n) |
| 490 | |
| 491 | def fringe(self, depth=0, traversable=lambda node, edge: True): |
| 492 | """ For depth=0, returns the list of leaf nodes (nodes with only one connection). |