Searches in AI, BFS & DFS Search with Examples.pptx

bk996051 24 views 33 slides Jul 15, 2024
Slide 1
Slide 1 of 33
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33

About This Presentation

That is a presentation about the Basic Searches of AI, included BFS, DFS and their Pros and cons


Slide Content

بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ

ARTIFICIAL INTELLIGENCE PRESENTATION

HAFIZA MEHAK ARIF ROLL NO 03 the GROUP MEMBERS FIZZA RUBAB ROLL NO 12 MUHAMMAD BILAWAL KHAN ROLL NO 14

CONTENTS BFS CODE & GRAPH 1 DFS CODE & GRAPH 2 INFORMED & UNINFORMED SEARCHES 3 PRACTICAL APPLICATIONS 4 PROS AND CONS OF SEARCHES 5 COMPLEXITIES OF SEARCHES 6

BFS stands for Breadth-First Search, a graph traversal algorithm for searching and exploring nodes in a graph or tree data structure. It starts at a selected node (the root or source node) and explores all of its neighbors before moving on to the next level of nodes. breadth-first search 1

Bfs code & graph graph = { 'A': ['D', 'B'], 'B': ['C', 'G', 'E'], 'C': ['A'], 'D': ['C'], 'E': ['H'], 'F': [ ], 'G': ['F'], 'H': ['G', 'F']} A code graph

Bfs code & graph QUEUE: A VISITED: QUEUE: D, B VISITED: A QUEUE: B,C VISITED: A D A code graph

Bfs code & graph QUEUE: C G E VISITED: A D B QUEUE: G E VISITED: A D B C QUEUE: E H VISITED: A D B C A code graph

Bfs code & graph QUEUE: H F VISITED: A D B C E QUEUE: H VISITED: A D B C E F QUEUE: VISITED: A D B C E F H A code graph

FINAL BFS RESULT...

...

BFS PATH A D B C G E F H

DEPTH-FIRST SEARCH 2 DFS stands for Depth-First Search, which is a graph traversal algorithm used to search and explore nodes in a graph or tree data structure. It starts at a selected node (the root or source node) and explores as far as possible along each branch before backtracking

code graph DFS code & graph graph = { 'A': ['I', 'F', 'B'], 'I': [], 'F': ['A', 'G'], 'B': ['A', 'E', 'C’], 'E': ['G', 'C', 'B’], 'G': ['E', 'D'], 'C': ['B', 'E', 'D'], 'D': ['C', 'H’], 'H': []}

code graph DFS code & graph STACK: A VISITED: STACK: I F B VISITED: A STACK:F B VISITED: A I

code graph DFS code & graph STACK: B G VISITED: A I F STACK: B E C VISITED: A I F G STACK:B C D VISITED: A I F G E

code graph 3 DFS code & graph STACK:B D VISITED: A I F G E C STACK: B D VISITED: A I F G E C STACK:F B VISITED: A I

code graph 3 DFS code & graph STACK:B D VISITED: A I F G E C B D H

FINAL BFS RESULT...

...

BFS PATH A I F G E C B D H

3 Informed searches are like having a map when you're trying to find your way. They use extra information about the problem to guide the search process. This extra information helps them make smarter decisions about which path to take next. Informed searches are like having a hint or clue that helps you move in the right direction. They save time and effort by focusing on the most promising options first. A Informed Uninformed informed & uninformed searches Uninformed searches, on the other hand, are like searching blindly. They don't have any extra information about the problem. So, they have to explore all possible options one by one until they find a solution. Uninformed searches are like exploring a maze with no map. You try one path, then another, without knowing if you're getting closer to the exit. They can be time-consuming and may not always find the best solution..

Finding the Shortest Path Beating Games Understanding Language Recognizing Things in Pictures Making Schedules Find the shortest route for you Chess or video games Find what you're looking for Familiar faces or objects O rganize tasks at work like personal assistant practical applications 4

5 - Faster: These are like having a map. They use extra information to make smart decisions about which path to take. This makes them faster than uninformed searches.- Efficient: With the help of extra clues, & can focus on the most promising options first, leading to more efficient solutions.- Optimal Solutions: They use additional knowledge to guide the search process. - Need for Heuristic: Informed searches rely on heuristic information, which may not always be accurate. If the heuristic is wrong, it could lead the search in the wrong direction.- Complexity: Sometimes, the extra information used in informed searches can make them more complex to implement and understand. PROS CONS informed searches

5 Simple: Uninformed searches are straightforward. They explore all possible options without any extra information, making them easy to implement.- Complete: Uninformed searches are guaranteed to find a solution if one exists. They exhaustively search through all possible paths. Time-consuming: Since uninformed searches don't use any extra information, they might explore many unnecessary paths, which can be time-consuming.- Inefficient: Without guidance, uninformed searches may take longer to find a solution than informed searches, especially in complex problem spaces. PROS CONS UNinformed searches

TIME COMPLEXITIES SPACE COMPLEXITIES 6 COMPLEXITIES OF SEARCHES

Time Complexity: The time complexity of informed searches varies depending on the specific algorithm used, but they generally have better time complexity than uninformed searches. - Space Complexity: Informed searches typically require more memory space compared to uninformed searches because they need to store additional information, such as heuristic values or priority queues. Complexity of informed search 6

Time Complexity: Uninformed searches usually have higher time complexity compared to informed searches because they systematically explore all possible paths without any additional information to guide the search. - Space Complexity: Uninformed searches generally have lower space complexity compared to informed searches because they don't require storing extra information like heuristic values. Complexity of uninformed search 6

That was all about our presentation

any questions ?? FEEL FREE TO ask

THANKS FOR YOUR ATTETION