Say, my friend and I are looking for an apartment based on the travel time to our workplace. The time I spend is x minutes and my friend spend is y minutes. Is there any equation that can help me to determine the best apartment? I don't like x+y as a score, because, for example, he will not be happy if he spends 30 minutes and I spend 0 minutes, even though the total time might be the smallest.
Asked
Active
Viewed 32 times
1
-
You can add a cost factor associated to the difference between the two times, like $\lambda (x-y)^2$ or something like that. You can then adjust the scale factor $\lambda$ until the function suits your intuition. – lulu Nov 21 '22 at 00:32
-
1Should stress: nobody can give you the "best" function here since it depends on how you want to weight the two sorts of cost ("total distance" and "variance"). I suggest, try a parametric family like I proposed and play with it until you get one that roughly feels right. – lulu Nov 21 '22 at 00:37
-
Similar to other comments, you can try to minimize $$(x^2 - y^2) = (x-y)(x+y).$$ As a rule of thumb, minimizing each of the two RHS factors above tends to minimize the LHS factor above (not a foolproof strategy). – user2661923 Nov 21 '22 at 01:56
2 Answers
1
$$\text{Min}\left(x+y+\left(\frac{x+y}{5}\right)\left(\frac xy+\frac yx\right)\right)$$
This might be close to what you want.
But note that while it generally works well but in case where $(x_1,y_1)=(9,31)$ and $(x_2,y_2)=(15,31)$ you'll see we'll be preferring the latter, but... isn't that what we want?
Also, it's not necessary to divide by $5$, it could be $2,3,4\dots$ (subjective on whether you prefer closeness over total distance, if yes, then you'd keep an even smaller number).
InanimateBeing
- 3,074
0
You could use $x^2+y^2$ to emphasize the longer travel. As you increase the exponent the penalty to a long travel increases. When it is very high all you will care about is the longer one.
Ross Millikan
- 374,822