Production System And Control Strategy Computer Science Essay

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

CHAPTER 3

Chapter Outline--------------------------------------------------------------------------------------------

Introduction

State space search

Production System and Control Strategy

Blind Search and Heuristic Search

---------------------------------------------------------------------------------------------------------------------

3.1 Introduction –

A problem can be viewed as a task that requires a discussion or application of operations to reach some valid explanation. To find a solution of any problem it becomes necessary that the problem must be very precisely defined. In other words abstract problem should be converted into real world states which could be clearly understood.

To solve a problem following steps are needed –

Define the problem precisely.

Analyze the problem.

Isolate and represent the task knowledge that is necessary to solve problem.

Choose the best problem solving technique.

Example: If we say "PLAY CHESS" then it sounds an incomplete statement of the problem that we want to solve. To build a problem that could play chess we need following information –

Starting Position of Chess.

Rules that define legal moves.

Board positions that define win for one side / other side.

Goal is not only playing legal game of chess but also winning the game.

3.2 Define a problem as a state space – A problem is defined by its element and its relations. To define a state space that contains all the possible configuration of the relevant objects we need following information -

Specify 1 or more states that describe possible configuration from which the problem solving process may start. These states are called initial states.

Specify 1 or more states that would be acceptable solution to the problem. These states are called goal states.

Specify a set of rules that describe actions (operators) available to solve the problem.

Search Tree: It is a mechanism it is a technique to search the nodes in a tree, which represent the state-space. The sequence of states formed by possible moves is called a search tree.

3.3 Production System & Control Strategy

Production System – Production system are the system that provide structure to facilitate description & performing the search process. A production system consists of

A Set of rules. Each rule has 2 parts -

The left hand side (Antecedent) determines the applicability of the rule

The right side (Consequent) describes the operation to be performed.

One or more knowledgebase or database that contains whatever information is appropriate for that particular task.

A rule applier which checks the applicability of rule by matching the current state with the Left hand side rule.

Control Strategy - A control strategy specifies the order in which a particular rule will be compared to the database and it also provides a way of resolving the conflict that arise when several rules matches at once. A control strategy should be such that

It helps in moving towards a solution.

It is capable of selecting rules randomly, instead of starting every time from the first rule so as to reach the solution swiftly.

Example: Water Jug Problem

Problem Statement: - We are given 2 jugs, a 4 liter one and a 3- liter one. Neither has any measuring marker on it. There is a pump that can be used to fill the jugs with water. How can we get exactly 2 liters of water in to the 4-liter jugs?

Solution: - To solve this we have to make following assumptions –

1. We can fill a jug from the pump.

We can pour water out of a jug to the ground.

We can pour water from one jug to another.

There is no measuring device available.

State Space Representation - The state space for this problem can be defined as an ordered pair (x, y)

{ ( x , y ) x= 0,1,2,3,4 y= 0,1,2,3}

‘x’ represents the number of liters of water in the 4-liter jug

‘y’ represents the number of liters of water in the 3-liter jug.

Initial state: (0, 0)  Each jug is empty.

Goal state: (2, n)  First Jug should have 2 liters of water where as second jug can take

any value of ‘n’.

Production Rules:

1. (x, y) - (4, y) Fill the 4-gallon jug.

If x < 4

2. (x, y) - (x,3) Fill the 3-gallon jug.

If y < 3

3 (x, y) - (x – d, y) Pour some water out of the 4-gallon jug

If x >0

4 (x, y) - (x, y - d) pour some water out of the 3-Gallon jug

If y > 0

5 (x, y) - (0, y) Empty the 4-gallon jug on the ground

If x > 0

6 (x, y) - (x, 0) Empty the 3-gallon jug on the ground

If y > 0

7 (x, y) - (4,y – (4 -x)) pour some water from the 3-Gallon jug in to the

If x + y> 4 and y > 0 4 - gallon jug until the 4 -gallon jug is full.

