def _dfs_in(atom):
    """Traverse an Atom's incoming neighborhood iteratively with a depth-first search."""
    atoms = [atom]
    stack = list(atom.incoming)
    while stack:
        atom = stack.pop(0)
        atoms.append(atom)
        stack[0:0] = atom.incoming
    return atoms