3. Introduction
โข Search an item in Graph
CSE, DU
Air flight system
โข Each city represents a vertex
โข Each direct flight represents an edge
4. Graph
โข A well recognized tool in modeling problems
โข Consist of:
โ Vertices can be considered locations.
โ Edges represent connections connections.
CSE, DU
D
E
A
C
F
B
Vertex
Edge
5. Graph Representation
โข How will we represent a graph in computer?
1. Adjacency Matrix
2. Use a 2D matrix to represent the
graph
3. Adjacency List
4. Use a 1D array of linked lists
5CSE, DU
10. Depth-first search
โข Move at depth, start search and then return at back
โข LIFO structure (Stack)
10CSE, DU
11. Any New Idea?
โข What's wrong with DFS?
CSE, DU
Iterative Deepening Search
DFS can move into an infinite loop
DFS is neither complete nor optimal
12. Iterative Deepening Search
โข IDS is similar to DFS
โข Depth is not known
โข increasing the depth limit with each iteration
until it reaches d, the depth of the goal state
CSE, DU
17. Pseudo-code
CSE, DU
Input: Graph root, goal
Output: solution or failure
IDS(root, goal)
{
for(i=0 to infinite)
{
DLS(root, goal, depth=i)
}
}
depth-limited DFS (called DLS);
18. Properties
where b is the branching factor and d is the depth of goal
CSE, DU
Criteria Properties of IDF
Complete search Yes
Required Time O(bd )
Memory Space O(bd)
Optimal Solution Yes
19. Analysis
โข Applicable when there is a large search space
and depth is not known
โข The main advantage of IDS in game tree
searching
โข IDS combines depth first searchโs space
efficiency and breadth first searchโs complete
-ness
CSE, DU
20. Practice Problem
โข Show each steps to find node F from the
source node Y using BFS, DFS, IDS
CSE, DU
21. Summary
โข Representation of Graph model
โข Searching model BFS, DFS
โข Iterative Deepening Search Model is
combination of BFS, DFS
โข Better than DFS and needs less space than BFS
CSE, DU
22. About Me
โข Research Topics:
- Flexible Periodic Pattern Mining
- Closed Frequent Pattern Mining
โข ML course of Stanford University
โข Won several Software Contests
โข Solve Hundreds ACM problem
CSE, DU
Story writing Code Rage Badge
www.chandacse.blogspot.com
23. References
CSE, DU
- Artificial Intelligence a Modern Approach
by Russell and Norvig
- Introduction to Algorithm by Cormen
- Fundamentals of Computer Algorithms by
Ellis; Sahni, Sartaj Horowitz
- http://en.wikipedia.org/wiki/Iterative_deepening_depth-
- http://artint.info/html/ArtInt_62.html
- http://will.thimbleby.net/algorithms/doku.php?id=iterati
Editor's Notes
<number>
<number>
<number>
<number>
More traverse, infinite loop, if two solution then may canโt find optimal
<number>
<number>
Suppose, in chess game we need to know what will be next step of opponent
<number>