Constraint Satisfaction and MEA
Constraint Satisfaction and MEA
Constraint Satisfaction and MEA
Assign decimal digit to each of the letters in such a way that the answer to
the problem is correct to the same letter occurs more than once , it must be
assign the same digit each time . no two different letters may be assigned the
same digit.
CONSTRAINTS
Goal State: the digits to the letters must be assigned in such a manner so that
the sum is satisfied.
Solution
In the MEA process, we detect the differences between the current state and
goal state. Once these differences occur, then we can apply an operator to
reduce the differences.
But sometimes it is possible that an operator cannot be applied to the current
state.
So we create the subproblem of the current state, in which operator can be
applied, such type of backward chaining in which operators are selected, and
then sub goals are set up to establish the preconditions of the operator is
called Operator Subgoaling.
Algorithm
Let's we take Current state as CURRENT and Goal State as GOAL, then following
are the steps for the MEA algorithm.
Step 1: Compare CURRENT to GOAL, if there are no differences between both
then return Success and Exit.
Step 2: Else, select the most significant difference and reduce it by doing the
following steps until the success or failure occurs.
Select a new operator O which is applicable for the current difference, and if there is no
such operator, then signal failure.
Attempt to apply operator O to CURRENT. Make a description of two states.
i) O-Start, a state in which O?s preconditions are satisfied.
ii) O-Result, the state that would result if O were applied In O-start.
If
(First-Part <------ MEA (CURRENT, O-START)
And
(LAST-Part <----- MEA (O-Result, GOAL), are successful, then signal Success and return
the result of combining FIRST-PART, O, and LAST-PART.
Example
Let's take an example where we know the initial state and goal state as given
below. In this problem, we need to get the goal state by finding differences
between the initial state and goal state and applying operators.
Solution
To solve the above problem, we will first find the differences between initial
states and goal states, and for each difference, we will generate a new state
and will apply the operators. The operators we have for this problem are:
Move
Delete
Expand
1. Evaluating the initial state: In the first step, we will evaluate the initial
state and will compare the initial and Goal state to find the differences
between both states.
2. Applying Delete operator: As we can check the first difference is that in
goal state there is no dot symbol which is present in the initial state, so, first
we will apply the D elete operator to remove this dot
3. Applying Move Operator: After applying the Delete operator, the new state
occurs which we will again compare with goal state. After comparing these
states, there is another difference that is the square is outside the circle, so,
we will apply the Move Operator.
4. Applying Expand Operator: Now a new state is generated in the third
step, and we will compare this state with the goal state. After comparing the
states there is still one difference which is the size of the square, so, we will
apply Expand operator, and finally, it will generate the goal state.
END