# Unary Constraint

### Overview

A Unary Constraint in Verteego applies a single static bound to one variable, imposing a specific limitation on its value. This type of constraint is essential for ensuring that the variable remains within acceptable limits, thereby maintaining the integrity and feasibility of the optimization model.

### Application

Unary Constraints are used to enforce a lower or upper limit on a variable, which can be crucial for maintaining business rules and operational limits. For example, setting a minimum price to ensure profitability.

### Parameters

* **column:** Specifies the name of the column that contains the variable to be constrained. This variable represents an element of the data that is crucial for the optimization process.
* **bound:** A numeric value that will serve as the boundary for the variable. This number can act as either a cap (upper limit) or a floor (lower limit) depending on the operator used.
* **operator:** Defines the type of constraint relation between the variable and the bound. Options include:
  * `equal` – The variable must be exactly equal to the bound.
  * `lesser` – The variable must be less than or equal to the bound.
  * `greater` – The variable must be greater than or equal to the bound.

### Example

Here is an example of how to configure a Unary Constraint in YAML format to ensure that a price cannot fall below zero:

```yaml
  lower_bound_on_price:
    constraint_type: unary
    column: price
    operator: greater
    bound: 0
```

### Best Practices

When implementing Unary Constraints, it is crucial to:

* **Clearly identify the variable** that needs bounding to avoid unintended constraints on other elements of the dataset.
* **Select appropriate bounds** that align with operational and business goals.
* **Use the correct operator** to accurately reflect the intended limitation, whether it's ensuring a minimum value, capping a maximum value, or setting an exact requirement.
