Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Extra notes Modified from Callan R (2003) Artificial Intelligence Palgrave ISBN 0-333-80136-9 pg 50-55."— Presentation transcript:

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

2 The graph

3 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;

4 toVisitalreadyVisited A[] BCA CDEAB DEFGHABC EFGHIABCD FGHIJKABCDE GHIJKLMABCDEF HIJKLMABCDEFG IJKLMNABCDEFGH JKLMNOABCDEFGHI KLMNOABCDEFGHIJ LMNOABCDEFGHIJK MNOPABCDEFGHIJKL NOPQABCDEFGHIJKLM OPQABCDEFGHIJKLMN PQABCDEFGHIJKLMNO QABCDEFGHIJKLMNOP []ABCDEFGHIJKLMNOPQ

5 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;

6 toVisitalreadyVisited A[] BCA DECAB IECABD OECABDI ECABDIO JKCABDIOE KCABDIOEJ CABDIOEJK FGHABDIOEJKC LMGHABDIOEJKCF PMGHABDIOEJKCFL MGHABDIOEJKCFLP QGHABDIOEJKCFLPM


Download ppt "Extra notes Modified from Callan R (2003) Artificial Intelligence Palgrave ISBN 0-333-80136-9 pg 50-55."

Similar presentations


Ads by Google