Вы находитесь на странице: 1из 19

Problem Solving

Chapter 3
MCS 3rd

Muhammad Sohail Shinwari

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

What is Search
Search means to look into thoroughly in an effort to find or discover something. - Process of examining a large set of possible solutions to a problem in an 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 all final solutions to the problem and any intermediate solutions. - In the real-world Expert System, the search space is usually a set of IF-THEN rules, and it might also be the nodes and arcs of a semantic network or a collection of frames.

Search continues..
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.

Trees and Graphs


The search methods we will be dealing with are defined on trees and graphs, so we need to fix on some terminology for these structures: A tree is made up of nodes and links (circles and lines) connected so that there are no loops (cycles). Nodes are sometimes referred to as vertices and links as edges (this is more common 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 going to a parent node. Each node (except the terminal (leaf) nodes) has one or more children (direct descendants). More generally, a descendant node is a node that can be reached by repeatedly going to a child node.

A graph is also a set of nodes connected by links but where loops are allowed 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 as shorthand for a graph with directed links going each way between connected nodes.

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 that satisfies some property.

graphs can also be much more abstract.


Think of the graph defined as follows: the nodes denote descriptions of a state of the world, e.g. which blocks are on top of what in a blocks scene, and where the links represent 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.

Search Techniques

1. 2.

Two methods. Blind search Heuristic search

Blind search
Examines all possible states in the search tree looking for solution. Costly Time consuming Always yield a conclusion. Four methods
1. 2. 3. 4. Breadth first Depth first Forward chaining Backward chaining

Breadth First search


Examine all states in tree. Left to right and top to bottom. Start with initial state, looks at all states on each level before proceeding to the next level.

Depth First search


Examine all states in tree. Seeking deeper at same level. Backtracking if required.

Forward chaining
That begins at initial state and continues to goal state.

Backward chaining
That begins at goal state and works backward through the search tree seeking proof, justification or support.

Heuristic search
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.

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

Submission date: -

Next lecture

Вам также может понравиться