set covering problem!!!

1,118 views
Skip to first unread message

Andy Lin

unread,
Apr 13, 2012, 5:46:13 AM4/13/12
to ai...@googlegroups.com

Hello

 

I have a problem with set covering.

The problem is :

There’re two subset of ATC, Assignment and NotAssignment. I can’t enter the Decision variables in the set definition. I don’t know where should I write it in.

 

Set Assignment should enter:  x<170, y1=1, z<100

Set NotAssignment should enter:  x>170, y1=0, z>100

 

Thanks!!!

Andy

Guido Diepen

unread,
Apr 18, 2012, 3:33:41 AM4/18/12
to ai...@googlegroups.com
Hi Andy,

Unfortunately, it is not clear to me what you would like to achieve, could you maybe explain in a bit more detail what you want to do?

Guido Diepen
AIMMS Specialist

Andy Lin

unread,
Apr 19, 2012, 1:50:27 AM4/19/12
to ai...@googlegroups.com
Hi Guido, 

sorry to waste your time,
I want to define two set Assignment  and  NotAssignment, both are subset of ATC.
But I don't Know  where  to  tap the restrictions in to model.
I try do  this in definition ,but it occur error!

restrictions::

Set Assignment should enter:  x<170, y1=1, z<100

Set NotAssignment should enter:  x>170, y1=0, z>100

Thanks a lot

Andy


Guido Diepen於 2012年4月18日星期三UTC+8下午3時33分41秒寫道:
ATC0419.rar

Guido Diepen

unread,
Apr 19, 2012, 10:27:55 AM4/19/12
to ai...@googlegroups.com
Hi Andy,

unfortunately, based on this project it still not clear to me what you want to do :)

Which elements do you want to punt in the set Assignment and the set NotAssignment.

In the definition, you fill in something like:
x<=170,y1=0,z<100

This indeed will result in compile errors as AIMMS will not understand this.

Do you mean you want to put those elements k from the rootset ATC in there that are selected? In that case, what exactly does your expression x <= 170 mean? Do you want to have those k such that there exists a (d,i,t) such that x(k,d,i,t) is <= 170? Or must x(k,d,i,t) be <= 170 for ALL possible (d,i,t) for a given k?

Guido Diepen
AIMMS Specialist

However, all of these variables are indexed over the 4 indices (k,d,i,t)

林定翰

unread,
Apr 23, 2012, 8:11:20 AM4/23/12
to ai...@googlegroups.com
Hi Guido,

I should separate K into Assignment and NotAssignment set.

the number of k  in  Assignment + the number of k  in NotAssignment =the number of k  in ATC

under these condition (x<=170,y1=0,z<100), k belong Assignment             
                                      (x>=170,y1=1,z>100), k belong NotAssignment

it's x(k,d,i,t) be <= 170 for ALL possible (d,i,t) for a given k 

     y1(k,d,i,t)=0 for ALL possible (d,i,t) for a given k 

    z(k,d,i,t )<100 for ALL possible (d,i,t) for a given k 


Thanks,
Andy



 

Guido Diepen

unread,
Apr 24, 2012, 3:53:40 AM4/24/12
to ai...@googlegroups.com
Hi Andy,

Then you can determine it in terms like the following: 
The set Assignment should contain those elements k for which there does NOT exist a combination (d,i,t) such that x(k,d,i,t) > 170 or y1(k,d,i,t) = 1 or z(k,d,i,t) > 100

Because if there does not exist such a combination (d,i,t), it means that you fulfill all the requirements to allow this k to be in the set Assignment.

To put this in AIMMS, you make the set Assignment a subset of ATC and give it the definition:

{ k | not exists( (d,i,t) |   (x(k,d,i,t) > 170)  or  (y1(k,d,i,t) = 1) or (z(k,d,i,t) > 100) ) }

Finally, the NotAssignment can be defined in terms of the set ATC and this set Assignment as follows:

