Return the valency (degree) of a vertex in the graph.
(self, obj)
| 83 | return [t[0] for t in graph._khan62()] |
| 84 | |
| 85 | def valency_of(self, obj): |
| 86 | """Return the valency (degree) of a vertex in the graph.""" |
| 87 | try: |
| 88 | l = [len(self[obj])] |
| 89 | except KeyError: |
| 90 | return 0 |
| 91 | for node in self[obj]: |
| 92 | l.append(self.valency_of(node)) |
| 93 | return sum(l) |
| 94 | |
| 95 | def update(self, it): |
| 96 | """Update graph with data from a list of ``(obj, deps)`` tuples.""" |
no outgoing calls