I have an optimization problem that has a variable in the matrix form. The variable is a binary matrix. It has size $M \times N = 10 \times 50$ where $M$ is the number of machines and $N$ is the number of resources. The resources are indexed as $\{1, 2, 3, \dots, 50 \}$. Also, one resource can be shared by multiple machines and each row corresponds to a machine.
The condition is as follows:
- One user can have maximum of 20 resources.
- The resources assigned to any user must be contiguous.
For example, let us consider user $5$. It got $10$ resources. If the first resource is being assigned to the index $10$, the other $9$ resources must be indexed as $11$ to $19$ so that all the resources assigned to user 5 are contiguous. How can I model this constraint?