I have a nurse scheduling problem that I'm trying to solve and it works as advertised right now. The objective function currently is trying to maximize the reward for scheduling individuals and the highest reward possible occurs when a person is working the last shift. The constraint I'm trying to implement prevents every person from working the last shift. The current output for x is:
$$ x = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ \end{bmatrix} $$
To help understand this output, each employee has 5 shift options (5 rows). A 0 indicates that shift is not selected for that employee and a 1 indicates it is. As you can see from this output then, each employee is working the last shift. What I am trying to implement is a constraint that doesn't allow this, for example:
$$ x = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ \end{bmatrix} $$
How do I solve for A and b?
$x_5 + x_{10} + x_{15} + \dots \le K$ where $K$ is the maximum number of employees allowed to work the last shift. ($K=1$ in your example above, but you did not specify how many employees can be on the same shift.)