INTRODUCTION

Intelligence Intelligence is the computational part of the ability to achieve goals in the world. Varying kinds and degrees of intelligence occur in people, many animals and some machines. Artificial Intelligence (A I) Artificial Intelligence is the development of systems that exhibit the characteristics we associate with intelligence in human behavior: perception, natural language processing, reasoning, planning and problem solving, learning and adaptation, etc. Characteristics of A.I. Programs a) Symbolic Processing Symbolic processing is reasoning about objects represented by symbols, and their properties and relationships, rather than numerical calculations. Generally A.I. programs primarily use symbolic representations: collections of symbols that represent:
• • • •

Objects. Properties of objects. Relationships among objects. Rules about classes of objects.

b) Knowledge Representation Knowledge is the general principles that are stored in the program and used for reasoning about novel situations. This knowledge is represented by some kind of data structures in the machine's memory that reflect the complexity of the real world. Several kinds of knowledge need to be represented: • Factual Data: Known facts about the world. • General Principles: For example, ``Every vehicle requires fuel.'' • Hypothetical Data: The computer must consider hypotheticals in order to reason about the effects of actions being contemplated. c) Search This is a method for finding a solution to a problem when no direct method exists. Search programs find a solution for a problem by trying different sequences of actions (operators) until a solution is found. Search fits in nearly every area of A.I. in the following ways: • Natural Language: A parser searches for the best ways of assigning structure and meaning to sentences that are ambiguous. • Planning: A planner searches for a sequence of actions that will accomplish a goal. • Perception: The raw input is often ambiguous; the perception program searches for a consistent set of interpretations of parts of the input. • Learning: A learning program searches for a compact description of a set of training instances. • Expert Systems: Search finds rules applicable to the current problem. Knowledge Based Systems ~ Wainaina Page 1 of 7

if it is not then the new state becomes the current state and the process is repeated until a solution is found or the state space is exhausted. Each link has a numeric weight that is associated with it. The states are represented as nodes while the allowed steps or actions are represented as arcs. driving (ALVINN (1993)-learnt how to steer a vehicle by observing the human driver. A neural network unit consists of a linear input function that computes the sum of weighted inputs. 3. The learning occurs by adjusting the weights so that the inputs correspond to the outputs. The solution is a path from the current state to the goal state. Defining a search problem A search problem is defined by specifying: Knowledge Based Systems ~ Wainaina Page 2 of 7 . 2. Execute allowable actions to move to the next state. Representing search problems A search problem is represented using a directed graph. Neural networks have been used in pronunciation in which text streams are mapped to phonemes (basic sound elements). Check the current state.g. handwritten text recognition. The neural network consists of a number of nodes that are connected using links.d) Heuristics Are similar to rules of thumb where you need not rethink completely what to do every time a similar problem is encountered. evolution. Process of Searching Searching proceeds as follows: 1. and neural networks). It also has a non linear component called activation function that transforms the final input values into a final activation value. Check if the new state is the solution state. e) Inferencing This is a form of reasoning with facts and rules using heuristics or some search strategies. II) SEARCHING TECHNIQUE Searching is the process of looking for the solution of a problem through a set of possibilities (state space). Search problem The search problem consists of finding a solution plan. which is a path from the current state to the goal state. I) NEURAL NETWORKS A neural network is used to model the human neuron. PROBLEM SOLVING TECHNIQUES IN ARTIFICIAL INTELLIGENCE Problems are tackled in AI using two main broad approaches namely: i) Search technique ii) Modelling natural phenomena (e.

Start node. Goal condition. and a test to check whether the goal condition is met. C on a table are considered. Possible moves Put a block on table. A C B Knowledge Based Systems ~ Wainaina Page 3 of 7 . Put a block on top of another block. B. Example of a search case study Three blocks A. Remove a block from the top of another and place on top of another block. A block can be grasped when there is no other block on top of it.• • • • State space. Search Problem Initial state (current state) C A B Goal state (final state) A B C State space C A B B A C A BC A BC C B A B AC ABC C AB B C A B AC C AB A B C The state space has 13 elements or nodes. Rules giving how to change states. Only one block can be moved at a time.

Time complexity: how long does it take to find a solution? 3. The only thing that a blind search can do is distinguish a non-goal state from a goal state. Different search strategies are evaluated in terms of four criteria: 1. The search problem is to find a path from a city S to a city G 3 S 4 D 2 E 4 F A 4 B 5 G 3 4 C 5 Types of Searches There are two broad classes of searches: i) Uninformed search (blind / Exhaustive search) ii) Informed search (Heuristic/ Guided search) 1) Uninformed search: This is a search that has no information about its domain. Optimality: does the strategy find the highest quality solution when there are several different solutions? Example of a problem (2) The figure below contains a representation of a map. Space complexity: how much memory does it need to perform the search? 4. and the links represent direct road connections between cities. Completeness: is the strategy guaranteed to find a solution when there is one? 2.Looks for the goal node among all the nodes at a given level before using the children of those nodes to push on as shown below Knowledge Based Systems ~ Wainaina Page 4 of 7 . The following are the various uniform search algorithms: i) Breadth-first search:. Search Strategies These are controls mechanisms used to direct the search and enable to select which operator to apply at each step. The nodes represent cities.The solution to our problem is any member of the set of all paths from original to goal state such as the path indicated in bold. The number associated to a link represents the length of the corresponding road. when there is more than one operator to be applied.

