|
From: | Meketon, Marc |
Subject: | Re: [Help-glpk] multi-objectives function |
Date: | Tue, 9 Oct 2012 05:49:29 -0500 |
The A=1, B=1 solution is the solution that finds the most equalized set of variables. If that is what you want, then one way is to minimize the absolute value
of the deviations around the average of the variables. For example, instead of A, B (and to slightly generalize this), suppose you have a set N and variables var x{N} >= 0; Also suppose that you want to find the solution that has as many of the x’s the same as possible. Use three more sets of variables: var r_plus{N} >=0; var r_neg{N} >=0; var x_mean; Add in the following constraints: s.t. Calculate_Average_x: x_mean = (sum{j in N} x[j])/card(N); s.t. EqualizeValues{j in N}: r_plus[j] – r_neg[j] = x[j] – x_mean; Then in your objective function, add in a term that penalizes the absolute deviation of the x’s around their average: minimize some_objective: [your other terms in the objective function] + 99*sum{j in N} (r_plus[j] + r_neg[j]); The “99” is a penalty – you would need to modify this penalty to see whether the solutions you are achieving are the ones that you desire. -Marc From: help-glpk-bounces+address@hidden [mailto:help-glpk-bounces+address@hidden
On Behalf Of esma mehiaoui
This e-mail and any attachments may be confidential or legally privileged. If you received this message in error or are not the intended recipient, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained herein. Please inform us of the erroneous delivery by return e-mail. Thank you for your cooperation. |
[Prev in Thread] | Current Thread | [Next in Thread] |