Skip to main content
Fixed minor typo
Source Link
joni
  • 1.6k
  • 9
  • 14

If I understood you correctly, you could do it like this (assuming that $n$ is even and $m = n-1$)

First, add the binary variables

$$ \begin{align} h_{is} &= \begin{cases} 1, &\text{if team $i$ plays at home in round $s$ and $s-1$}, \\ 0, &\text{otherwise}, \end{cases} \\\\ % a_{is} &= \begin{cases} 1, &\text{if team $i$ plays away in round $s$ and $s-1$}, \\ 0, &\text{otherwise} \end{cases} \end{align} $$

for all teams $i = 1, \ldots, n$ and rounds $s = 2, \ldots, m$.

In order to count the number of breaks, we need to formulate the following if-then constraints

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m.\\ \end{align} $$

This can be done as follows:

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i,j,s} &\leq 1 + h_{i,s} \quad\forall i=1,..,n, s=2,...,m, \\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j,i,s} &\leq 1 + a_{i,s}, \quad\forall i=1,...n, s=2,...,m. \end{align} $$

Consequently, we can minimize the number of breaks by setting the objective function

$$ \min \quad \sum_{i=1}^{n} \sum_{s = 1}^{m} h_{i,s} + a_{i,s} . $$$$ \min \quad \sum_{i=1}^{n} \sum_{s = 2}^{m} h_{i,s} + a_{i,s} . $$

If I understood you correctly, you could do it like this (assuming that $n$ is even and $m = n-1$)

First, add the binary variables

$$ \begin{align} h_{is} &= \begin{cases} 1, &\text{if team $i$ plays at home in round $s$ and $s-1$}, \\ 0, &\text{otherwise}, \end{cases} \\\\ % a_{is} &= \begin{cases} 1, &\text{if team $i$ plays away in round $s$ and $s-1$}, \\ 0, &\text{otherwise} \end{cases} \end{align} $$

for all teams $i = 1, \ldots, n$ and rounds $s = 2, \ldots, m$.

In order to count the number of breaks, we need to formulate the following if-then constraints

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m.\\ \end{align} $$

This can be done as follows:

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i,j,s} &\leq 1 + h_{i,s} \quad\forall i=1,..,n, s=2,...,m, \\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j,i,s} &\leq 1 + a_{i,s}, \quad\forall i=1,...n, s=2,...,m. \end{align} $$

Consequently, we can minimize the number of breaks by setting the objective function

$$ \min \quad \sum_{i=1}^{n} \sum_{s = 1}^{m} h_{i,s} + a_{i,s} . $$

If I understood you correctly, you could do it like this (assuming that $n$ is even and $m = n-1$)

First, add the binary variables

$$ \begin{align} h_{is} &= \begin{cases} 1, &\text{if team $i$ plays at home in round $s$ and $s-1$}, \\ 0, &\text{otherwise}, \end{cases} \\\\ % a_{is} &= \begin{cases} 1, &\text{if team $i$ plays away in round $s$ and $s-1$}, \\ 0, &\text{otherwise} \end{cases} \end{align} $$

for all teams $i = 1, \ldots, n$ and rounds $s = 2, \ldots, m$.

In order to count the number of breaks, we need to formulate the following if-then constraints

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m.\\ \end{align} $$

This can be done as follows:

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i,j,s} &\leq 1 + h_{i,s} \quad\forall i=1,..,n, s=2,...,m, \\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j,i,s} &\leq 1 + a_{i,s}, \quad\forall i=1,...n, s=2,...,m. \end{align} $$

Consequently, we can minimize the number of breaks by setting the objective function

$$ \min \quad \sum_{i=1}^{n} \sum_{s = 2}^{m} h_{i,s} + a_{i,s} . $$

added 14 characters in body
Source Link
TheSimpliFire
  • 5.5k
  • 5
  • 23
  • 56

If I understood you correctly, you could do it like this (assuming that $n$ is even and $m = n-1$)

First, add the binary variables

$$ \begin{align} h_{is} &= \begin{cases} 1, &\text{if team $i$ plays at home in round $s$ and $s-1$}, \\ 0, &\text{otherwise}, \end{cases} \\\\ % a_{is} &= \begin{cases} 1, &\text{if team $i$ plays away in round $s$ and $s-1$}, \\ 0, &\text{otherwise} \end{cases} \end{align} $$

for all teams $i = 1, \ldots, n$ and rounds $s = 2, \ldots, m$.

In order to count the number of breaks, we need to formulate the following if-then constraints

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,..,n, s=2,...,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,..,n, s=2,...,m.\\ \end{align} $$$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m.\\ \end{align} $$

