informed search and applications · 4 online dfs - setup inputs: s’, a percept that identifies...
TRANSCRIPT
1
Informed Search and Informed Search and ApplicationsApplications
Reading: Recommended paper:``Focused Crawling: a new approach to topic-specific Web resource discover”,Soumen Chakrabarti, Martin van den Berg, Byron Domhttp://www.cs.berkeley.edu/~soumen/doc/ww
w1999f/pdf/www1999f.pdf
Next class: chapter 5
The book has been placed on reserve. Be sure you
2
Online SearchOnline Search
� Agent operates by interleaving computation and action
� No time for thinking
� The agent only knows� Actions (s)� The step-cost function c(s,a,s’)� Goal-text (s)
� Cannot access the successors of a state without trying all actions
3
What properties of search are What properties of search are desirable?desirable?� Will A* work?
� Expand nodes in a local order� Depth first� Variant of greedy search
� Difference from offline search:� Agent must physically backtrack� Record states to which agent can backtrack and has not
yet explored
4
Online DFS Online DFS -- setupsetup
� Inputs: s’, a percept that identifies the current state
Static: � result, a table indexed by action and state,
initially empty� unexplored: a table that lists, for each visited
state, the actions not yet tried� unbacktracked: a table that lists, for each
visited state, the backtracks not yet tried� s,a: the previous state and action, initially null
5
Online DFS Online DFS –– the algorithmthe algorithm� If Goal-test(s’) then return stop� If s’ is a new state then unexplored[s’] � actions(s’)� If s is not null then do
� result[a,s]�s’� Add s to the front of unbacktracked[s’]
� If unexplored[s’] is empty� Then return stop� Else a� action b such that
result[b,s’]=pop(unbacktracked[s’])� Else a�pop(unexplored[s’])� s� s’� Return a
6
Local Search AlgorithmsLocal Search Algorithms
� Operate using a single current state
� Move only to neighbors of the state
� Paths followed by search are not retained
� Iterative improvement� Keep a single current state and try to improve it
7
Advantages to local searchAdvantages to local search
� Use very little memory – usually a constant amount
� Can often find reasonable solutions in large or infinite state spaces (e.g., continuous)
� Unsuitable for systematic search
� Useful for pure optimatization problems� Find the best state according to an objective function� Traveling salesman
8
9
10
Steepest Ascent
11
12
Problems for hill climbingProblems for hill climbing
When the higher the heuristic function the better: maxima (objective fns); when the lower the function the better: minima (cost fns)
� Local maxima: A local maximum is a peak that is higher than each of its neighboring states, but lower than the global maximum
� Ridges: a sequence of local maxima� Plateaux: an area of the state space landscape
where the evaluation function is flat
13
Some solutionsSome solutions� Stochastic hill-climbing
� Chose at random from among the uphill moves
� First-choice hill climbing� Generates successors randomly until one is generated
that is better than current state
� Random-restart hill climbing� Keep restarting from randomly generated initial states,
stopping when goal is found
� Simulated annealing� Generate a random move. Accept if improvement.
Otherwise accept with continually decreasing probability.
� Local beam search� Keep track of k states rather than just 1
14
Back to Online SearchBack to Online Search
� Would hill-climbing be appropriate?
15
Learning Real Time A* Learning Real Time A* (LRTA*)(LRTA*)
� Augment hill-climbing with memory
� Store current best estimate of cost from node to goal: H(s)
� Initially, H(s) = h(s)
� Update H(s) through experience
� Estimated cost to reach the goal through neighbor s’� H(s) = c(s,a,s’)+ H(s’)
16
LRTA* agentLRTA* agent
� Inputs: s’, a percept that identifies the current state
� Static: result, a table indexed by action and state, initially empty
� H, a table of cost estimates indexed by state, initially empty
� S,a, the previous state and action, initially null
17
LRTA*(LRTA*(s’s’))
� If Goal-test(s’) then return stop� If s’ is a new state (not in H), then H[s’]� h(s’)� Unless s is null
� Result[a,s]� s’� H[s] � min LRTA*-Cost(s,b,result[b,s],H)
over all b from Actions(s)
� a� an action b in Actions(s’) that minimizes LRTA*-Cost(s’,b,result[b,s’],H)
� s� s’� Return a
18
LRTA*LRTA*--Cost(Cost(s,a,s’,Hs,a,s’,H) )
� Returns a cost-estimate
� If s’ is undefined then return h(s)� Else return c(s,a,s’) + H[s’]
19
RealReal--World Application for AI World Application for AI SearchSearchThe Problem
� World Wide Web is a vast resource� Google reports indexing 3.3 billion web pages as of 1/2004� About 600GB of text changes every month
� A search engine requires continuous crawls to index all pages
� Inktomi:� Cluster of 100s of Sun Sparc stations� 75GB RAM each� 1 TB disk� Crawls greater than 10 million pages/day
20
Alternative: focused crawlAlternative: focused crawl
� Start with a user specified topic hierarchy (like Yahoo, but user specific)
� Used for training the crawler to distinguish relevant pages from irrelevant pages
� Classifier: a learned function that predicts relevance
� Resource discovery: Starting from a node in the hierarchy the crawler branches out to find other relevant pages
� Must determine which outgoing links are good ones
� Simultanously, the crawler runs a topic distillation algorithm to identify hubs
� Pages with large numbers of links to relevant documents
21
Why is this an AI Search Why is this an AI Search Problem?Problem?� What is the search space?
� What is the goal test?
� What is the heuristic function?
22
System ArchitectureSystem Architecture
� Classifier: makes relevance judgments on pages crawled to decide on link expansion
� Distiller: determiens a measure of centrality of crawled pages to determine viist priorities
� Crawler: dynamically reconfigurable priority controls governed by classifier and distiller
23
DistillationDistillation
� A good strategy for the crawler is to identify hubs: pages that are almost exclusively collection of links to authoritative resources that are relevant to the topic
� Authorities: a web page with many incoming links, particularly from high-prestige, relevant pages
24
Identifying hubs and Identifying hubs and authoritiesauthorities� Each node has two scores, iteratively
determined� a(v): number of incoming edges from relevant
nodes� h(v): number of outgoing edge to relevant
nodes
� Weight these scores by the relevance scores of the pages they point to (a probability between 0 and 1)