8 (x, y) - (x-(3-y),3) pour water from the 4 -Gallon jug in to the

If x + y> 3 and x > 0 3 -Gallon jug until the 3 -gallon jug is full.

9. (x, y) - (x+y,0) pour all the water from the 3-Gallon jug in to the

If x + y <3 and x > 0 4- Gallon jug

10 (x, y) - (x+y,0) pour all the water from the 4-Gallon jug in to the

If x + y < 3 and x > 0 3- Gallon jug

11 (0,2) (2,0) pour all 2 allons from the 3-Gallon jug in to the

4-Gallon jug.

12. (2,y) (0,y) Empty the 2 Gallons in the Gallons in the 4-gallon jug on the Ground.

Solution 1

Water in 4 liter Jug

Water in 4 liter Jug

Rule Applied

0

0

4

0

1

1

3

8

1

0

6

0

1

10

4

1

1

2

3

8

Solution 2

Water in 4 liter Jug

Water in 4 liter Jug

Rule Applied

0

0

0

3

2

3

0

9

3

3

2

4

2

7

0

2

5

2

0

9

Solution 3

Water in 4 liter Jug

Water in 4 liter Jug

Rule Applied

0

0

4

0

1

1

3

8

0

3

5

3

0

9

3

3

2

4

2

7

0

2

5

2

0

9

The various operators (Production Rules) that are available to solve this problem may be stated as given in the following figure-

_

(4, 2) (3, 0) (0,3)

(0, 2) (4, 0)

(2, 0)

Figure : State Space Search Tree

3.4 Search Methods – A search method provides a way to find solution for a problem by trying different sequences of actions/ operators until a solution is found. It is defined by selecting the order of node expansion in a search tree. Search Strategies are evaluated along the following dimensions:

Completeness

Optimality

Time complexity

Space complexity

Uninformed/Blind Search

Search MethodsBreadth First Search

Depth First Search

Depth Limited Search

Iterative Deepening Search

Informed/Heuristic Search

Generate & Test

Hill Climbing Search

Best First Search (A*)

Problem Reduction (AO*)

Constraint Satisfaction

Branch & Bound

Mean End Analysis

3.4.1 Uninformed/Blind Search – In this type of search no additional information about the states is provided in the problem definition. Entire search space is looked for solution.

3.4.1.1 Breadth First Search – In this search method the root node is expanded first, then all the successors of the root node are expanded next, then their successors and so on. Breadth First Search is preferred in case of low branching factor, expensive operators or if the goals lie at reasonable depth.

The path followed by Breadth First Search is  a b c d e f g h i j k

3.4.1.2 Depth First Search –

This is characterized by the expansion of the deepest node first. Depth first search is preferred when goals are at leaves.

The path followed by Depth First Search  a b d h e i j c f k g

Depth Limited Search -

Problem with DFS is that search can go down an infinite branch and thus never return. This problem can be avoided by imposing a depth limit (d), which terminates the search at that depth. This search method is known as Depth Limited Search.

But the question is how to decide Depth Limit (d)????

Iterative Deepening Search -

To overcome this problem there is another search method iterative deepening search.

Iterative Deepening Search = Depth First Search + Best Depth Limit.

In this method all nodes at a given depth are expanded before going to the next level. Thus it guarantees to find a shortest path from start to goal state.

3.4.2 Informed/Heuristic Search –It is a technique to improve the efficiency of search process. In this type of search additional information about the problem is provided in order to guide the search in a specific domain. Additional information is given for search in form of heuristic function. Additional task domain knowledge is called heuristic knowledge.

Meaning of heuristic is "serving to find out". Heuristic basically are formal rules applied to find those branches in a state space that are most likely to lead to an acceptable and viable solution of a given problem.

Need of heuristic

There are two cases in AI searches when heuristics are needed:

The problem has no exact solution.

Example – In medical diagnosis doctors use heuristics to choose the most likely diagnoses given a set of symptoms.

