First of all, thanks a lot for the replies!
The distances are 1 to every path that's next to each other, 2 for
combinations of (p1,p2) where there's one path in between, etc.
About the constraints: I have two constraints. One that says that
sum(t,Place(p2,t))=1 for all p2 so that exactly one pallet type gets a
pile in every path. In the 'exactly identified' case (x paths, x
pallet types) I also had the condition that sum(p2,Place(p2,t))=1 so
that every pallet type gets exactly one pile. When I have less than x
pallet types the condition would of course be sum(p2,Place(p2,t))>=1.
In short, every p2 has exactly one t and every t has at least one p2.
Guido said:
"Add constraint:
sum(p1, combination_is_min_selected(p1,p2,t)) <= card(p1) * place(p2,
t)
forall (p2,t)
These constraints will ensure that
combination_is_min_selected(p1,p2,t)
will be 0 for all p1 in case place(p2,t) is 0. I use card(p1) to allow
for
multiple p1 to have combination_is_min_selected(p1,p2,t) with value 1.
"
I think the card(p1) thing should be removed to agree with exactly one
pallet per path (my first restriction).
"I think you have to make the constraint for all (p1,t)
and use
sum( p2, combination_is_min_selected(p1,p2,t) ) = 1, stating that for
each
combination of (p1,t), there must be exactly one closest p2 that you
will
select."
Sounds like this is also the right restriction for the problem,
because there will probably be a pallet of type t in every path p1, so
for all those combinations the needs to be a minimal destination path
p2.
The objective function sounds logical..
I entered all this and now I am getting the error the after some
iterations CPLEX could not find an integer solution to my mathematical
program...
Kind regards,
John Brouwer.
On 28 mrt, 19:52, Luis Pinto <
luisf...@gmail.com> wrote:
> Since we don't know the model as a whole, I just imagined that the other
> constraints would imply in some kind of condition that you actually need to
> have the Place(p2,t) = 1 for some of the combinations, but you are quite
> right.
>
> Cheers,
>
> Luis Pinto
>
> On 28 March 2012 19:38, Guido Diepen <
Guido.Die...@aimms.com> wrote:
>
>
>
> > Thanks Luis,
>
> > I am not sure if it still works if you use the <= 1 instead of = 1.
> > Because the combination_is_min_selected has a positive component in the
> > objective, there would be no incentive to make any of them get the value 1.
> > You must ensure that at least one gets the value 1.
>
> > From what I understood, you could have a place t where you are not
> > collecting the pallets, but you could not have a place where you are
> > collecting two types of pallets. My assumption is that you have to collect
> > all of the pallets somewhere.
>
> > Now that I am thinking about it, this constraint might actually be wrong
> > the way I stated it: I think you have to make the constraint for all (p1,t)
> > and use
> > sum( p2, combination_is_min_selected(p1,p2,t) ) = 1, stating that for each
> > combination of (p1,t), there must be exactly one closest p2 that you will
> > select.
>
> > Guido Diepen
> > AIMMS Specialist
>
> > On Wednesday, March 28, 2012 5:26:22 PM UTC+2, Luis Pinto - UniSoma wrote:
>
> >> Nicely put Guido.
> >> I would only suggest you use
>
> >> sum( (p1,p2) , combination_is_min_selected(**p1,p2,t)) <= 1 forall (t)
>
> >> since, from what I gathered you could actually have a t with no Place
> >> selected, right?
>
> >> Cheers,
>
> >> Luis Pinto
>
> >>
www.unisoma.com.br
>
> >> On 28 March 2012 17:08, Guido Diepen <> wrote:
>
> >>> Hi John,
>
> >>> not 100% sure yet, as I have not completely verified everything and
> >>> almost sure about what you want to achieve :), but maybe the additions
> >>> below will achieve what you need.
>
> >>> Add binaray variable:
> >>> combination_is_min_selected(**p1, p2, t)
> >>> Value 1 denotes place(p2,t) = 1 AND (p1, p2) is the minimum distance
> >>> Value 0 denotes otherwise
>
> >>> Add constraint:
> >>> sum(p1, combination_is_min_selected(**p1,p2,t)) <= card(p1) * place(p2,
> >>> t) forall (p2,t)
>
> >>> These constraints will ensure that combination_is_min_selected(**p1,p2,t)
> >>> will be 0 for all p1 in case place(p2,t) is 0. I use card(p1) to allow for
> >>> multiple p1 to have combination_is_min_selected(**p1,p2,t) with value 1.
>
> >>> Add constraint:
> >>> sum( (p1,p2) , combination_is_min_selected(**p1,p2,t)) = 1 forall (t)
>
> >>> These constraints will ensure that for each t, there must be a (p1,p2)
> >>> such that combination_is_min_selected(**p1,p2,t) has the value 1.
> >>> Without this constraint, the solver could choose the value 0 for all
> >>> combination_is_min_selected(**p1,p2,t)
>
> >>> Now in objective, use this new variable:
>
> >>> minimize
> >>> sum( (p1,p2,t) , Quantity(p1,t)
> >>> * Distance(p1,p2)
> >>> * combination_is_min_selected(**p1,p2,t)
> >>> )
>
> >>> Because you are multiplying the combination_is_min_selected with the
> >>> distance, the solver will be directed to choose the (p1,p2) combination
> >>> that has minimal distance.
>
> >>> Hope this is indeed the solution to your problem, as mentioned I did not
> >>> have time to thoroughly verify it.
>
> >>> Guido Diepen
> >>> AIMMS Specialist
>
> >>> On Wednesday, March 28, 2012 12:07:39 PM UTC+2, Luis Pinto - UniSoma
> >>> wrote:
>
> >>>> Hello,
>
> >>>> Let me just see if I fully understand.
> >>>> You objective function is then actually:
>
> >>>> minimize:
> >>>> sum((p1,t),Quantities(p1,t)* Min(p2 | Place(p2,t) =
> >>>> 1,Distance(p1,p2)*Place(p2,t))****)
> >>>> On 27 March 2012 19:59, John Brouwer <
johnbrouwer...@gmail.com> wrote:
>
> >>>>> Hello Luis,
>
> >>>>> Thanks for the reply.
>
> >>>>> In my case Place(p2,t) will be 1 for multiple indices. That is why in
> >>>>> the objective function I want for a given (p1,t) the short
> >>>>> Distance(p1,p2) of the indices p2 where Place(p2,t) = 1.
>
> >>>>> You said that I should combine more than one variable to get what I am
> >>>>> looking for, but I do not really know how to do this (beginner).
>
> >>>>> Maybe I should make more clear what I want by explaining what I am
> >>>>> modelling:
> >>>>> In a distribution center we have ten paths and multiple types of
> >>>>> pallets. When an empty pallet gets replaced by a full one the empty
> >>>>> pallet should be put on a pile with only that type of pallet. What I
> >>>>> want to know is which type should get a pile in which path. For that I
> >>>>> minimize:
> >>>>> sum((p1,p2,t),Quantities(p1,t)*****Distance(p1,p2)*Place(p2,t))
> >>>>> > > min(p2,Distance(p1,p2)*Place(**p**2,t)>0)
>
> >>>>> > > If not, I would like to make another variable called
> >>>>> Activeplace(p2,t)
> >>>>> > > that is 1 when Place(p2,t) = 1 and inf when Place(p2,t) = 0 so I
> >>>>> can take
> >>>>> > > the minimum very straightforward. How should I enter this in the
> >>>>> definition
> >>>>> > > of the variable? I have been trying to find the correct syntax for
> >>>>> this but
> >>>>> > > I cannot find it.
>
> >>>>> > > Thanks in advance.
>
> >>>>> > > Kind regards,
> >>>>> > > John Brouwer.
>
> >>>>> > > --
> >>>>> > > You received this message because you are subscribed to the Google
> >>>>> Groups
> >>>>> > > "AIMMS - The Modeling System" group.
> >>>>> > > To view this discussion on the web visit
> >>>>> > >
https://groups.google.com/d/**m**sg/aimms/-/ApOOiVc6sw0J<
https://groups.google.com/d/msg/aimms/-/ApOOiVc6sw0J>
> >>>>> .
> >>>>> > > To post to this group, send email to
ai...@googlegroups.com.
> >>>>> > > To unsubscribe from this group, send email to
> >>>>> > > aimms+unsubscribe@**googlegroups**.com<
aimms%2Bunsu...@googlegroups.com>
> >>>>> .
> >>>>> > > For more options, visit this group at
> >>>>> > >
http://groups.google.com/**grou**p/aimms?hl=en<
http://groups.google.com/group/aimms?hl=en>
> >>>>> .
>
> >>>>> --
> >>>>> You received this message because you are subscribed to the Google
> >>>>> Groups "AIMMS - The Modeling System" group.
> >>>>> To post to this group, send email to
ai...@googlegroups.com.
> >>>>> To unsubscribe from this group, send email to aimms+unsubscribe@**
> >>>>> googlegroups**.com <
aimms%2Bunsu...@googlegroups.com>.
> >>>>> For more options, visit this group athttp://
groups.google.com/**group
> >>>>> **/aimms?hl=en <
http://groups.google.com/group/aimms?hl=en>.
>
> >>> On Wednesday, March 28, 2012 12:07:39 PM UTC+2, Luis Pinto - UniSoma
> >>> wrote:
>
> >>>> Hello,
>
> >>>> Let me just see if I fully understand.
> >>>> You objective function is then actually:
>
> >>>> minimize:
> >>>> sum((p1,t),Quantities(p1,t)* Min(p2 | Place(p2,t) =...
>
> meer lezen »