Added judge method for finding out if a set is a fork or bridge