The problem has an exact solution but is too complex to allow for a brute force solution. In a given state space search once we start search, that search might take a lot of time and effort , on the other hand heuristic search reduces time and effort considerably in finding the solution of the same problem .

Example – Consider a situation in which one wants to search a particular house in a city, if the available info about the house is only the address of house, and then search starts will require seeing the address of all the houses till the required house is found this is an example of blind/uninformed search. If an additional information or clue regarding the house is given that "house next to red colour building" then finding the house will require checking only red colour building. All houses which do not match this criterion are straight away rejected.

Design of a Heuristic Function –

Is a critical task.

It indicates that whether search is moving in the right direction or not.

When start and goal states are known then the heuristic function somehow relates current search state with the desired goal state.

However in certain cases where goal state is not known. In such cases heuristic function is designed on the basis of other criteria.

Example: 8-puzzle problem

Problem Statement: The 8-puzzle is a 3*3 square board with 9 positions, filled by 8 numbered tiles and one gap. At any point, a tile adjacent to the gap can be moved into the gap, creating a new gap position. In other words the gap can be swapped with an adjacent tile. The objective in the game is to begin with an arbitrary configuration of tiles, and move them so as to get the numbered tiles arranged in ascending order either running around the perimeter of the board or ordered from left to right.

Eight Puzzle

Heuristic 1 (H1): Count the out-of-place tiles, as compared to the goal.

Heuristic 2 (H2): Sum the distances by which each tile is out of place.

Start Goal H1 H2

-----------------------------------------------------------------------

2 8 3 1 2 3

1 6 4 8 - 4 5 6

- 7 5 7 6 5

2 8 3 1 2 3

1 - 4 8 - 4 3 4

7 6 5 7 6 5

2 8 3 1 2 3

1 6 4 8 - 4 5 6

7 5 - 7 6 5

Analysis of the Evaluation Function

In developing a good evaluation function for the states in a search space, you are interested in two things:

g(n): How far is state n from the start state?

h(n): How far is state n from a goal state?

The first value, g(n), is important because you often want to find the shortest path. This value (distance from start) can be exactly measured by incorporating a depth count into the search algorithm.

The second value, h(n), is important for guiding the search toward the goal. It is an estimated value based on your heuristic rules.

Evaluation function - This gives us the following evaluation function:

f(n) = g(n) + h(n)

where g(n) measures the actual length of the path from the start state to the state n, and h(n) is a heuristic estimate of the distance from a state n to a goal state.

Heuristic Applied to the Eight Puzzle Problem

The following figure shows the full best-first search of the eight puzzle graph using H1 -- that is, the value of h(n) is the number of tiles out of place. The number at the top of each state represents the order in which it was taken off of the open list. The levels of the graph are used to assign g(n). For each state, its heuristic value, f(n) is shown.

Reference  http://www.cs.trincoll.edu/~ram/cpsc352/notes/search.html

3.4.2.1 Generate & Test Algorithm – this search algorithm is simplest heuristic search

Generate a possible solution which can either be a point in the problem space or a path from the initial state.

Test to see if this possible solution is an acceptable solution by comparing the state reached with the set of goal states.

If it is an acceptable solution, return. Otherwise repeat from 1.

3.4.2.2 Hill Climbing Search:

"Like climbing Everest in thick fog with amnesia"

Here Generate and Test method is augmented by a 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

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.

3.4.2.3 Best First Search (A*)

http://www.cse.unsw.edu.au/~billw/Justsearch.html

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.

Example: Consider the following hypothetical search space and the trace of the best-first-search algorithm on it. The numbers associated with the state names give the heuristic value of the state.

Best First Search

Best first search is a simplified A*.

Start with OPEN holding the initial nodes.

Pick the BEST node on OPEN such that f = g + h' is minimal.

If BEST is goal node quit and return the path from initial to BEST Otherwise

Remove BEST from OPEN and all of BEST's children, labelling each with its path from initial node.

