File talk:GermanyBFS.svg

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

step1:if erfurt is our destination. start from root node.

           open cycle: frankfurt
           close cycle:empty

step2: as frankfurt is not the destination explore its neighbour. check for the arrow if present.

      here these are mannheim,wurzburg & kassel.
      open cycle: mannheim,wurzburg,kassel
      close cycle: frankfurt

step 3:explore the neighbour of mannheim i.e karlsruhe

      open cycle:wurzburg,kassel,karlsruhe
      close cycle:frankfurt mannheim

step4:explore the neighbour of wurzburg i.e. nurnberg,erfurt

      open cycle:kassel,karlsruhe,nurnberg,erfurt
      close cycle:frankfurt, mannheim,wurzberg

step5:explore the neighbour of kassel i.e.munchen

     open cycle:karlsruhe,nurnberg,erfurt,munchen
     close cycle:frankfurt,mannheim,wurzberg,kassel

continue these step until erfurt comes at 1st position.

note:final close cycle is our answer. (frankfurt,mannheim,wurzberg,kassel,karlsruhe,nurnberg,erfurt)

    always write new coming node at the end of list