{ k | not ( k in Assignment ) }

Guido Diepen
AIMMS Specialist

林定翰

unread,
Apr 25, 2012, 9:03:26 AM4/25/12
to ai...@googlegroups.com
Hi Guido,

I have done the
{ k | not exists( (d,i,t) |   (x(k,d,i,t) > 170)  or  (y1(k,d,i,t) = 1) or (z(k,d,i,t) > 100) ) } in Assignment and 
 { k | not ( k in Assignment ) } in NotAssignment ,
 but It comes eorrors { The symbol "not" is not expected.} ?

I have another question:
My constrains should run in condition like 
(sub3-3)  { sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i)}         y1(k,d,i,t)=1,d in Day, i in Shift, t in Js ,k in Assignment.
it's means  when  y1(k,d,i,t)=1,d in Day, i in Shift, t in Js ,k in Assignment,  do the sub3-3
how can I define y1(k,d,i,t) in index domain?
 
Thanks a lot!!!
Andy









Guido Diepen

unread,
May 1, 2012, 3:04:24 AM5/1/12
to ai...@googlegroups.com
Hi,

at which exact position does it give this error? If you double-click on an error in AIMMS, the editor will jump to the specific point in your code that is causing the error. Is it in the first or in the second statement?

Guido Diepen
AIMMS Specialist

林定翰

unread,
May 1, 2012, 3:12:11 AM5/1/12
to ai...@googlegroups.com
Hi
 I think  both statement are error !  I had add  the file. 

2012/5/1 Guido Diepen <Guido....@aimms.com>

--
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/msg/aimms/-/ALMze1j011AJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

ATC 0430 Q.rar

Guido Diepen

unread,
May 1, 2012, 4:28:25 AM5/1/12
to ai...@googlegroups.com
Hi Andy,

In the definition of NotAssignment, you put the following definition:
(k | not ( k in Assignment(k,d,i,t) )

This should be:
{k | not ( k in Assignment ) }

There is a difference in AIMMS between ( and {

Also, what the above statement says is that you want to have those k in NotAssignment for which holds that the k is not in Assignment. Because the set Assignment is not an indexed subset, you must not put the (k,d,i,t) after it.

Another error I got was:
The first root set on the left (set "Assignment") does not match with the first root set on the right (set "ATC").

This is caused by the fact that the set Assignment is not a subset of ATC: You can only instruct AIMMS to put those k in for which the expression holds, if the set is a subset of the set for which k is an index.

Finally, there is an error with constraint sub3, which has the defintion:
if y1(k,d,i,t)=1 then sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i) endif

AIMMS will give you the error that k does not have a scope, because you are just using it without any index binding (e.g. via index domain or exists/sum/etc operator).

On a side note, I would like to point out that the above definition of the constraint is not a linear constraint: if you want to have only linear constraints, you cannot use any variables in if conditions. To work around this, please take a look the Optimization Modeling book in the Integer Linear Programming tricks chapter for an example on how to rewrite this back to linear constraints.

Guido Diepen
AIMMS Specialist


On Tuesday, May 1, 2012 9:12:11 AM UTC+2, Andy Lin wrote:
Hi
 I think  both statement are error !  I had add  the file. 

2012/5/1 Guido Diepen <>
Hi,

at which exact position does it give this error? If you double-click on an error in AIMMS, the editor will jump to the specific point in your code that is causing the error. Is it in the first or in the second statement?

Guido Diepen
AIMMS Specialist


On Wednesday, April 25, 2012 3:03:26 PM UTC+2, Andy Lin wrote:
Hi Guido,

I have done the
{ k | not exists( (d,i,t) |   (x(k,d,i,t) > 170)  or  (y1(k,d,i,t) = 1) or (z(k,d,i,t) > 100) ) } in Assignment and 
 { k | not ( k in Assignment ) } in NotAssignment ,
 but It comes eorrors { The symbol "not" is not expected.} ?

I have another question:
My constrains should run in condition like 
(sub3-3)  { sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i)}         y1(k,d,i,t)=1,d in Day, i in Shift, t in Js ,k in Assignment.
it's means  when  y1(k,d,i,t)=1,d in Day, i in Shift, t in Js ,k in Assignment,  do the sub3-3
how can I define y1(k,d,i,t) in index domain?
 
Thanks a lot!!!
Andy









--
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/msg/aimms/-/ALMze1j011AJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

林定翰

unread,
May 4, 2012, 1:22:39 AM5/4/12
to ai...@googlegroups.com
HI  Guido,

1.
I had rewrite( if y1(k,d,i,t)=1 then sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i) endif) into the book way 
                  (y1(k,d,i,t)=1 or sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i) ),but it error( The scope of index "k" has not been specified.)