http://www.cs.cf.ac.uk/Dave/AI2/best_tree.gif

3.4.2.4 Problem Reduction (AO*)

And-Or Graphs

Useful for certain problems where

The solution involves decomposing the problem into smaller problems.

We then solve these smaller problems.

Here the alternatives often involve branches where some or all must be satisfied before we can progress.

For example if I want to earn money then I could

Rob a bank. OR

Do Hard Work AND get a good job.

if I want to acquire TV set then I could

Steal a TV. OR

Arrange money AND buy TV.

AO* Algorithm

Initialise the graph to start node

Traverse the graph following the current path accumulating nodes that have not yet been expanded or solved

Pick any of these nodes and expand it and if it has no successors call this value FUTILITY otherwise calculate only f' for each of the successors.

If f' is 0 then mark the node as SOLVED

Change the value of f' for the newly created node to reflect its successors by back propagation.

Wherever possible use the most promising routes and if a node is marked as SOLVED then mark the parent node as SOLVED.

If starting node is SOLVED or value > FUTILITY, stop. Else repeat from 2.

3.4.2.5 Constraint Satisfaction

The general problem is to find a solution that satisfies a set of constraints.

Heuristics used not to estimate the distance to the goal but to decide what node to expand nest.

Examples of this technique are design problem, labelling graphs, robot path planning and crypt arithmetic puzzles.

Algorithm:

Propagate available constraints:

Open all objects that must be assigned values in a complete solution.

Repeat until inconsistency or all objects assigned valid valid values:

Select an object and strengthen as much as possible the set of constraints that apply to object.

If set of constraints different from previous set then open all objects that share any of these constraints.

Remove selected object.

If union of constraints discovered above defines a solution return solution.

If union of constraints discovered above defines a contradiction return failure

3.1 Make a guess in order to proceed. Repeat until a solution is found or all possible solutions exhausted:

Select an object with a no assigned value and try to strengthen its constraints.

Recursively invoke constraint satisfaction with the current set of constraints plus the selected strengthening constraint.

3.4.2.6 Branch & Bound

Branch and bound is an optimizing method for solving CSPs that are too large (whether it be in the number of variables and constraints or the complexity of the constraints) to search all the solutions. The idea borrows from that of partitioning; the first solution to the problem is found (and along with it, some evaluation) and a constraint is added on the objective function to form a "subproblem" of the original so that the subproblem will be searched for the first solution found again and repeated until some optimal solution for a minimizing/maximizing function is found or there are no more solutions left. The creation of a new subproblem from the original is the branching part of the algorithm, while the bounding is the use of the evaluation for a solution to bound the new constraint. While this approach to large problems that need to be optimized is practical for real constraints like time and space, it is also more efficient. Once you have a bound, the search can stop before finding a solution if it knows that the evaluation will not be as low as one previously found.

Branch and Bound

Terminology

Definition 1: Live node is a node that has been generated but whose children have not yet been generated.

Definition 2: E-node is a node currently being expanded.

Definition 3: Dead node is a generated node that is not to be expanded or explored any further. All children of a dead node have already been expanded.

Definition 4: Branch-and-bound refers to all state space search methods in which all children of an E-node are generated before any other live node can become the E-node.

Example: Travelling Salesman Problem

Starting at A, find the shortest path through all the cities, visiting each city exactly once and returning to A.

Traveling Salesman Problem

Reducing Search Complexity: For N cities, a brute-force solution to the travelling salesman problem takes N! Time. There are ways to reduce this complexity:

Branch and Bound Algorithm: Generate one path at a time, keeping track of the best circuit so far. Use the best circuit so far as a bound on future branches of the search. This reduces the complexity to 1.26N.

3.4.2.7 Mean End Analysis –

"Certain things we can do (Means) will have certain results (Ends)"

In this technique we solve major parts of a problem first and then return to smaller problems when assembling the final solution.

