Recent research in AI Planning is focused on improving the quality of the generated plans. PDDL3 incorporates hard and soft constraints on goals and the plan trajectory. Plan trajectory constraints are conditions that need to be satisfied at various stages of the plan. Soft goals are goals, which need not necessarily be achieved but are desirable. An extension of Constraint Satisfaction Problem, called Optimal Constraint Satisfaction Problem (OCSP) has allowance for defining soft constraints and objective functions. Each soft constraint is associated with a penalty, which will be levied if the constraint is violated. The OCSP solver arrives at a solution that minimizes the total penalty (Objective function) and satisfies all hard constraints. In this paper, an OCSP encoding for the classical planning problems with plan trajectory constraints, soft and hard goals is proposed. Modal operators associated with hard goals and hard plan trajectory constraints are handled by preprocessing an...