Check if node is already in the frontier