> For the complete documentation index, see [llms.txt](https://docs.sdv.dev/sdv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/reference/constraint-logic/predefined-constraint-classes/fixedcombinations.md).

# FixedCombinations

**Compatibility:** 2 or more categorical columns

The `FixedCombinations` constraint enforces that the combinations between a set of columns are fixed. That is, no other permutations or shuffling is allowed other than what's already observed in the data.

## Parameters

(required) `column_names`: A list of two or more columns whose combinations are fixed. The SDV will not further shuffle the data between these column names.&#x20;

## Example

Define your constraint using the parameters and then add it to a synthesizer.

```python
my_constraint = {
    'constraint_class': 'FixedCombinations',
    'table_name': 'locations', # for multi table synthesizers
    'constraint_parameters': {
        'column_names': ['city', 'country']
    }
}

my_synthesizer.add_constraints(constraints=[
    my_constraint
])
```

## FAQs

<details>

<summary>Why can't I apply this constraint to a single column?</summary>

This constraint ensures that the synthetic data only contains combinations that exist in the real data. If there is only one column, there are no combinations.

The SDV already guarantees that the synthetic data contains the same categorical values as the real data for a single column.

</details>

<details>

<summary>The synthetic data has the same combination multiple times. Is this intended?</summary>

Yes. This constraint prevents the SDV from creating additional permutations between columns. But the same permutations are allowed to appear multiple times.

For example, it will prevent the SDV from inventing new `city, country` pairs, but a valid pair such as `Boston, USA` may appear more than once.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/reference/constraint-logic/predefined-constraint-classes/fixedcombinations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
