Heurstic

download Heurstic

of 8

Transcript of Heurstic

  • 8/2/2019 Heurstic

    1/8

    Term Paper Development & Research

    On

    Heuristic Search Technique

    Name : Bhavin Vaja

    Roll_no. : 08mca055

    Name : Nikunj Oza

    Roll_no. : 08mca026

    Submitted to,

    Prof. Devendra Vashi

    Subject : Seminar

  • 8/2/2019 Heurstic

    2/8

    Heuristic Search Techniques

    Direct techniques (blind search) are

    not always possible (they require too

    much time or memory).

    Weak techniques can be effective if

    applied correctly on the right kinds of

    tasks.

    Typically require domain specificinformation.

    Search techniques are general problem-

    solving methods. When there is a

    formulated search problem, a set of

    states, a set of operators, an initial state,

    and a goal criterion we can use search

    techniques to solve the problem (Pearl

    & Korf, 1987). A search algorithm isexplained in simple terms by Cawsey

    (1998): Suppose that you are trying to

    find your way around in a small town,

    which has many one way streets. Your

    initial state (A) to the target destination

    (B) there are many routes, but you do

    not know which ones to take. You can

    try as many in real life, although it might

    be a difficult process. There might be

    much inconvenience in the whole

    picture: Once you have passed though

    one street you may not be able to go

    back, as it is one way, or you may be

    stuck in a park. This simplified idea of

    searching for a place indicates that we

    can actually map out all the possible

    routes in such an example; even it is

    exhausting you eventually find a way. Insmall scale search problems, as

    introduced above, simple search

    techniques are sufficient to do

    systematic search. However, sometimes

    we need systematically search for such

    a route, for instance, on a much more

    complex map. How do we do that?

    Search algorithms are good for solving

    such problems. The problems could

    refer to physical problems such as

    walking or driving from A to B; or it could

    be abstract actions such as in a set of

    steps in a theorem, which will allow us

    to prove from a set of facts.

    Heuristic search is an AI search

    technique that employs heuristic for its

    moves. Heuristic is a rule of thumb that

    probably leads to a solution. Heuristics

    play a major role in search strategies

    because of exponential nature of the

    most problems. Heuristics help to

    reduce the number of alternatives from

    an exponential number to a polynomial

    number. In Artificial Intelligence,heuristic

    search has a general meaning, and a

    more specialized technical meaning. In

    a general sense, the term heuristic isused for any advice that is often

    effective, but is not guaranteed to work

    in every case. Within the heuristic

    search architecture, however, the term

    heuristic usually

    http://intelligence.worldofcomputing.net/ai-search/ai-search-techniques.htmlhttp://intelligence.worldofcomputing.net/ai-introduction/artificial-intelligence-overview.htmlhttp://intelligence.worldofcomputing.net/ai-introduction/artificial-intelligence-overview.htmlhttp://intelligence.worldofcomputing.net/ai-search/ai-search-techniques.html
  • 8/2/2019 Heurstic

    3/8

    HEURISTIC INFORMATION

    In order to solve larger problems,

    domain-specific knowledge must be

    added to improve search efficiency.Information about the problem include

    the nature of states, cost of transforming

    from one state to another, and

    characteristics of the goals. This

    information can often be expressed in

    the form of heuristic evaluation function,

    say f(n,g), a function of the nodes n

    and/or the goals g.

    Following is a list of heuristic search

    techniques.

    Pure Heuristic Search

    A* algorithm

    Iterative-Deepening A*

    Depth-First Branch-And-Bound

    Heuristic Path Algorithm

    Recursive Best-First Search

    COMPLEXITY OF FINDING

    OPTIMAL SOLUTIONS

    The time complexity of a heuristic

    search algorithm depends on the

    accuracy of the heuristic function. For

    example, if the heuristic evaluation

    function is an exact estimator, then A*

    search algorithm runs in linear time,

    expanding only those nodes on an

    optimal solution path. Conversely, with a

    heuristic that returns zero

    everywhere, A*

    algorithm becomes uniform-cost

    search, which has exponential

    complexity.

    In general, the time complexity of A*

    search and IDA* search is an

    exponential function of the error in the

    heuristic function. For example, if the

    heuristic has constant absolute error,

    meaning that it never underestimates by

    more than a constant amount regardless

    of the magnitude of the estimate, then

    the running time of A* is linear with

    respect to the solution cost. A morerealistic assumption is constant relative

    error, which means that the error is a

    fixed percentage of the quantity being

    estimated. The base of the exponent,

    however, is smaller than the brute-force

    branching factor, reducing the

    asymptotic complexity and allowing

    larger problems to be solved. For

    example, using appropriate heuristic

    functions, IDA* can optimally solverandom instance of the twenty-four

    puzzle and Rubiks Cube.

    Heuristic Search

    http://intelligence.worldofcomputing.net/ai-search/heuristic-evaluation-function.htmlhttp://intelligence.worldofcomputing.net/ai-search/pure-heuristic-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/iterative-deepening-a-star.htmlhttp://intelligence.worldofcomputing.net/ai-search/depth-first-branch-and-bound.htmlhttp://intelligence.worldofcomputing.net/ai-search/heuristic-path.htmlhttp://intelligence.worldofcomputing.net/ai-search/recursive-best-first-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/heuristic-evaluation-function.htmlhttp://intelligence.worldofcomputing.net/ai-search/heuristic-evaluation-function.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/uniform-cost-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/uniform-cost-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/iterative-deepening-a-star.htmlhttp://intelligence.worldofcomputing.net/ai-search/iterative-deepening-a-star.htmlhttp://intelligence.worldofcomputing.net/ai-search/iterative-deepening-a-star.htmlhttp://intelligence.worldofcomputing.net/ai-search/iterative-deepening-a-star.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/uniform-cost-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/uniform-cost-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/heuristic-evaluation-function.htmlhttp://intelligence.worldofcomputing.net/ai-search/heuristic-evaluation-function.htmlhttp://intelligence.worldofcomputing.net/ai-search/recursive-best-first-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/heuristic-path.htmlhttp://intelligence.worldofcomputing.net/ai-search/depth-first-branch-and-bound.htmlhttp://intelligence.worldofcomputing.net/ai-search/iterative-deepening-a-star.htmlhttp://intelligence.worldofcomputing.net/ai-search/a-star-algorithm.htmlhttp://intelligence.worldofcomputing.net/ai-search/pure-heuristic-search.htmlhttp://intelligence.worldofcomputing.net/ai-search/heuristic-evaluation-function.html
  • 8/2/2019 Heurstic

    4/8

    A heuristic is a method that might not

    always find the best solution butis

    guaranteed to find a good solution in

    reasonable time.By sacrificing

    completeness it increases efficiency.

    Useful in solving tough problems which

    could not be solved any other way.

    solutions take an infinite time or very

    long time to compute.

    The classicexample of heuristic search

    methods is the travelling salesman

    problem.

    Heuristic Search methods Generate and

    Test Algorithm

    generate a possible solution which can

    either be a point in the problem space ora path from the initial state.

    test to see if this possible solution is a

    real solution by comparing the state

    reached with the set of goal states.

    If it is a real solution, return. Otherwise

    repeat from 1.

    This method is basically a depth first

    search as complete solutions must be

    created before testing. It is often called

    the British Museum method as it is like

    looking for an exhibit at random. A

    heuristic is needed to sharpen up the

    search. Consider the problem of four 6-

    sided cubes, and each side of the cube

    is painted in one of four colours. The

    four cubes are placed next to one

    another and the problem lies in

    arranging them so that the four available

    colours are displayed whichever way the

    4 cubes are viewed. The problem can

    only be solved if there are at least foursides coloured in each colour and the

    number of options tested can be

    reduced using heuristics if the most

    popular colour is hidden by the adjacent

    cube.

    Hill climbing

    Here the generate and test method isaugmented by an heuristic function

    which measures the closeness of the

    current state to the goal state.

    Evaluate the initial state if it is goal state

    quit otherwise current state is initial

    state.

    Select a new operator for this state and

    generate a new state.

    Evaluate the new state

  • 8/2/2019 Heurstic

    5/8

    if it is closer to goal state than current

    state make it current state

    if it is no better ignore

    If the current state is goal state or no

    new operators available, quit. Otherwise

    repeat from 2.

    In the case of the four cubes a suitable

    heuristic is the sum of the number of

    different colours on each of the four

    sides, and the goal state is 16 four on

    each side. The set of rules is simply

    choose a cube and rotate the cube

    through 90 degrees. The starting

    arrangement can either be specified or

    is at random.

    Best First Search

    A combination of depth first and breadthfirst searches. Depth first is good

    because a solution can be found without

    computing all nodes and breadth first is

    good because it does not get trapped in

    dead ends. The best first search allows

    us to switch between paths thus gaining

    the benefit of both approaches. At each

    step the most promising node is chosen.

    If one of the nodes chosen generates

    nodes that are less promising it ispossible to choose another at the same

    level and in effect the search changes

    from depth to breadth.

    If on analysis these are no better then

    this previously unexpanded node and

    branch is not forgotten and the search

    method reverts to the descendants of

    the first choice and proceeds,

    backtracking as it were.

    This process is very similar to steepest

    ascent, but in hill climbing once a move

    is chosen and the others rejected the

    others are never reconsidered whilst in

    best first they are saved to enable

    revisits if an impasse occurs on the

    apparent best path. Also the best

    available state is selected in best first

    even its value is worse than the value of

    the node just explored whereas in hill

    climbing the progress stops if there are

    no better successor nodes. The best

    first search algorithm will involve an OR

    graph which avoids the problem of node

    duplication and assumes that each node

    has a parent link to give the best node

    from which it came and a link to all itssuccessors. In this way if a better node

    is found this path can be propagated

    down to the successors. This method of

    using an OR graph requires 2 lists of

    nodes OPEN is a priority queue of

    nodes that have been evaluated by the

    heuristic function but which have not yet

    been expanded into successors. The

    most promising nodes are at the front.

    CLOSED are nodes that have alreadybeen generated and these nodes must

    be stored because a graph is being

    used in preference to a tree.

  • 8/2/2019 Heurstic

    6/8

    Heuristics In order to find the most

    promising nodes a heuristic function is

    needed called f' where f' is an

    approximation to fand is made up of

    two parts gand h' where g is the cost of

    going from the initial state to the current

    node; g is considered simply in this

    context to be the number of arcs

    traversed each of which is treated as

    being of unit weight. h' is an estimate of

    the initial cost of getting from the current

    node to the goal state. The function f' is

    the approximate value or estimate of

    getting from the initial state to the goal

    state. Both gand h' are positive valuedvariables. Best First The Best First

    algorithm is a simplified form of the A*

    algorithm. From A* we note that f' = g+h'

    where g is a measure of the time taken

    to go from the initial node to the current

    node and h' is an estimate of the time

    taken to solution from the current node.

    Thus f' is an estimate of how long it

    takes to go from the initial node to the

    solution. As an aid we take the time togo from one node to the next to be a

    constant at 1.

    Best First Search Algorithm:

    Start with OPEN holding the initial state

    Pick the best node on OPEN

    Generate its successors

    For each successor Do

    If it has not been generated before

    evaluate it add it to OPEN and record its

    parent

    If it has been generated before change

    the parent if this new path is better and

    in that case update the cost of getting to

    any successor nodes

    If a goal is found or no more nodes left

    in OPEN, quit, else return to 2.

  • 8/2/2019 Heurstic

    7/8

    Example :

    Problem :

    Solution :

  • 8/2/2019 Heurstic

    8/8