Skip to main content
changed notation to avoid collision with linked formulation
Source Link
RobPratt
  • 34.3k
  • 2
  • 47
  • 90

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each black squarebanned cell. Let nonnegative decision variable $x_{i,j}$$z_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red routeloop. Let $B$ be the number of blackbanned cells. To prevent trapped blacktrapping banned cells, you need flow balance constraints along with big-M constraint $$x_{i,j} \le B(1 - y_j) \quad \text{for all $(i,j)$},$$$$z_{i,j} \le B(1 - y_j) \quad \text{for all $(i,j)$},$$ which enforces $x_{i,j} > 0 \implies y_j = 0$$z_{i,j} > 0 \implies y_j = 0$.

For your example instance, the optimal objective valuemaximum score turns out to be $33$.: enter image description here

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each black square. Let nonnegative decision variable $x_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red route. Let $B$ be the number of black cells. To prevent trapped black cells, you need flow balance constraints along with big-M constraint $$x_{i,j} \le B(1 - y_j) \quad \text{for all $(i,j)$},$$ which enforces $x_{i,j} > 0 \implies y_j = 0$.

For your example instance, the optimal objective value turns out to be $33$.

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each banned cell. Let nonnegative decision variable $z_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the loop. Let $B$ be the number of banned cells. To prevent trapping banned cells, you need flow balance constraints along with big-M constraint $$z_{i,j} \le B(1 - y_j) \quad \text{for all $(i,j)$},$$ which enforces $z_{i,j} > 0 \implies y_j = 0$.

For your example instance, the maximum score turns out to be $33$: enter image description here

deleted 49 characters in body
Source Link
RobPratt
  • 34.3k
  • 2
  • 47
  • 90

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each black square. Let nonnegative decision variable $x_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red route. Let $B$ be the number of black cells. To prevent trapped black cells, you need flow balance constraints along with the following:big-M constraint \begin{align} x_{i,j} &\le B(1 - y_i) && \text{for all $(i,j)$} \tag1 \\ x_{i,j} &\le B(1 - y_j) && \text{for all $(i,j)$} \tag2 \end{align}$$x_{i,j} \le B(1 - y_j) \quad \text{for all $(i,j)$},$$ Constraints $(1)$ andwhich enforces $(2)$ enforce$x_{i,j} > 0 \implies y_j = 0$.

For your example instance, the optimal objective value turns out to be $(y_i \lor y_j) \implies x_{i,j} = 0$$33$.

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each black square. Let nonnegative decision variable $x_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red route. Let $B$ be the number of black cells. To prevent trapped black cells, you need flow balance constraints along with the following: \begin{align} x_{i,j} &\le B(1 - y_i) && \text{for all $(i,j)$} \tag1 \\ x_{i,j} &\le B(1 - y_j) && \text{for all $(i,j)$} \tag2 \end{align} Constraints $(1)$ and $(2)$ enforce $(y_i \lor y_j) \implies x_{i,j} = 0$.

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each black square. Let nonnegative decision variable $x_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red route. Let $B$ be the number of black cells. To prevent trapped black cells, you need flow balance constraints along with big-M constraint $$x_{i,j} \le B(1 - y_j) \quad \text{for all $(i,j)$},$$ which enforces $x_{i,j} > 0 \implies y_j = 0$.

For your example instance, the optimal objective value turns out to be $33$.

added 73 characters in body
Source Link
RobPratt
  • 34.3k
  • 2
  • 47
  • 90

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each black square. Let nonnegative decision variable $x_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red route. Let $B$ be the number of black cells. To prevent trapped black cells, you need flow balance constraints along with the following: \begin{align} x_{i,j} &\le B(1 - y_i) && \text{for all $(i,j)$} \tag1 \\ x_{i,j} &\le B(1 - y_j) && \text{for all $(i,j)$} \tag2 \end{align} Constraints $(1)$ and $(2)$ enforce $(y_i \lor y_j) \implies x_{i,j} = 0$.

Introduce a dummy depot and send one unit of flow from the depot to each black square. Let nonnegative decision variable $x_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red route. Let $B$ be the number of black cells. To prevent trapped black cells, you need flow balance constraints along with the following: \begin{align} x_{i,j} &\le B(1 - y_i) && \text{for all $(i,j)$} \tag1 \\ x_{i,j} &\le B(1 - y_j) && \text{for all $(i,j)$} \tag2 \end{align} Constraints $(1)$ and $(2)$ enforce $(y_i \lor y_j) \implies x_{i,j} = 0$.

Introduce a dummy depot (adjacent only to the "border" cells in the first or last row or column) and send one unit of flow from the depot to each black square. Let nonnegative decision variable $x_{i,j}$ represent the flow along the directed arc from node $i$ to node $j$, and let binary decision variable $y_k$ indicate whether node $k$ is part of the red route. Let $B$ be the number of black cells. To prevent trapped black cells, you need flow balance constraints along with the following: \begin{align} x_{i,j} &\le B(1 - y_i) && \text{for all $(i,j)$} \tag1 \\ x_{i,j} &\le B(1 - y_j) && \text{for all $(i,j)$} \tag2 \end{align} Constraints $(1)$ and $(2)$ enforce $(y_i \lor y_j) \implies x_{i,j} = 0$.

added 45 characters in body
Source Link
RobPratt
  • 34.3k
  • 2
  • 47
  • 90
Loading
Source Link
RobPratt
  • 34.3k
  • 2
  • 47
  • 90
Loading