Basic cycle detection for MrsPath building.