If both `all_nodes` and `nodes_found` were set this would become:

```python
nodes_found = all_nodes - nodes_found
```

which should be faster.