GPS was the first AI program to exploit means-ends analysis.

Operator Table -

Difference Table – It provides the knowledge needed to decompose a problem into sub problems i.e. it tells the rules to be applied according to the differences.

Rules – mean end analysis relies on a set of rules that can transform one problem state into another –

L.H.S.  R.H.S.

L.H.S. describes the condition that must be met for the rule to be applicable. These are called pre conditions. The R.H.S. describes those aspects of the problem state that will be changed by the application of the rule

Means-ends analysis algorithm is:

Until the goal is reached or no more procedures are available:

Describe the current state, the goal state and the differences between the two.

Use the difference that describes a procedure that will hopefully get nearer to goal.

Use the procedure and update current state.

If goal is reached then success otherwise fail.

Example – Get from your home in Delhi to your friend’s home in Bombay.

Operator Table

Operators

Pre-condition

Post-condition

Use aeroplane

be at airport

Use Train

Be at railway station

Use Bus

Be at bus stop

Use Car

Be inside car

Walk

None

Difference Table

Difference

Aeroplane

Train

Bus

Car

Walk

d>1000

√

100<d<1000

√

√

1<d<100

√

√

d<1

√

Solved Problems -

Problem 1: Missionaries and Cannibals Problem

Statement: - Three missionaries and three cannibals find themselves on one side of a river. They have would like to get to the other side. Missionaries managed the trip across the river in such a way that the number of missionaries on either side of the river is never less than the number of cannibals who are on the same side. The boat available holds only two at a time. How can everyone get across the river without the missionaries risking being eaten?

Solution:- To solve this problem we will make the following assumptions:

1. Number of cannibals should lesser than the missionaries on either side.

2. Only one boat is available to travel.

3. Only one or maximum of two people can go in the boat at a time.

4. All the six have to cross the river from bank.

5. There is no restriction on the number of trips that can be made to reach of the goal.

6. Both the missionaries and cannibals can row the boat.

The state for this problem can be defined as

{(i, j) / i = 0, 1, 2, 3. j = 0, 1, 2, 3}

Where i represents the number of missionaries in one side of a river.

j represents the number of cannibals in the same side of a river.

Initial State 3 missionaries and 3 cannibals on one side of a river, (Bank 1) and

(0, 0) on another side of the river (bank 2).

Bank 1 ------------------------- Bank 2

(3, 3) (0, 0)

Goal State is to get (3, 3) at bank 2 and (0, 0) at bank 1.

Bank 1 ------------------------- Bank 2

(0, 0) (3, 3)

(i, j) : two missionary can go only when i-2>=j or i-2=0 on one bank and i+2>=j on other bank of river.

(i, j) : two cannibals can cross the river only when j-2<=i or i=0 on one bank and j+2<=i or i=0 on the other.

(i, j) : one missionary and one cannibal can go only when i-1>=j-1 or i=0 on one bank and i+1>=j+1or i=0 on the other.

(i, j) : one missionary can cross the river only when i-1>=j or i=0 on one bank i+1>=j on the other bank.

(i, j) : one cannibal can cross the river only when j-1<i or i=0 on one bank and j+1<=I or j=0 on the other bank of river.

Bank 1

Boat

Bank 2

Rule Applied

(3,3)

(0,0)

(3,1)



(0,2)

(0,2)

2

(3,2)

(0,1)



(0,1)

5

(3,0)



(0,2)

(0,3)

2

(3,1)

(0,1)



(0,2)

5

(1,1)



(2,0)

(2,2)

1

(2,2)

(1,1)



(1,1)

3

(0,2)



(2,0)

(3,1)

1

(0,3)

(0,1)



(3,0)

5

(0,1)



(0,2)

(3,2)

2

(0,2)

(0,1)



(3,1)

5

(0,0)



(0,2)

(3,3)

2

Problem 2: Farmer Fox Problem