Now I want to change a way to  use set seatset,it can let me not use If-then, just write k in seatset in   
index domain.
I write (y1(k,d,i,t)=1)in seatset definition, but why in date page just can write 0,1?
I want write in ex: 9 seat in i=4,d=1.

2.
I still don't know how to solve Assignment and Notassignment :(The scope of index "k" has not been specified.)

Thanks!!!
Andy

 
 
2012/5/1 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/gc1cxDRyiGAJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
複製 -ATC2 0504 Q.rar

Guido Diepen

unread,
May 4, 2012, 3:32:53 AM5/4/12
to ai...@googlegroups.com
Hi Andy,

about your question (2): The scope of index k has not been specified.
As mentioned in my previous email, there is a problem in both the attributes of the set Assignment and NotAssignment.

Your current attributes for the set Assignment are:
SET:
   identifier :  Assignment
   subset of  :  ATC
   index      :  assignmentset
   definition :  ( k | not exists( (d,i,t) |   (x(k,d,i,t) > 170)  or  (y1(k,d,i,t) = 1) or (z(k,d,i,t) > 100) ) )

The problem is in the definition, namely that you are using a construction like (k | not exists ...... ). However, you are defining the contents of a set in this definition, so you must use the { } around it instead of the (): So the definition should be:
{ k | not exists( (d,i,t) |   (x(k,d,i,t) > 170)  or  (y1(k,d,i,t) = 1) or (z(k,d,i,t) > 100) ) }

For the set NotAssignment, you have two problems, one in the defintion (where you also are not using the {}, but are using the ()  ). The second problem is, as mentioned in my previous email, that the set NotAssignment does not have the subset of attribute set to ATC (which you did do for the set Assignment).

For more information about sets, subsets, please take a look at the set declaration chapter in our language reference:http://www.aimms.com/aimms/download/manuals/aimms3lr_setdeclaration.pdf



Finally, the last error about the scope of index k not being specified comes from your definition of the constraint sub3:
 y1(k,d,i,t)=1 or sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i)

In this constraint, you are using the variable y1, which is defined over the four indices (k,d,i,t). In the index domain of the constraint, you are binding the three indices (d,i,t) already, but the index k is not bound by anything, which cannot be the case in the definition of a constraint in AIMMS: an index must always be bound, either via the index domain, or via an operator like sum. 

Because index k is not bound, you are not having a statement like:
0 = 1 or sum[....]=sum[...]

but the value on the left hand side of the =1, is actually not one value, but a list of values (namely one for each element k).

Again, I would like to point out that the constraint sub3, both in the original form with the if-then in the definition and the current form with the OR in the definition are not linear constraints. You will have to use some modelling tricks (i.e. introducing additional binary variables and additional constraints) if you want your problem to be a linear problem and not a NonLinear problem. For more information about how to do this, please take a look at the integer linear programming tricks in the book Optimization Modeling.

Guido Diepen
AIMMS Specialist

On Friday, May 4, 2012 7:22:39 AM UTC+2, Andy Lin wrote:
HI  Guido,

