Hi Daniel,
The arcs of each order are defined as followed.
orders_arcs=[
{<"Yinchuan","Lanzhou">,<"Lanzhou","AlatawShankou">,<"AlatawShankou","Hamburg">,
<"Yinchuan","Tianjin">,<"Tianjin","Pireas">,<"Pireas","Hamburg">},
{<"Shanghai","Manzhouli">,<"Manzhouli","Hamburg">,
<"Shanghai","Pireas">,<"Pireas","Hamburg">},
{<"Zhengzhou","Erenhot">,<"Erenhot","Hamburg">,
<"Zhengzhou","Lianyungang">,<"Lianyungang","Pireas">,<"Pireas","Hamburg">}];
Services includes:
services = {
< 1,<"Yinchuan","Lanzhou">, 0, 316, 3, 346,45,1>,
< 2,<"Yinchuan","Lanzhou">, 0, 212, 2, 370, 1000, 1>,
< 3,<"Lanzhou","AlatawShankou">,5,1380,3,2057,45,2>,
< 4,<"AlatawShankou","Hamburg">,10,3220,8,5107,45,2>,
< 5,<"Yinchuan","Tianjin">,0,761,6,1074,45,1>,
< 6,<"Tianjin","Pireas">,7,924,26,15790,20000,7>,
< 7,<"Shanghai","Manzhouli">,0,1843,4,2881,45,3>,
< 8,<"Manzhouli","Hamburg">,5,5957,10,6873,45,3>,
< 9,<"Shanghai","Pireas">,1,721,20,14390,20000,7>,
< 10,<"Shanghai","Pireas">,8,721,20,14390,20000,7>,
< 11,<"Zhengzhou","Erenhot">,0,828,5,1364,45,3>,
< 12,<"Erenhot","Hamburg">,6,5622,10,7553,45,3>,
< 13,<"Zhengzhou","Lianyungang">,0,481,2,525,1000,1>,
< 14,<"Zhengzhou","Lianyungang">,0,367,5,525,45,1>,
< 15,<"Lianyungang","Pireas">,6,952,22,603,20000,7>,
< 16,<"Pireas","Hamburg">,30,230,6,5850,20000,7>,
< 17,<"Pireas","Hamburg">,36,300,2,2025,45,1> };
Result of order 3 consists of:
x-kst is:
via arc <"Lanzhou" "AlatawShankou"> time is 34
via arc <"Zhengzhou" "Lianyungang"> time is 5
via arc <"Lianyungang" "Pireas"> time is 28
via arc <"Pireas" "Hamburg"> time is 38
Where arc <"Lanzhou" "AlatawShankou"> can only be selected by order 2, since it only appears in order_arcs[2]. Do you know how to solve it?
------------------------------
Dario Pisinger
------------------------------
Original Message:
Sent: Tue June 23, 2020 12:53 AM
From: Daniel Junglas
Subject: Flow Balance
What exactly do you mean by "selected"? Do you mean that the arcs appear in the constraint even though <i,j> is not in order_arcs[k]? Or do you mean that in the solution some arcs have non-zero values although they should not?
The former would sound like a bug, could you provide a short example that reproduces the issue?
The latter seems easy to fix: add an explicit constraints that sets arcs to 0 for all arcs that are not in order_arcs[k].
------------------------------
Daniel Junglas
Original Message:
Sent: Mon June 22, 2020 01:44 PM
From: Dario Pisinger
Subject: Flow Balance
Hi all,
I am writing a flow balance constraints for a multicommodity flow problem. devision variable is x-kst, representing flow or order k arrive at the destination of service s at time t by service s.
forall(k in orders, j in orders_nodes[k])
sum (<n,<i,j>,dt,c,tt,dist,cap,f> in services:<i,j> in orders_arcs[k],t in time) x[k][<n,<i,j>,dt,c,tt,dist,cap,f>][t]
- sum (<n,<j,i>,dt,c,tt,dist,cap,f> in services:<j,i> in orders_arcs[k],t in time) x[k][<n,<j,i>,dt,c,tt,dist,cap,f>][t] == k.SupDem[j];
However, some arcs which are not belonging to order k (not in the set of orders_arcs[k]) , are also selected. I mean that flow should not pass by those arcs not in its possible arcs. How to deal with it?
------------------------------
Dario Pisinger
------------------------------
#DecisionOptimization