Statement: A farmer must move a chicken, bag of grain and fox from one bank of the river to the other by boat.  The boat can hold only the farmer and one other object at a time.  If the chicken is left unattended on a bank with the grain, it will eat it.  The fox will also eat the chicken if they are left unattended.

Solution: To solve this problem we will make the following assumptions

1. Only one boat is available to travel.

2. Only one or maximum of two entities can go in the boat at a time.

3. All the four have to cross the river from bank.

4. There is no restriction on the number of trips that can be made to reach of the goal.

5. Only the farmer can row the boat.

Initial State: Source Bank ----------------------------- Destination Bank

(Farmer, Chicken, Grain, Fox) (0, 0)

Goal State: Source Bank ----------------------------- Destination Bank

(0, 0) (Farmer, Chicken, Grain, Fox)

Production Rules: Production rules to generate moves are given below -

If Farmer, Chicken, Grain and Fox are on the destination bank, then STOP!

If Farmer, Grain and Fox are on the source bank, and Chicken on the destination bank, then Farmer row Grain to the destination bank.

If Farmer, Chicken and Grain are on the destination bank, and Fox on the source bank, then Farmer row Chicken to the source bank.

If Farmer, Chicken and Fox are on the source bank, and Grain on the destination bank, then Farmer row Fox to the destination bank.

If Farmer and Chicken are on the source bank, then Farmer row Chicken to the destination bank.

If Farmer is on the destination bank, then Farmer row to the source bank.

One solution sequence:

Source Bank |  Boat  | Destination Bank Rule Applied

                         |   |

Farmer Chicken Grain Fox |•  | Rule 3

                         |   |

               Grain Fox |  • | Farmer Chicken Rule 6

                         |   |

        Farmer Grain Fox |•  | Chicken Rule 2

                         |   |

                     Fox |  • | Farmer Chicken Grain Rule 6

                         |   |

      Farmer Chicken Fox |•  | Grain Rule 4

                         |   |

                 Chicken |  • | Farmer Grain Fox Rule 6

                         |   |

          Farmer Chicken |•  | Grain Fox Rule 5

                         |   |

                         |  • | Farmer Chicken Grain Fox Rule 1

Problem 3: Travelling Salesman Problem

Statement: A salesman has a set of towns and the distances between them. Each of which must visit exactly once. Determine the shortest path starting from a given town, passing through all the other towns and returning to the first town.

Solution: To solve this problem we will consider 4

http://www.compapp.dcu.ie/~humphrys/Notes/AI/statespace.html

Problem 8: Monkey Banana Problem

Statement: A monkey is in a room. Suspended from the ceiling is a bunch of bananas, beyond the monkey's reach. In the corner of the room is a box. How can the monkey get the bananas?

Solution

State space: without variables, the state space and search space can be very large (how many positions are there?). With variables, we can represent the reachable part as follows. For each state, we need to record:

- the position of the monkey (door, window, middle, ...)

- the position of the box

- if the monkey is on the box

- if the monkey has the banana

So state space will be (Pos_of_monkey, Pos_of_Box, monkey_on_box, Monkey_has_banana)

Initial state: (door, window, no, no).

Goal states: (*, *, *, yes).

Rules/Actions :

walk(P): from (M, B, no, H) to (P, B, no, H).

push(P): from (M, M, no, H) to (P, P, no, H).

climb: from (M, M, no, H) to (M, M, yes, H).

grasp: from (middle, B, yes, no) to (middle, B, yes, yes).

State space

Without variables, the state space and search space can be very large (how many positions are there?).

With variables, we can represent the reachable part as follows.

Initial state:

monkey on ground

with empty hand

bananas suspended

Goal state:

monkey eating

Actions:

climb chair/get off

grab X

wave X

eat X

Problem 9: Tic Tac Toe Problem

Statement: The states of a game can be described by the contents of the board and the player whose turn is next. The board can be represented as an array of 9 cells, each of which may contain a ‘X’ or ‘O’ or may be empty. Get three X's in a row (horizontal, vertical, or diagonal) before the computer gets three O's in a row.

