1 / 8

Topic 3 – Search Techniques

Topic 3 – Search Techniques. St Kentigern’s Academy Unit 3 – Artificial Intelligence. Search Trees. Many problems can be solved by a search tree.

hoai
Download Presentation

Topic 3 – Search Techniques

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Topic 3 – Search Techniques St Kentigern’s Academy Unit 3 – Artificial Intelligence

  2. Search Trees • Many problems can be solved by a search tree. • The search techniques apply to a search tree which contains all the different choices possible when starting from one state and trying to reach a ‘goal’ state.

  3. Search Trees • Here is a problem from Die Hard with a vengeance. • Water Jugs • There are two water jugs. One holds 4ltrs and one holds 3ltrs. You have an unlimited amount of water. The aim is to have exactly 2ltrs in the 4ltr jug. • You can: • Fill up the 4ltr jug • Fill up the 3ltr jug • Pour the 4ltr jug into the 3ltr jug • Pour the 3ltr jug into the 4ltr jug • Empty the 4ltr jug • Empty the 3ltr jug

  4. Search Trees • Our start state is (0,0). This represents 0 litres of water in the 4ltr jug and 0ltrs of water in the 3ltr jug. • The goal state is (2,0). This represents 2 litres of water in the 4ltr jug and 0ltrs of water in the 3ltr jug.

  5. Search Trees (0,0) (4,0) (0,3) (1,3) (4,3) (4,3) (3,0) (1,0) (0,1) (4,1) (2,3) (2,0)

  6. Search Trees • There are two search techniques commonly used in these situations: • Breadth first; • Depth first

  7. Search Trees • Breadth-first Search • This is when the tree is searched from left to right working its way down layer by layer until the goal is found. • The pathway through the tree is: • A, B, C, D, E, F, G, H, I, J, K, L A B C D E F G H I J K L

  8. Search Trees • Depth-first Search • This is when the tree is searched going down the left side of the tree until we reach the lowest node and then moves back up to work down the right hand side. • The pathway through the tree is: • A, B, D, B, E, B, F, B, A, C, G, C, H, J, H, K, H, L, H, C, I A B C D E F G H I J K L

More Related