2
1

Hi, I am trying to model a problem: if 4.5<=s<=7.3 (s is a continuous variable) then x4=x5=x6=x7=1 else x1=x2=x3=x8=x9=x10=0. xi (1=1...10) are binary variables regarding periods 1 to 10. in fact, I want to make all x variables within time periods int(4.5) and int(7.3) get 1 others zero. (int is floor function eg int(5.1)=5, int(9.8)=9, int(3)=3)

Thanks

asked 17 Feb '13, 16:15

hesameivazy's gravatar image

hesameivazy
712
accept rate: 0%

I am wondering how would be the most efficient (least # of binary variables) while bounds of s (L, U) are known, 7.3 and 4.5 are not known (they are two continuous variables). I mean if a<=s<=b then x(i)=1 every i<=ceiling (b) and floor (a)<=i else x(i)=0 a and b are two continuous variables thanks

(19 Feb '13, 11:46) hesameivazy

I believe my answer does the job for you.

(19 Feb '13, 11:58) Marco Luebbecke ♦

Assume that \(L\) and \(U\) are known lower/upper bounds for \(s\) (so that \(L\le s \le U\)). Define three new binary variables \(y_1, y_2, y_3\) and add the constraints \( Ly_{1}+4.5y_{2}+7.3y_{3} \le s\le 4.5y_{1}+7.3y_{2}+Uy_{3}\) and \(y_{1}+y_{2}+y_{3} = 1\). Now constrain \(x_i\ge y_2\) for \(i=4,\dots,7\) and \(x_i\le 1-y_2\) for \(i\in\{1,2,3,8,9,10\}\).

link

answered 17 Feb '13, 17:53

Paul%20Rubin's gravatar image

Paul Rubin ♦
10.5k412
accept rate: 17%

edited 17 Feb '13, 17:55

1

Seems like Paul's last constraint should be $$x_i \le y_2$$ instead of $$x_i \le 1 - y_2$$.

(18 Feb '13, 18:11) Rob Pratt

@Rob: Don't think so. \(y_2 = 1\) if \(4.5\le s \le 7.3\), in which case you want \(x_i = 0\) for \(i\in \{1,2,3,8,9,10\}\). Your change would let those \(x_i\) equal 1.

(18 Feb '13, 18:15) Paul Rubin ♦

OK, then the OP's "else" should instead be "and"

(18 Feb '13, 18:18) Rob Pratt
1

Good point. Maybe I misread the question. If he does mean else (and means \(x_4,\dots,x_7\) are unrestricted for \(s\notin [4.5,7.3]\) and the other \(x_i\) are unrestricted for \(x\in [4.5,7.3]\), then you're right: the last constraint should be \(x_i\le y_2\).

(18 Feb '13, 18:37) Paul Rubin ♦

@hesameivazy, were you looking for something more general? With @paul's \(L\) and \(U\), you may need \(x_{i}\leq s/i\), \(x_{i}\leq (U-s)/(U-i)\), \(x_{i}\geq i/s\)

link

answered 18 Feb '13, 15:55

Marco%20Luebbecke's gravatar image

Marco Luebbecke ♦
2.5k314
accept rate: 16%

Yes I am looking for a more general formulation.

(19 Feb '13, 11:40) hesameivazy
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:

×96
×86
×40

Asked: 17 Feb '13, 16:15

Seen: 822 times

Last updated: 19 Feb '13, 12:23

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