# A variant of the "consecutive" variables question

 2 This question is similar to the following: https://www.or-exchange.org/questions/9203/forcing-the-value-of-consecutive-variables with the following twist: I'd like for the non-zero values to be fixed at a level, but that level is a continuous variable, between defined (known) bounds. [ We have some flexibility in the number of resources we deploy out to tackle a certain job]. I'd like for the model to stay linear as much as possible, though i haven't been able to figure out how to hack the accepted answer (to the question i've linked to above) to fit my scenario. My fallback is to try a constrained "minimum variance" set of constraints, but that has multiple drawbacks: run-time for a quadratic model might be much larger the resulting profile of values is not guaranteed to be "consecutively" non-zero the resulting profile of values may not be as "brick wall" as i'd like. This complication arose in a resource scheduling scenario: the jobs (demand side) are defined in two different ways: Type 1: Job requires x hours of supply (ideally the supply profile allocated to the job should look "rectangular" or like a brick wall) spread out over a (variable) number of weeks. Type 2: Job demand in hours by week is fixed (this is the easier of the two). There is a weekly supply side constraint, which is simple. asked 04 Dec '14, 15:18 jumblees 91●1●6 accept rate: 0%

 2 A simple way is to add a binary variable xt for each of the original variables yt you have. xt = 0 iff yt = 0, and xt = 1 iff yt = z where z is the continuous variable. There are bounds on z, say l <= z <= u I would therefore state the constraints: xt = 1 implies yt = z : l . (1 - xt) <= z - yt <= u . (1 - xt) xt = 0 implies yt = 0: yt <= u . xt Then I would state the consecutive constraint on the x_t variables answered 08 Dec '14, 10:52 jfpuget 2.5k●3●10 accept rate: 8%
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:
{"ft_lang_label":"__label__en","ft_lang_prob":0.9500239,"math_prob":0.92831004,"size":1340,"snap":"2020-34-2020-40","text_gpt3_token_len":340,"char_repetition_ratio":0.10628743,"word_repetition_ratio":0.0,"special_character_ratio":0.27313432,"punctuation_ratio":0.11272727,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9806606,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-14T16:56:27Z\",\"WARC-Record-ID\":\"<urn:uuid:8c00d788-d7a0-4d39-828b-92f41b96297d>\",\"Content-Length\":\"32280\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7f0d157c-86fe-4e52-b8f3-df1be6fd8561>\",\"WARC-Concurrent-To\":\"<urn:uuid:2787b809-0d06-418a-a44d-dc91235f69bb>\",\"WARC-IP-Address\":\"34.227.255.207\",\"WARC-Target-URI\":\"https://www.or-exchange.org/questions/10795/a-variant-of-the-consecutive-variables-question\",\"WARC-Payload-Digest\":\"sha1:UIXT7FH2M5VIDBPX3D3WBSYCALRKQ6JK\",\"WARC-Block-Digest\":\"sha1:2HMGEUFR7NXSTDXQWXFVQ74DVNEQ55HN\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439739347.81_warc_CC-MAIN-20200814160701-20200814190701-00389.warc.gz\"}"}