Uninformed Search in Artificail Intelligence

download Uninformed Search in Artificail Intelligence

of 16

Transcript of Uninformed Search in Artificail Intelligence

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    1/16

    UNINFORMED SEARCHUNINFORMED SEARCH

    -BFS-BFS

    -DFS-DFS

    -DFIS-DFIS

    - Bidirectional- Bidirectional

    INT404K3305

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    2/16

    •State-space search is the process of searching through a state space fora solution by making explicit a sufficient portion of an implicit state-

    space graph to include a goal node. 

     – Hence, initially V={!, "here is the start node#

     – "hen is expanded, its successors are generated and those nodes areadded to V and the associated arcs are added to $.

     – %his process continues until a goal node is generated &included in V' andidentified &by goal test'

    •(uring search, a node can be in one of the three categories)

     –  *ot generated yet &has not been made explicit yet' – OPEN) generated but not expanded

     – CLOSED) expanded

     – earch strategies differ mainly on ho" to select an +$* node for

    expansion at each step of search

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    3/16

    A General State-Space Search Algorithm

    open )= {!# closed )={!#repeat

      n )=  select &open'# select one node from open for expansion

    if  n is a goal

    then exit "ith success# delayed goal testing

    expand &n'

    generate all children of n

     put these ne"ly generated nodes in open &check duplicates'

      put n in closed &check duplicates'

    until open = {!#

    exit "ith failure

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    4/16

    Some Issues•earch process constructs a search tree, "here

     – root is the initial state , and – leaf nodes are nodes

    •not yet been expanded &i.e., they are in +$* list' or

    •ha/ing no successors &i.e., they0re 1deadends1'

    •ome important issue that arises

    •%he direction in "hich conduct the search&for"ard /s. back"ard

    reasoning'

    •Ho" to select applicable rules&matching'.

    •Ho" to represent each node of search process&the kno"ledge

    representation problem'

    •earch tree /s. search graph

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    5/16

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    6/16

    Algorithm ( )readth-*irst Search

    +,

    1. Create a variable called NODE-LIST and set it to the initial state.

    2. Until a goal state is found or NODE-LIST is e!t"#

    $a%&eove the first eleent fro NODE-LIST and call it E. If NODE-LIST

    'as e!t"( )uit.

    $b% *or each 'a" that each rule can atch the state described in E do#

    (i) Apply the rule to generate a new state,

    (ii) If the new state is a goal state, quit and return this state.

    (iii) Otherwise, add the new state to the end of NODE-LI!.

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    7/16

    !o Leels of a )readth-*irst

    Search !ree

    +.

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    8/16

    +readth,*irst

     -   co!lete search tree of

    de!th d 'here each non,leafnode has b children( has a

    total of 1 / b / b2 / ... / bd

    $b$d/1% , 1%$b,1% nodes

     - Tie co!leit" $ of nodes

    generated%# $bd% - 6!ace co!leit" $aiu

    length of 78N%# $bd%

    s/

    #

    #0+

    #0dd

    +

    /

     - *or a co!lete search tree of de!th 12( 'here ever" node atde!ths 0( ...( 11 has 10 children and ever" node at de!th 12 has 0

    children( there are 1 / 10 / 100 / 1000 / ... / 1012 $1013 ,1%9 $1012% nodes in the co!lete search tree.

    : +*6 is suitable for !robles 'ith shallo' solutions

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    9/16

    Algorithm ( Depth-*irst Search

    +1

    1. If the initial state is a goal state( )uit and return success.

    2. ther'ise( do the follo'ing until success or failure is signaled#

    (a) "enerate a su##essor, E, of the initial state. If there are no $ore

    su##essors, signal failure.

    (%) &all Depth-'irst ear#h with E as the initial state.

    (#) If su##ess is returned, signal su##ess. Otherwise #ontinue in this loop.

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    10/16

    A Depth-*irst Search !ree

    +2

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    11/16

     ;e!th,*irst $;*6%:  lgorith outline#

     -  l'a"s select fro the 78N the node 'ith thegreatest de!th for e!ansion( and !ut all ne'l"

    generated nodes into 78N

     - 78N is organience( onl" does =chronological bac@trac@ing=

    goal

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    12/16

    ;e!th,*irst Iterative ;ee!ening $;*I;%

    : +* and ;* both have e!onential tie co!leit" $bd%

    +* is #o$plete but has e!onential s!ace co!leit";* has linear spa#e #o$pleity but is inco!lete

    : 6!ace is often a harder  resource constraint than tie

    : Can 'e have an algorith that - Is co!lete

     - >as linear s!ace co!leit"( and - >as tie co!leit" of $bd%

    : ;*I; b" Korf in 19B5 $1 "ears after D%

    *irst do ;*6 to de!th 0 $i.e.( treat start node as

    having no successors%( then( if no solution found(do ;*6 to de!th 1( etc.

    until solution found do

      DFS with depth bound d 

      d = d+1

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    13/16

    ;e!th,*irst Iterative ;ee!ening $;*I;%

    : &o$plete $iterativel" generate all nodes u! to de!th

    d%

    : Opti$al+Ad$issi%le if all o!erators have the sae

    cost. ther'ise( not o!tial but does guarantee

    finding solution of shortest length $li@e +*%.

    : Linear spa#e #o$pleity $bd%( $li@e ;*%

    : !i$e #o$pleity is a little 'orse than +*6 or ;*6

    because nodes near the to! of the search tree are

    generated ulti!le ties( but because alost all of

    the nodes are near the botto of a tree( the 'orst

    case tie co!leit" is still e!onential( $bd%

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    14/16

    ;e!th,*irst Iterative ;ee!ening

    : If branching factor is b and solution is at de!th d( then nodes at

    de!th d are generated once( nodes at de!th d,1 are generated

    t'ice( etc.( and node at de!th 1 is generated d ties.

    >ence

    total$d% bd / 2b$d,1% / ... / db

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    15/16

  • 8/9/2019 Uninformed Search in Artificail Intelligence

    16/16