Check for valid (non-looping) paths