Use BFSSearch, only run one iteration of the search and only run the search if the result is actually used.