TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: 0/1 Decision variables vs. bounded integers for selection problem

3 pointsby steve_gover 3 years ago
I&#x27;m asking here because I know there are some smart optimization experts on HN. I tried Reddit, but no joy.<p>In my production planning problem, I want to select around 1000 items from a set of 15000 items to process in a given day. There are multiple constraints to satisfy and new items come in every day. It’s very much like a multi-dimensional knapsack problem with some extra constraints.<p>Each item has its own identifier and they are truly unique items. But they can be grouped for practical purposes so that (let’s say) 10 items could be represented by a single value and set of multi-dimensional costs.<p>I’d like to know whether it’s generally better for a MIP solver to represent selection of items by ten 0&#x2F;1 decision variables or one integer decision variable that must be &lt; 11 for ten items in a group. I know if I use the ten variables I’d also need to do something to break symmetry of solutions – like maybe add a term to minimize items IDs in the objective function.<p>I’d appreciate any thoughts or pointers to good resources on this. Thanks.

2 comments

elonmolluscover 3 years ago
I recall discussing this in an integer programming class many years ago, and being told that binary variables were the better option. This Stack Exchange post seems to confirm:<p><a href="https:&#x2F;&#x2F;or.stackexchange.com&#x2F;questions&#x2F;3209&#x2F;how-to-choose-between-high-number-of-binary-variables-or-fewer-number-of-integer" rel="nofollow">https:&#x2F;&#x2F;or.stackexchange.com&#x2F;questions&#x2F;3209&#x2F;how-to-choose-be...</a><p>The answer, which sounds reasonable to me, is that branching on a binary variable fixes its value, which effectively reduces the dimensionality of the model in subsequent evaluations. Branching on an integer variable restricts its range, but keeps it in the model. It may be easier to add cuts to the binary model.<p>I also have a copy of Wolsey&#x27;s <i>Integer Programming</i> that I flipped through, but couldn&#x27;t find anything clearly relevant to the question.<p>From a modeling perspective, if you care about the selection of individual items, then individual binary variables seem to be the natural choice. Trying to &quot;compress&quot; ten binary selection variables into an integer from 0 to 10 will be indirect and you&#x27;ll probably have to add a bunch of extra constraints to encode that a variable assignment like x_c = 2 corresponds to selecting item #2 from category c.<p>(I have done some OR in the past but I&#x27;m not an expert on MIPs, so I defer to anyone with better knowledge.)
nanisover 3 years ago
One thing that is missing from your problem statement is the objective function. What are you trying to maximize?
评论 #28877538 未加载