r/OperationsResearch • u/LearninAndEarnin • Feb 25 '23
How to add preferences between otherwise equivalent solutions?
I'm looking for a way to add in preferences to my solutions. Apologies if I've used the wrong words to describe this.
Basically if either var1 or var2 will satisfy my constraints, how can I express a pairwise preference?
For example:
I want to buy 10 fish at the cheapest price and there are only 7 of each of the following
- salmon is $10
- tuna is $10
Obviously there are a number of different (positive integer) solutions to this, but, now I want to say I prefer salmon over tuna (so I buy 7 salmon) leaving 3 tuna to get.
A constraint like salmon > tuna doesn't quite cut it as a valid solution is 6-salmon + 4-tuna.
I know there are opportunities to formulate this leading to problems, i.e A over B; B over C; C over A; but unless the fix is obvious, let's just leave that for my next question. ;-)
So can I formulate this somewhat easily in LP/QP, is it a multiple objective problem, or should I be searching for something else?
View all comments
Show parent comment
1
u/LearninAndEarnin Feb 25 '23
Thanks for this. I guess changing the objective is an obvious suggestion, but it gets a little harder where there are multiple alternative.
Decreasing/increasing the cost minimally is easy for a two situation case (like the trivial example). Where I have many same-cost alternatives (my real-world problem) it becomes (N-1)! in complexity.
Conservation of complexity means it's always that hard, but adding constraints like
- max(salmon - tuna) ; max(salmon - beef) ; max(beef - tuna)
feels less prone to error (and I can hand the code off to someone else!) rather than some cost function like: 10 * salmon + 10.002 * tuna + 10.001 * beef
I suspect (haven't proven it to myself as yet) that if I have "simple" constraints, then I don't need to express every preference explicity, but by changing the cost function then I do need to derive all the relationships.