Solution: The Board configuration to move the next ‘X’ or ‘O’

Initial State: Board is empty & X’s turn.

Goal State: Three X’s in a row; in column, in diagonal

Three O’s in a row;

All cells are full with no cells empty.

Operators: The operators can change an empty cell to a ‘X’ or to a ‘O’.

State Space Search Tree

Initial State

Problem 1: 8 Puzzle Problem

Statement: - The 8-puzzle is a 3*3 square board with 9 positions, filled by 8 numbered tiles and one gap. At any point, a tile adjacent to the gap can be moved into the gap, creating a new gap position. In other words the gap can be swapped with an adjacent tile. The objective in the game is to begin with an arbitrary configuration of tiles, and move them so as to get the numbered tiles arranged in ascending order either running around the perimeter of the board or ordered from left to right.

Solution:-

This problem may have more than one initial state & goal state. An example scenario is shown below.

8puzzle8 Puzzle Initial State8 Puzzle Goal State B8 Puzzle Goal State

Initial State Goal State

The state space: A state description specifies the location of each of 8 tiles and the blank in one of the nine squares.

Initial state: Any state can be designated as initial state.

Goal state: Tiles are in specific order.

Actions: Blank moves left, right, up, down direction.

Problem 2: 8 Queen Problem

Statement: - We have 8 queens and a 8*8 chessboard having alternate black and white squares. The queens are placed on the chessboard. Any queen can attack any other queen placed on same row or column or diagonal. We have to find the proper placement of queen on the chess board in such a way that no queen attacks other queen.

Solution:-

The state space: A state description specifies any arrangement of n<=8 Queens.

Initial state: No Queen on the board.

Goal state: 8 Queens on the board but none attacked.

Actions: Add Queens to any empty squares.

Add Queen to left most square such that it is not attacked by others.

Problem 3: Vacuum World

vacuum2-environment

Solution:- States

Agent location and dirt location

How many possible states?

What if there are n possible locations?

Actions

Left, right, suck

Problem: Block World Puzzle

Key Points --------------------------------------------------------------------------------------------------

Search is the basic technique to find solution of almost all AI problems.

Problem formulation is an important step before solving any problem.

Initial state, goal state and operators are 3 basic components of state space representation.

A search space is usually represented as a graph or tree and search constitute of finding a path from start node to goal node.

A search tree is formed by successively expanding states starting from initial state to goal state.

Breadth First Search is preferred in case of low branching factor, expensive operators or if the goals lie at reasonable depth.

Depth First Search is preferred when goals are at leaves.

Heuristic Search techniques do not guarantee to find the best solution.

Hill Climbing Search always moves towards goal. In this heuristic function is used to estimate how close a given state is to a goal state.

Best First Search is a combination of Breadth First Search and Depth First Search.

Mean End Analysis solves major parts of problem first and then returns to smaller problem while assembling the final solution.

Constraint Satisfaction is mainly used to solve crypt arithmetic puzzles.

---------------------------------------------------------------------------------------------------------------------

Exercise-

Q.1 what do you mean by state space search?

Q.2 what do you mean by a production system?

Q.3 what is Heuristic Function? Write down heuristic function for Chess problem.

Q.4 Discuss the merits of Depth First Search & Breadth First Search with suitable example?

Q.4 Compare the A* & AO* Algorithm with appropriate example?

Q.5 When will Hill climbing search fails? Can you suggest any improvement over hill climbing?

Q.6 Suggest some examples where simple Breadth First Search outperforms Best First Search?

Q.7 Solve the monkey banana problem using mean end analysis technique.

Q.8 Give production Rules and Heuristic for –

Tower of Hanoi

Queen Problem

Q.9 Solve the Sliding Block Puzzle problem by using heuristic search.

Q.10 Solve the following Crypt arithmetic problem using Constraint Satisfaction Problem -



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now