update dead end and cycle process