1.
I had rewrite( if y1(k,d,i,t)=1 then sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i) endif) into the book way 
                  (y1(k,d,i,t)=1 or sum[k,x(k,d,i,t)]=sum[k,x(k,d-1,i,t)]+A(i) ),but it error( The scope of index "k" has not been specified.)
Now I want to change a way to  use set seatset,it can let me not use If-then, just write k in seatset in   
index domain.
I write (y1(k,d,i,t)=1)in seatset definition, but why in date page just can write 0,1?
I want write in ex: 9 seat in i=4,d=1.

2.
I still don't know how to solve Assignment and Notassignment :(The scope of index "k" has not been specified.)

Thanks!!!
Andy

 
 
2012/5/1 Guido Diepen <>
Hi Andy,

林定翰

unread,
May 4, 2012, 6:40:23 AM5/4/12
to ai...@googlegroups.com
HI  Guido, 

I have a problem with minC(Mathematical program).
In objective I select C(d,i,t), but it's occur :Expecting a scalar identifier(no free indecies) ?

Thanks a lot ! : )

Andy 
ATC2 0504 Q2.rar

Guido Diepen

unread,
May 4, 2012, 7:26:07 AM5/4/12
to ai...@googlegroups.com
Hi Andy,

the reason is exactly what the error says: the objective must be a single scalar variable and not a variable that is indexed (i.e. over the combination (d,i,t) as C is in your case).

You can not just say:

minimize c(1,1,1) c(1,1,2) c(1,1,3)

for example, as it is not clear what the complete expression is: you only state the actual variables for all of the possible index combinations. If you want to minimize the sum of all c, you must introduce a new variable that does not have an index domain and as a definition has sum( (d,i,t) , c(d,i,t) ). This would result in the following minimization:

minimize c(1,1,1) + c(c,1,12) + c(1,1,3)

