Constraint programming (CP) is a paradigm for solving combinatorial problems that draws on a wide range of techniques from artificial intelligence, computer science, and operations research. It is a form of declarative programming that uses mathematical constraints to define the rules that must be met.
For example, consider a travel booking website that allows users to select flights, hotels, and rental cars. The website could use constraint programming to automatically check for feasible combinations of these options that meet the user’s preferences, such as budget, location, and travel dates.