Problem Solveingchp 3

Embed Size (px)

Citation preview

  • 7/27/2019 Problem Solveingchp 3

    1/19

    Problem Solving

    Chapter 3MCS 3rd

    Muhammad Sohail Shinwari

  • 7/27/2019 Problem Solveingchp 3

    2/19

    To solve a problem one need knowledge base

    A knowledge base is then concerned and is reason

    To draw inferences, to solve problem

    What approach is used ?

    Search and pattern matching

  • 7/27/2019 Problem Solveingchp 3

    3/19

    What is Search

    Search means to look into thoroughly in an effort to find or discoversomething.

    - Process of examining a large set of possible solutions to a problem inan attempt to find the best solution.

    - Plays a key role in many parts of AI.

    - Exploring alternatives.- A trial-and-error method of looking through a knowledge base

    attempting to match knowledge items to known facts.

    - The knowledge base, referred to as the search space, comprises allfinal solutions to the problem and any intermediate solutions.

    - In the real-world Expert System, the search space is usually a set ofIF-THEN rules, and it might also be the nodes and arcs of a semanticnetwork or a collection of frames.

  • 7/27/2019 Problem Solveingchp 3

    4/19

    The search process begins with an initial state or known fact.

    There should be a procedure to reach a goal state or conclusion.

    This repetitive process.search.

    Problems to be solved can be represented in state space.

    State space made up of nodes and arcs.

    Most AI problems are represented in the form of Graphs or network.

    Nodes and arcs so called search tree.

    Starting state, multiple intermediate states and final goal states.

    Search continues..

  • 7/27/2019 Problem Solveingchp 3

    5/19

    Trees and Graphs

    The search methods we will be dealing with are defined on trees and graphs, so weneed to fix on some terminology for these structures:

    A tree is made up of nodes and links (circles and lines) connected so that there areno loops (cycles).

    Nodes are sometimes referred to as vertices and links as edges (this is morecommon in talking about graphs).

    A tree has a root node (where the tree "starts").

    Every node except the root has a single parent (direct ancestor).

    More generally, an ancestor node is a node that can be reached by repeatedly goingto a parent node.

    Each node (except the terminal (leaf) nodes) has one or more children (directdescendants).

    More generally, a descendant node is a node that can be reached by repeatedlygoing to a child node.

  • 7/27/2019 Problem Solveingchp 3

    6/19

  • 7/27/2019 Problem Solveingchp 3

    7/19

    A graph is also a set of nodes connected by links but where loops areallowed and a node can have multiple parents.

    We have two kinds of graphs to deal with:

    -directed graphs,-where the links have direction (one-way streets).

    -undirected graphs

    -where the links go both ways. You can think of an undirected graph asshorthand for a graph with directed links going each way betweenconnected nodes.

  • 7/27/2019 Problem Solveingchp 3

    8/19

  • 7/27/2019 Problem Solveingchp 3

    9/19

  • 7/27/2019 Problem Solveingchp 3

    10/19

    EXAMPLES OF GRAPHS

    Graphs are everywhere;

    for example, think about road networks or airline routes or computer networks.

    In all of these cases we might be interested in finding a path through the graph thatsatisfies some property.

    graphs can also be much more abstract.

    Think of the graph defined as follows: the nodes denote descriptions of a state of theworld, e.g. which blocks are on top of what in a blocks scene, and where the linksrepresent actions that change from one state to the other.

    A path through such a graph (from a start node to a goal node) is a "plan of action"to achieve some desired goal state from some known starting state.

    It is this type of graph that is of more general interest in AI.

  • 7/27/2019 Problem Solveingchp 3

    11/19

  • 7/27/2019 Problem Solveingchp 3

    12/19

  • 7/27/2019 Problem Solveingchp 3

    13/19

    Search Techniques

    Two methods.1. Blind search

    2. Heuristic search

  • 7/27/2019 Problem Solveingchp 3

    14/19

    Blind search

    Examines all possible states in the search tree looking for solution.

    Costly

    Time consuming

    Always yield a conclusion.

    Four methods1. Breadth first

    2. Depth first

    3. Forward chaining

    4. Backward chaining

  • 7/27/2019 Problem Solveingchp 3

    15/19

    Breadth First search

    Examine all states in tree.

    Left to right and top to bottom.

    Start with initial state, looks at all states on eachlevel before proceeding to the next level.

  • 7/27/2019 Problem Solveingchp 3

    16/19

    Examine all states in tree.

    Seeking deeper at same level.

    Backtracking if required.

    Depth First search

  • 7/27/2019 Problem Solveingchp 3

    17/19

    Forward chainingThat begins at initial state and continues to goal state.

    Backward chainingThat begins at goal state and works backward through thesearch tree seeking proof, justification or support.

  • 7/27/2019 Problem Solveingchp 3

    18/19

    Uses knowledge about the state space to limit the search process

    To find the solution faster.

    Derive from Greek word meaning to discover.

    Something that help us in finding path.

    Hint, trick, or help to narrow the search process. Use experience to guide the search process.

    Heuristic search

  • 7/27/2019 Problem Solveingchp 3

    19/19

    Writing assignment

    What is pattern matching? What are its application in A.I?

    Submission date: - Next lecture