Please take a look at the AIMMS Language Reference, for example the part about parameter declarations (http://www.aimms.com/aimms/download/manuals/aimms3lr_parameterdeclaration.pdf). It might give some insight/tips about indexed parameters and why constructions like the above are not working. 

Guido Diepen
AIMMS Specialist

林定翰

unread,
May 8, 2012, 11:19:00 PM5/8/12
to ai...@googlegroups.com
HI  Guido 

I have initial data problem.
I use constrains to set   initial data :  in condition d=y1, t=5  that  binary variable y1=0, y2=1,v1=0,v2=0.
And I run the MainExecution but it's has two problems !!!  
How can I set  the   initial data in other way?

2012/5/4 Guido Diepen <Guido....@aimms.com>
--
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/msg/aimms/-/HIElikP65VoJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
0508 initial data 2 no solution.bmp
ATC2 0509 Q.rar

Guido Diepen

unread,
May 9, 2012, 3:35:34 AM5/9/12
to ai...@googlegroups.com
Hi Andy,

I don't see any statements in the MainExecution / MainInitialization / MainTermination of the project you provided. 

Regarding initial data, what you can do is you can set the level values for these particular variables before you execute the solve statement, something like:

 y1(k,'1',i,'5') := 0 ; 
solve mincc ; 

Please note that if you are using integer variables, you might need to change some solver settings to ensure the solver uses the start solution. For more information about this, please see http://www.aimms.com/aimms/knowledgebase/kb000025.html

There is an important difference in providing initial values this way, or using a constraint the way you do. By using constraints like you do, they are not initial values, it just means that for d=1 and t=5, the value of y1 will always be 0 and can never be anything else.


Regarding the error in the screenshot, this error is because you now have a mixed integer non linear problem (MINLP) and you have not set all the required settings for it. Please note that this type of problems is extremely hard to solve. To solve this with the AIMMS Outer Approximation Algorithm, you will first have to add a module to your AIMMS project. Better would be to make use of the new GMP version of the AIMMS AOA if you want to solve MINLP problems. Instructions on how to use this new GMP version of the AIMMS AOA can be found on the AIMMS blog: http://blog.aimms.com/2012/02/solving-minlp-problems-with-aimms-outer-approximation/

The fact that you have a MINLP problem is caused by using things like "max" and "if <variable_value> = <some_value> then .... else .... endif "  in the definition of your constraints (e.g. constraint sub10 and sub4). These are non-linear terms.

Are you really sure you want to work with a MINLP and not with only a MIP? If you want to end up with a MIP, you will have to remodel the constraints containing these non-linear terms.

Guido Diepen
AIMMS Specialist

On Wednesday, May 9, 2012 5:19:00 AM UTC+2, Andy Lin wrote:
HI  Guido 

I have initial data problem.
I use constrains to set   initial data :  in condition d=y1, t=5  that  binary variable y1=0, y2=1,v1=0,v2=0.
And I run the MainExecution but it's has two problems !!!  
How can I set  the   initial data in other way?

2012/5/4 Guido Diepen <>
Hi Andy,

the reason is exactly what the error says: the objective must be a single scalar variable and not a variable that is indexed (i.e. over the combination (d,i,t) as C is in your case).

You can not just say:

minimize c(1,1,1) c(1,1,2) c(1,1,3)

for example, as it is not clear what the complete expression is: you only state the actual variables for all of the possible index combinations. If you want to minimize the sum of all c, you must introduce a new variable that does not have an index domain and as a definition has sum( (d,i,t) , c(d,i,t) ). This would result in the following minimization:

minimize c(1,1,1) + c(c,1,12) + c(1,1,3)

Please take a look at the AIMMS Language Reference, for example the part about parameter declarations (http://www.aimms.com/aimms/download/manuals/aimms3lr_parameterdeclaration.pdf). It might give some insight/tips about indexed parameters and why constructions like the above are not working. 

Guido Diepen
AIMMS Specialist

On Friday, May 4, 2012 12:40:23 PM UTC+2, Andy Lin wrote:
HI  Guido, 

I have a problem with minC(Mathematical program).
In objective I select C(d,i,t), but it's occur :Expecting a scalar identifier(no free indecies) ?

Thanks a lot ! : )

Andy 

--
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/msg/aimms/-/HIElikP65VoJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

林定翰

unread,
May 10, 2012, 1:45:03 AM5/10/12
to ai...@googlegroups.com
Hi Guido:
1.
What's  y1(k,'1',i,'5') := 0  means?
I write in :
MainExecution
Body:  y1(d,'1',i,t,'5'):=0;y2(d,'1',t,'5'):=1;v1(d,'1',t,'5'):=0;v2(d,'1',t,'5'):=0;solve mincc 
But there's  an error

2.
How can I ensure set Day and Time  will be chooses  follow the  sequence d{1 to 30 }, t{ 1 to 24}?

Andy




2012/5/9 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/Dzl6WFA51c0J.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

Guido Diepen

unread,
May 10, 2012, 2:01:55 AM5/10/12
to ai...@googlegroups.com
Hi Andy,

The statement 
y1(k, '1', i, '5') := 0
in AIMMS means that you will assign the value 0 to all variables y1 for each d has the value 1 and t has the value 5.

You state that it does not work, but unfortunately, I don't know which error you are getting... If the error is still the same about the AOA callback you mentioned in your previous message, please see my previous answer about this.

If you always want to have these sets to have those values, you can put a definition in these sets:
{1..30}
in the set Day and
{1..24}
in the set Time. 

Guido Diepen
AIMMS Specialist


On Thursday, May 10, 2012 7:45:03 AM UTC+2, Andy Lin wrote:
Hi Guido:
1.
What's  y1(k,'1',i,'5') := 0  means?
I write in :
MainExecution
Body:  y1(d,'1',i,t,'5'):=0;y2(d,'1',t,'5'):=1;v1(d,'1',t,'5'):=0;v2(d,'1',t,'5'):=0;solve mincc 
But there's  an error

2.
How can I ensure set Day and Time  will be chooses  follow the  sequence d{1 to 30 }, t{ 1 to 24}?

Andy




2012/5/9 Guido Diepen <>
Hi Andy,

林定翰

unread,
May 10, 2012, 5:41:43 AM5/10/12
to ai...@googlegroups.com
HI Guido

I want to not use If-then in sub10 and sub11
How can I set the binary variable:  v1(k,d,i,t)=1  when x(k,d,i,t)>=162
                                                      v1(k,d,i,t)=0   when x(k,d,i,t)<=162 
and                                    
                                                     v2(k,d,i,t)=1  when x(k,d,i,t)<=162 
                                                     v2(k,d,i,t)=0  when x(k,d,i,t)>=162 

Andy


2012/5/10 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/yCxodv9N6YoJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
ATC2 0510 Q.rar

Guido Diepen

unread,
May 10, 2012, 8:43:45 AM5/10/12
to ai...@googlegroups.com
Hi Andy,

as mentioned before, please take a look at the Optimization Modelling book for some pointers about this.

You will have to model the relation with additional constraints that will enforce the binary variable to have the correct value. In most of these cases, you will have to introduce a new big-M value (sufficiently large value) which you can multiply with the binary variable (or with (1-binaryvariable) ). This big-M can then be used to ensure that regardless of the value of the binary variable, you can always satisfy the constraint.

Guido Diepen
AIMMS Specialist

On Thursday, May 10, 2012 11:41:43 AM UTC+2, Andy Lin wrote:
HI Guido

I want to not use If-then in sub10 and sub11
How can I set the binary variable:  v1(k,d,i,t)=1  when x(k,d,i,t)>=162
                                                      v1(k,d,i,t)=0   when x(k,d,i,t)<=162 
and                                    
                                                     v2(k,d,i,t)=1  when x(k,d,i,t)<=162 
                                                     v2(k,d,i,t)=0  when x(k,d,i,t)>=162 

Andy


2012/5/10 Guido Diepen <>
Hi Andy,

林定翰

unread,
May 16, 2012, 4:47:36 AM5/16/12
to ai...@googlegroups.com
Hi Guido


I had rewrite the sub-10 to Big-M, but how can I set M in AIMMS, is that a parameter  or ?
where can I find relate information with set the Big-M in AIMMS ?

2012/5/10 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/PgHPYbnMOJIJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

Guido Diepen

unread,
May 16, 2012, 5:02:07 AM5/16/12
to ai...@googlegroups.com
Hi Andy,

the Big-M is just a generic construct. There is no option you can set for this in AIMMS. You should just implement this by introducing a new parameter which you will use as the Big-M. 

Guido Diepen
AIMMS Specialist


On Wednesday, May 16, 2012 10:47:36 AM UTC+2, Andy Lin wrote:
Hi Guido


I had rewrite the sub-10 to Big-M, but how can I set M in AIMMS, is that a parameter  or ?
where can I find relate information with set the Big-M in AIMMS ?

2012/5/10 Guido Diepen <>
Hi Andy,

林定翰

unread,
May 16, 2012, 11:12:41 AM5/16/12
to ai...@googlegroups.com
Hi Guido:

 Please help me with the file!!!I can't figure out! It's no solution again!! 

2012/5/16 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/uEw6z-75iKAJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
ATC 0510 no if-then.zip

Guido Diepen

unread,
May 16, 2012, 11:22:38 AM5/16/12
to ai...@googlegroups.com
Hi Andy,

please note that typically I will not provide complete solutions for modelling problems on the google group.

When testing your project, I got an error in AIMMS that set there was a solver setup failure and that more information was printed in the messages window. You can open this messages window with Ctrl-m or via the window menu in AIMMS (the messages window is something different than the error window).

If you open the messages window, you probably will see a message like:
    CPLEX error: CPLEX cannot handle QCP models with quadratic equality constraints.
    Warning: Model status 13: Error no solution, Solver status 9: Error: Setup failure.

Looking at your model, you can see that variable C has in its definition a multiplication of two variables (i.e. v1 and x). This makes for a Quadratic Constraint Problem (i.e. there are quadratic terms in the constraints because a variable with a definition will introduce an equality constraint). And cplex cannot handle these type of constraints if they are equality constraints.

In this case, you have two options:
* You can force your model to be a NLP problem and solve it with an NLP solver
* You can try to use more modeling tricks to get rid of the multiplication of the two decision variables.

Guido Diepen
AIMMS Specialist

林定翰

unread,
May 17, 2012, 4:05:42 AM5/17/12
to ai...@googlegroups.com
Hi Guido: 

What's the Warning mean in AIMMS ?
 Warning: The columns "x(12,30,9,23)" and "x(6,30,9,23)" are equal in the generated mathematical program "mincc".
This may lead to non-unique solutions. 

2012/5/16 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/M76DU9bhKhEJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

Guido Diepen

unread,
May 18, 2012, 2:50:12 AM5/18/12
to ai...@googlegroups.com
Hi Andy,

after the text you posted, there should be some more text, namely:
For more information regarding potential causes and consequences, see the help associated with the option "Warning_duplicate_column".

If you look at the help (Menu > Help > Contents and Index) and search in the index for Warning duplicate column, you will get the full explanation.

In short, if you have the following problem:
max x + y
s.t.
    x+y <= 10

The columns for both x and y in the matrix will be the same. This means that there actually are two optimal solutions to the above problem: (10,0) and (0,10). 

Guido Diepen
AIMMS Specialist
Message has been deleted

林定翰

unread,
May 21, 2012, 2:44:44 AM5/21/12
to ai...@googlegroups.com
Hi Guido:  

I had run procedure , but I don't know why the value "cc" is na ,and what's the level and Basic means in C's data page  ?    

Is that any problem in set(ATC,Assignment,Notassignment,jobover,jobnotover) or ?

2012/5/18 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/jXcHx1K2LrMJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
0519 text.docx
1.bmp

Guido Diepen

unread,
May 21, 2012, 2:51:13 PM5/21/12
to ai...@googlegroups.com
Hi Andy,

I don't know why you get the value na. This means that no value was available. What is the solver status after you ran the procedure? You can view this by pressing Ctrl-p to open the progress window. The program status should be something like Optimal, while the solver status should be something like Normal completion.

The level value of a variable is the actual value of the variable. The basic suffix denotes whether a variable is basic or non-basic. Please see the explanation on http://en.wikipedia.org/wiki/Simplex_algorithm for more information about this.

Also, please adapt your MainTermination procedure and give it the default contents again. The MainTermination procedure is called when you are closing the project, and typically you do not want to solve a math program anymore. Also, the MainTermination procedure should return the value 1 if AIMMS can close the project and 0 otherwise. The easiest fix you can do is just put only the following contents in the MainTermination:

return 1 ; 

This will just allow AIMMS to always close the project, even if there is unsaved data. If you want to provide the ability to save any unsaved data, please create a new project and copy the contents of the MainTermination of this new project to your existing project.

Guido Diepen
AIMMS Specialist

林定翰

unread,
May 21, 2012, 11:14:42 PM5/21/12
to ai...@googlegroups.com
HI Guido
program status: infeasible or unbounded
solver status:Normal completion.


I  want write :{(k,d,i,t)|x(k,d,i,t)> 162} in set jobover, but it occur: The dimension of the set expression (4) does not match with the dimension of set "jobover" (1).

2012/5/22 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/F8niiyeP2qMJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

Guido Diepen

unread,
May 22, 2012, 3:32:59 AM5/22/12
to ai...@googlegroups.com
Hi Andy,

what you are doing with the statement 
{(k,d,i,t)|x(k,d,i,t)> 162} 

is that you define a set of those combinations of elements (k,d,i,t) such that x(k,d,i,t) has a value > 162. Because you are combining the 4 indices, you are creating something with 4 dimensions. However, your set jobover is a subset of the jobs, meaning it is only declared as one dimension.

I think you want to do something similar as before in this thread, namely that you want to have those k, for which there exists a combination of (d,i,t) such that x(k,d,i,t) > 162. Please see one of my earlier answers for the answer on how to achieve this.

Regarding the solver status, it means that the solver has finished solving your problem and found that no solution exists or that the problem is unbounded (which means that your solution can go to +inf in case of max and -inf in case of min problem). Please see the thread https://groups.google.com/d/topic/aimms/gRG1VLu6bRE/discussion for more information. Also, on the AIMMS knowledge base page http://www.aimms.com/aimms/knowledgebase/kb000017.html for more information about investigating the cause of infeasible models.

Guido Diepen
AIMMS Specialist

林定翰

unread,
May 22, 2012, 7:38:52 AM5/22/12
to ai...@googlegroups.com
HI Guido

How can I write k which  run in sub-2 to be a set , that I can know which k had been choose in shift!!!

2012/5/22 Guido Diepen <Guido....@aimms.com>
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/n773Ho3wX98J.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

Guido Diepen

unread,
May 22, 2012, 8:22:47 AM5/22/12
to ai...@googlegroups.com
Hi Andy,

I don't know what you mean with the last part, though I think it is related to the following fundamental problem I found in the document you sent earlier:

You created the set Assignment as follows:

SET:

       identifier   :  Assignment

       subset of    :  ATC

       index        :  assignmentset

       definition   :  { k | not exists( (d,i,t) |   (x(k,d,i,t) > 170)  or  (y1(k,d,i,t) = 1) or (z(k,d,i,t) > 100) ) } ;


This means that it contains those k for which there does not exist the combination (d,i,t) such that the expression is true.

However, in the definition of your constraints, you cannot use the part    
k in Assignment

The reason for this is that the solver does not get this information. Before the constraint matrix is generated that will be sent to the solver, AIMMS will use the level values of the variables to determine the set of k that are in Assignment, after which it will use this information to generate the constraint sub7 for example for those k. However, the solver will not automatically update the elements in the set Assignment. 

So the elements that are in a set can only change before or after the solve, but the solver itself will not change the elements that are in a set. If you want to model a decision "is in the set" / "is not in the set", you will have to make use of binary variables. Please note that you for this binary variable, you can also not make use of the exists operator, as this will also not result in a linear program.

If you want to end up with a linear program, I would like to recommend you to really take another look at your mathematical model on paper (not the one you have now in AIMMS, but really your model in mathematical notation on paper). 

Guido Diepen
AIMMS Specialist

林定翰

unread,
May 28, 2012, 12:36:57 PM5/28/12
to ai...@googlegroups.com
HI Guido:

I run the procedure, but in Math Program inspector I can't see the variable z !
So,   there is no K   run in Sestet? (Seatset is a set that when y1(k,d,i,t)=1, k will be choose in )

Another question : what is the different if I  write the k in seatset(d,i,t) in index domain and Definition?
     

Guido Diepen

unread,
May 30, 2012, 3:21:33 AM5/30/12
to ai...@googlegroups.com
Hi Andy,

please see my previous reply: the solver will not use the k in SeatSet construct: AIMMS will use the values it finds before constructing the matrix to determine which k at that moment are in the set SeatSet. It then sends this information to the solver. The solver will not be able to change the set SeatSet while it is running. Only after the solve is finished, will AIMMS determine which k should now be in the SeatSet based on the values the solver found for y1.

The index domain instruct AIMMS to generate an actual constraint line in the constraint matrix for each k that is in that seatset.

Putting something in the domain condition is similar to putting a 'For all' after the constraint definition in the mathematical notation. 

Guido Diepen
AIMMS Specialist
Reply all
Reply to author
Forward
Message has been deleted
0 new messages