Professional Documents
Culture Documents
CS (Graph Theory) vs. AI: Nathan Sturtevant
CS (Graph Theory) vs. AI: Nathan Sturtevant
AI
Graph theory also looks at explicit graphs
|V| vertices |E| edges (At most O(|V|2) edges) AI often uses implicit graphs Duplicate nodes hard to detect AI often assumes a constant branching factor
Overview
Problem Denition Assumptions Algorithms: BFS DFS DFID
Overview
Metrics Complete Solution Quality Time Complexity Space Complexity Assumption Uniform edges costs Brute-force search
BFS
Implementation Expand nodes and put them in a (FIFO) queue Pull rst node off of queue and expand it Goal test? Solution quality - complete? Finds optimal solution assuming uniform cost edges Proof?
DFS
Expand nodes and put them on a stack Pop top node and expand depth-rst expansion v. generation Solution quality -- delay discussion
Implementation Complexity
What do you keep in memory for BFS? Have to keep copy of each state What do you keep in memory for DFS? Only have to keep a single copy of the state Apply & undo moves to state
DFID
Run DFS with successive depth bounds: 1, 2, 3d Solution Quality? Space Complexity?
DFID
Time complexity? BFS work at depth d: bdb/(b-1)
bd b b b b b + bd1 + bd2 + ... + b + b1 b1 b1 b1 b1 b (bd + bd1 + bd2 + . . . + b + 1) b1 b 2 b d b b = bd ( ) b1 b1 b1