Let \( m_p \in \{0,1,2,\ldots,s_{max} \} \text{ for } p \in M = \{1,2,\ldots,n_{max} \} \). Let \( F \subset M \).

I want to define the following constraints:

\[ \begin{align} m_p &= 2, \text{ for at least one } p \in F, \\ m_p &= 1, \text{ for at least one } p \in F, \\ m_p &\ge 0, \text{ for all other } p \in M. \\ \end{align} \]

Most of the literature I have searched through define logical operations for binary \( m_p \). My limited attempt was as follows:

\[ \sum_{p=1}^{n_{max}} m_p \ge 3. \]

But now I get stuck at the configuration where three \( m_p \) equals one. Please guide how to proceed with this.

asked 28 Aug '15, 13:05

UbaAbd's gravatar image

UbaAbd
15116
accept rate: 0%

edited 29 Aug '15, 04:24

The wording of your constraints is a bit unclear. Do you mean exactly one of the \(m_p\) takes the value 2 and exactly one takes the value 1, or do you mean at least one of each?

(28 Aug '15, 16:15) Paul Rubin ♦♦

@paul you're right. I have updated my question. It is "at least one".

(29 Aug '15, 04:24) UbaAbd

For \(p \in F\) and \(k \in \{1,2\}\), introduce binary variables \(x_{p,k}\) to indicate \(m_p=k\). Then the following constraints enforce that \(x_{p,k} = 1 \Rightarrow m_p=k\): \[k x_{p,k} \le m_p \le s_{\max} - (s_{\max} - k) x_{p,k}.\] Now \(\sum_{p \in F} x_{p,k} \ge 1\) for \(k \in \{1,2\}\) finishes the job.

link

answered 31 Aug '15, 10:10

Rob%20Pratt's gravatar image

Rob Pratt
1.2k26
accept rate: 28%

edited 31 Aug '15, 16:58

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×190
×101
×79
×56

Asked: 28 Aug '15, 13:05

Seen: 12,366 times

Last updated: 31 Aug '15, 16:58

OR-Exchange! Your site for questions, answers, and announcements about operations research.