The idea behind a heuristic search is to explore the node that is most likely to be nearest to a goal state. 2) Informed search: This is a search that uses domain-dependant (heuristic) information in order to search the space more efficiently. If we have larger problems to solve then there are better blind search strategies that can be used (depth first search).Looks for the goal node among all the children of the current node before using the sibling of this node to push on as shown below S A B C E D F G Depth-first search of a path from node S to node G. There is no guarantee that the heuristic function will return a value that ensures that a particular node is closer to a goal state than any other node. of how close we are to a goal The following are the various heuristic search algorithms: Knowledge Based Systems ~ Wainaina Page 5 of 7 . a heuristic function which tells us how close we are to a goal state is used. based on domain-specific information that is computable from the current state description.S D E A A B D C E E B B F D F B F C E A C G Breadth-first search of a path from node S to node G. Breadth first search can only be used for small problems. Heuristic is used as an estimate. To do this. ii) Depth-first search:.

5] A 4 [6] B 5 G D [8] 2 E [6] 4 F [3] 3 4 [3] C 3 [10] S 4 5 The hill climbing search from S to G proceeds as follows: S A 8. In this way it is guaranteed to find the cheapest path. one may consider that the most promising successor of a node is the one that has the shortest straight-line distance to the goal city G.5 8 D 6 E A 8.The node closest to the goal state. The goal of the A* algorithm is to find a minimal costpath joining the start node and a goal node. A Heuristic Function (h(n)) is a function that calculates the cost of reaching the goal state from the node n. [8. i. Generally it selects node to expand that is believed to be closest (hence it's "greedy") to a goal node (i. this method always extends the cheapest path found so far. It always selects the most promising successor of the node last expanded.i). Hill climbing:.Hill climbing is depth-first search with a heuristic measurement that orders choices as nodes are expanded.Looks for the cheapest path from the start node to a goal node. iv). The search algorithm A*: . For instance. In figure below.5 6 B F 3 G iii). is expanded first. Uniform-cost search:.e. Greedy Search: . It uses the following evaluation function to estimate the promise of a node n: f*(n) = g*(n) + h*(n) Knowledge Based Systems ~ Wainaina Page 6 of 7 .. the straight line distances between each city and G is indicated in square brackets. as determined by an evaluation function f(n) = h(n).is a refinement of the greedy search due to the fact that it is neither optimal nor complete.e. if one exists. smallest f value). ii).

Notice that A* is very similar to the uniform-cost search.5 S 4 g*(D)=4 h*(D)=8 12 D f*(D)=4+8 5 2 step 3 A 17. the value of h* for each node is represented in square brackets. h*(D) = 8. except that it uses a different function (which is a heuristic function) to estimate the promise of a node.where: g*(n) estimates the minimum cost of a path from the start node to node n. That is. The node chosen for expansion is the one for which f* is minimum. h*(n) estimates the minimum cost from node n to a goal. Example Use A* algorithm to find the path from city S to city G by using the following functions: [8. Solution: step 1 g*(A)=3 h*(A)=8. A* reduces to uniform-cost search if h*(n) is always considered to be 0.5 step 2 4 7+6 step 5 4 C 14 B 13 5 18 E 11+6 3 A 11.5 5 8+8=16 D 9+8.5] A 4 [6] B 5 G D [8] 2 E [6] 4 F [3] 3 4 [3] C 3 [10] S 4 5 In the above figure.5 f*(A)=3+8.5 12 E 6+6 step 4 5 4 B 17 13 F 10+3 step 6 3 13 G A* search of a path from S to G. Knowledge Based Systems ~ Wainaina Page 7 of 7 . In fact.