implemented the thirdDegreeSearch in constraintSearch