Implemented a recursive ordering for cyclic component graph