A utility class for recursive search in cyclic graph