This can be done as follows:

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i,j,s} &\leq 1 + h_{i,s} \quad\forall i=1,..,n, s=2,...,m, \\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j,i,s} &\leq 1 + a_{i,s}, \quad\forall i=1,...n, s=2,...,m. \end{align} $$

Consequently, we can minimize the number of breaks by setting the objective function

$$ \min \quad \sum_{i=1}^{n} \sum_{s = 1}^{m} h_{i,s} + a_{i,s} . $$

If I understood you correctly, you could do it like this (assuming that $n$ is even and $m = n-1$)

First, add the binary variables

$$ \begin{align} h_{is} &= \begin{cases} 1, &\text{if team $i$ plays at home in round $s$ and $s-1$}, \\ 0, &\text{otherwise}, \end{cases} \\\\ % a_{is} &= \begin{cases} 1, &\text{if team $i$ plays away in round $s$ and $s-1$}, \\ 0, &\text{otherwise} \end{cases} \end{align} $$

for all teams $i = 1, \ldots, n$ and rounds $s = 2, \ldots, m$.

In order to count the number of breaks, we need to formulate the following if-then constraints

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,..,n, s=2,...,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,..,n, s=2,...,m.\\ \end{align} $$

This can be done as follows:

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i,j,s} &\leq 1 + h_{i,s} \quad\forall i=1,..,n, s=2,...,m, \\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j,i,s} &\leq 1 + a_{i,s}, \quad\forall i=1,...n, s=2,...,m. \end{align} $$

Consequently, we can minimize the number of breaks by setting the objective function

$$ \min \quad \sum_{i=1}^{n} \sum_{s = 1}^{m} h_{i,s} + a_{i,s} . $$

If I understood you correctly, you could do it like this (assuming that $n$ is even and $m = n-1$)

First, add the binary variables

$$ \begin{align} h_{is} &= \begin{cases} 1, &\text{if team $i$ plays at home in round $s$ and $s-1$}, \\ 0, &\text{otherwise}, \end{cases} \\\\ % a_{is} &= \begin{cases} 1, &\text{if team $i$ plays away in round $s$ and $s-1$}, \\ 0, &\text{otherwise} \end{cases} \end{align} $$

for all teams $i = 1, \ldots, n$ and rounds $s = 2, \ldots, m$.

In order to count the number of breaks, we need to formulate the following if-then constraints

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,\ldots,n, s=2,\ldots,m.\\ \end{align} $$

This can be done as follows:

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i,j,s} &\leq 1 + h_{i,s} \quad\forall i=1,..,n, s=2,...,m, \\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j,i,s} &\leq 1 + a_{i,s}, \quad\forall i=1,...n, s=2,...,m. \end{align} $$

Consequently, we can minimize the number of breaks by setting the objective function

$$ \min \quad \sum_{i=1}^{n} \sum_{s = 1}^{m} h_{i,s} + a_{i,s} . $$

Source Link
joni
  • 1.6k
  • 9
  • 14

If I understood you correctly, you could do it like this (assuming that $n$ is even and $m = n-1$)

First, add the binary variables

$$ \begin{align} h_{is} &= \begin{cases} 1, &\text{if team $i$ plays at home in round $s$ and $s-1$}, \\ 0, &\text{otherwise}, \end{cases} \\\\ % a_{is} &= \begin{cases} 1, &\text{if team $i$ plays away in round $s$ and $s-1$}, \\ 0, &\text{otherwise} \end{cases} \end{align} $$

for all teams $i = 1, \ldots, n$ and rounds $s = 2, \ldots, m$.

In order to count the number of breaks, we need to formulate the following if-then constraints

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i, j, s} &= 2 \implies h_{i,s} = 1, \quad\forall i=1,..,n, s=2,...,m,\\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j, i, s} &= 2 \implies a_{i,s} = 1, \quad\forall i=1,..,n, s=2,...,m.\\ \end{align} $$

This can be done as follows:

$$ \begin{align} \sum_{j=1}^{n} x_{i,j,s-1} + x_{i,j,s} &\leq 1 + h_{i,s} \quad\forall i=1,..,n, s=2,...,m, \\ \sum_{j=1}^{n} x_{j,i,s-1} + x_{j,i,s} &\leq 1 + a_{i,s}, \quad\forall i=1,...n, s=2,...,m. \end{align} $$

Consequently, we can minimize the number of breaks by setting the objective function

$$ \min \quad \sum_{i=1}^{n} \sum_{s = 1}^{m} h_{i,s} + a_{i,s} . $$