-------- Forwarded Message -------- From: Javier Diego <[email protected]> Reply-to: Javier Diego <[email protected]> To: [email protected] <[email protected]> Subject: Fleet assigment Date: Thu, 28 Jul 2016 08:53:08 +0000 (UTC)
Hello I am an old GLPK’s user, and I have a question about modelling, but not a question about GLPK itself. Sorry if this is not the forum for that. In a fleet assignment problem, I have two legs L1 and L2, and there are three vehicles (V1, V2 and V3) that can be assigned to L1 and L2. L1’s distance is d1 and L2’s distance is d2. If L1 and L2 are allocate to the same vehicle, I have to add 80 miles because an empty leg must be done. I have the following variables: L1_V1 is 1 if L1 is assigned to V1 L1_V2 is 1 if L1 is assigned to V2 L2_V1 is 1 if L2 is assigned to V1 L2_V2 is 1 if L2 is assigned to V2 X12 if L1 and L2 are assigned to the same vehicle I already have posted the following constraints L1 is assigned once: L1_V1 + L1_V2 <= 1 L2 is assigned once: L2_V1 + L2_V2 <= 1 If X12 is activated, then L1 and L2 are allocated to a vehicle: X12 <= L1_V1 + L1_V2 and X12 <= L2_V1 + L2_V2. Now I need to post a constraint about the distance travelled by every vehicle, without declarating new variables. I would be easy weather I created the variables X12_V1 (V1 allocates L1 and L2) and X12_V2 (V2 allocates L1 and L2). With these variables, the distances travelled by every vehicle are: Distance_V1 = d1 · L1-V1 + d2 · L2_V1 + 80 · X12_V1 Distance_V2 = d1 · L1-V2 + d2 · L2_V2 + 80 · X12_V2 Does anybody know how to model the distance for every individual vehicle without creating X12_V1 and X12_V2, and only with X12? Thanks a lot _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
