Constraint Satisfaction Solver Calculator

Build compact CSP models with bounds and relations. Solve scenarios, compare pruning, and export findings. Understand consistency checks through examples, tables, and interactive charts.

Build Your CSP Model

Use comma-separated variables, optional custom domains, and one relation per line.

Enter names like X, Y, Task1, ColorA.
One line per variable. Example: A: 1,2,3
Optional. One assignment per line.
One variable group per line.
Supported operators: =, !=, <, <=, >, >=. Right side may be a variable or integer constant.

Example Data Table

This sample shows a compact model with a small search space and one feasible assignment family.

Variable Domain Role Example Restriction
A {1, 2, 3} Start value A < B
B {2, 3, 4} Middle value B != C
C {1, 3, 4} Upper value C > D
D {1, 2, 4} Lower bound helper D != 2

Formula Used

A constraint satisfaction problem searches for assignments that satisfy every rule simultaneously. This page uses these core measures:

The solver performs depth-first backtracking. Each candidate value is tested against all relevant unary and binary constraints before deeper recursion.

How to Use This Calculator

  1. Enter your variable names as a comma-separated list.
  2. Set a global integer domain using minimum, maximum, and step.
  3. Override any variable with custom domain lines when needed.
  4. Add fixed values for preassigned variables.
  5. Add all-different groups for uniqueness conditions.
  6. Write one relation per line using supported comparison operators.
  7. Choose MRV and forward checking to improve search efficiency.
  8. Submit the form and review feasible assignments, diagnostics, CSV export, PDF export, and the Plotly chart.

Frequently Asked Questions

1. What does this calculator solve?

It solves small integer-based constraint satisfaction models. You define variables, domains, and rules, then the page searches for assignments that satisfy every condition together.

2. What kinds of constraints are supported?

You can use equality, inequality, ordering, constant comparisons, and all-different groups. Relations may compare a variable with another variable or an integer constant.

3. What is MRV in this solver?

MRV means minimum remaining values. The solver picks the next variable with the smallest active domain, which often reduces branching and speeds up backtracking.

4. What does forward checking do?

Forward checking prunes future domain values after each assignment. If a future variable loses every allowed value, the branch fails immediately instead of wasting more search steps.

5. Why might the solver return no solution?

A model becomes infeasible when domains, fixed values, or relations conflict. Tight rules can eliminate every legal assignment, leaving the problem with no consistent solution.

6. Why is the solution count marked as “at least”?

That appears when the enumeration limit is reached. The page stops after the selected maximum number of solutions, so the true total may be larger.

7. Can I use this for large industrial CSP models?

It is best for educational, planning, and moderate-size experiments. Very large CSP instances may require specialized propagation, heuristics, and dedicated optimization engines.

8. What does the chart represent?

The chart compares effective domain sizes after filtering. When a feasible assignment exists, it also overlays the first returned value for each variable.

Related Calculators

knapsack problem solverprofit maximization calculatorslack variable calculatorbranch and bound solverconstrained optimization solverdual simplex solvergenetic algorithm solvertransportation problem solverpower flow optimizationsupply chain optimizer

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.