3. Introduction
• Search an item in Graph
3CSE, 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.
4CSE, DU
D
E
A
C
F
B
Vertex
Edge
5. Graph Representation
• How will we represent a graph in computer?
1. Adjacency Matrix
Use a 2D matrix to represent the graph
2. Adjacency List
Use a 1D array of linked lists
5CSE, DU
11. Any New Idea?
• What's wrong with DFS?
11CSE, 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
12CSE, DU
17. Pseudo-code
17CSE, 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
18CSE, 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
19CSE, DU
20. Practice Problem
• Show each steps to find node F from the
source node Y using BFS, DFS, IDS
20CSE, 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
21CSE, 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
22CSE, DU
Story writing Code Rage Badge
www.chandacse.blogspot.com
23. References
23CSE, 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_dep
th-first_search
-http://artint.info/html/ArtInt_62.html
-http://will.thimbleby.net/algorithms/doku.php?id=iter
ative_deepening_depth-first_search