add constraint in ai_solution