graphs rule if you can' follow rule thenif possiblepop vertex off the stack following this ruleyou pop off the stackwhich brings you back to has no unvisited adjacent verticesso you pop it ditto now only is left on the stack ahoweverdoes have unvisited adjacent verticesso you visit the next onec but is the end of the line againso you pop it and you're back to you visit dgand iand then pop them all when you reach the dead end at now you're back to you visit eand again you're back to this timehowevera has no unvisited neighborsso we pop it off the stack but now there' nothing left to popwhich brings up rule rule if you can' follow rule or rule you're done table shows how the stack looks in the various stages of this processas applied to figure table stack contents during depth-first search event stack visit visit visit visit pop pop pop visit pop visit visit visit pop pop pop visit pop pop ab abf abfh abf ab ac ad adg adgi adg ad ae done