# XCSP^{3}

XCSP^{3} is an XML-based format designed to represent instances of combinatorial constrained problems from the angle of Constraint Programming (CP). XCSP^{3} is an intermediate integrated format that can represent each instance separately while preserving its structure. *Important:*

- for only dealing with the most popular constraints and frameworks, use XCSP
^{3}-core; - for modeling problems declaratively, and compiling them into XCSP
^{3}instances, use the Python library PyCSP^{3}.

**Licence:**Creative commons (CC BY-SA 4.0) for specifications and MIT Licence for any derived piece of software and benchmarks

#### Constraint Programming Format

XCSP^{3} allows you to deal with:

- Decision Problems encoded as CSP (Constraint Satisfaction Problem)

- Optimization Problems encoded as COP (Constrained Optimization Problem)

#### Comprehensive Format

Many supported frameworks: CSP, COP, WCSP, QCSP, DisCSP, ...

Many types of variables and constraints

Many variations of popular constraints

Reification and Relaxation

Annotations

#### Structure-Preserving Format

Natural mechanisms to keep structure:

- Arrays of variables

- Groups of constraints

- Blocks of constraints

- Meta-constraints

#### Resources and Tools

Well-documented specifications

More than 23,000 instances

Parsers developped in Java, C++ and Rust

PyCSP^{3}: Python Library for modeling

*Last News*

- August 30, 2023
- 2023 XCSP
^{3}Competition; held with CP 2023; see the results.

- August 3, 2022
- 2022 XCSP
^{3}Competition, held with FLoC 2022 (Olympic Games); see the results.

- December 15, 2021
- PySCP
^{3}2.0 , Version 2 of the Python library PyCSP^{3}.

- December 15, 2021
- ACE 2.0 , Version 2 of the generic constraint solver ACE (written in Java).

- January 16, 2021
- Specifications of XCSP
^{3}, Version 3.0.7

Here, we present two XCSP^{3} instances for two well-known problems:

#### Knapsack problem

`<instance format="XCSP`^{3}" type="COP">
<variables>
<array id="x" size="[5]"> 0 1 </array>
</variables>
<constraints>
<sum>
<list> x[] </list>
<coeffs> 11 24 5 23 16 </coeffs>
<condition> (le,100) </condition>
</sum>
</constraints>
<objectives>
<maximize type="sum">
<list> x[] </list>
<coeffs> 46 46 38 88 3 </coeffs>
</maximize>
</objectives>
</instance>

#### All Interval problem

`<instance format="XCSP`^{3}" type="CSP">
<variables>
<array id="x" size="[5]" note="x[i] is the ith value of the series">
0..4
</array>
<array id="y" size="[4]" note="y[i] is the distance between x[i] and x[i+1]">
1..4
</array>
</variables>
<constraints>
<allDifferent> x[] </allDifferent>
<allDifferent> y[] </allDifferent>
<group class="channeling">
<intension> eq(%0,dist(%1,%2)) </intension>
<args> y[0] x[0] x[1] </args>
<args> y[1] x[1] x[2] </args>
<args> y[2] x[2] x[3] </args>
<args> y[3] x[3] x[4] </args>
</group>
</constraints>
</instance>

### Some Features

#### Specifications

- Download the full documentation of XCSP
^{3} - Download the documentation of XCSP
^{3}-core

#### Series of Instances

This website contains many <a href=/series>series</a> of XCSP^{3}problem instances.

#### Tools

- A Java 8 Parser, a C++ 11 Parser, and a Rust parser are available
- A Java 8 Solution Checker is available

#### Modeling

- A Python Library for modeling and compiling problems: PyCSP
^{3} - A Java API for modeling and compiling problems: JvCSP
^{3}

### Related Sites

- Many useful information about global constraints in the Global Constraint Catalog
- Many useful information about problems and models at CSPLib - a problem libary for constraints