Extra notes
This presentation is the property of its rightful owner.
Sponsored Links
1 / 6

Extra notes PowerPoint PPT Presentation


  • 30 Views
  • Uploaded on
  • Presentation posted in: General

Extra notes Modified from Callan R (2003) Artificial Intelligence Palgrave ISBN 0-333-80136-9 pg 50-55. The graph. Psudeocode for BFS. node current; queue toVisit; List alreadyVisited; put root node in toVisit; while toVisit is notEmpty current=first node in toVisit;

Download Presentation

Extra notes

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Extra notes

Extra notes

Modified from Callan R (2003) Artificial Intelligence Palgrave ISBN 0-333-80136-9 pg 50-55


Extra notes

The graph


Psudeocode for bfs

Psudeocode for BFS

  • node current;

  • queue toVisit;

  • List alreadyVisited;

  • put root node in toVisit;

  • while toVisit is notEmpty

  • current=first node in toVisit;

  • remove first node in toVisit;

  • if current==goal

  • add current to alreadyVisited;

  • return true;

  • endif

  • for each child node C of current

  • add C to toVisit;

  • endfor;

  • add current to alreadyVisited;

  • endwhile;


Extra notes

  • toVisitalreadyVisited

  • A[]

  • BCA

  • CDEAB

  • DEFGHABC

  • EFGHIABCD

  • FGHIJKABCDE

  • GHIJKLMABCDEF

  • HIJKLMABCDEFG

  • IJKLMNABCDEFGH

  • JKLMNOABCDEFGHI

  • KLMNOABCDEFGHIJ

  • LMNOABCDEFGHIJK

  • MNOPABCDEFGHIJKL

  • NOPQABCDEFGHIJKLM

  • OPQABCDEFGHIJKLMN

  • PQABCDEFGHIJKLMNO

  • QABCDEFGHIJKLMNOP

  • []ABCDEFGHIJKLMNOPQ


Psudeocode for dfs

Psudeocode for DFS

  • node current;

  • stack toVisit;

  • List alreadyVisited;

  • put root node in toVisit;

  • while toVisit is notEmpty

  • current=first node in toVisit;

  • remove first node in toVisit;

  • if current==goal

  • add current to alreadyVisited;

  • return true;

  • endif

  • for each child node C of current

  • add C to toVisit;

  • endfor;

  • add current to alreadyVisited;

  • endwhile;


Extra notes

  • toVisitalreadyVisited

  • A[]

  • BCA

  • DECAB

  • IECABD

  • OECABDI

  • ECABDIO

  • JKCABDIOE

  • KCABDIOEJ

  • CABDIOEJK

  • FGHABDIOEJKC

  • LMGHABDIOEJKCF

  • PMGHABDIOEJKCFL

  • MGHABDIOEJKCFLP

  • QGHABDIOEJKCFLPM


  • Login