help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Even integer numbers


From: Antonio Carlos Moretti
Subject: Re: [Help-glpk] Even integer numbers
Date: Wed, 1 Oct 2014 23:45:04 -0300 (BRT)
User-agent: SquirrelMail/1.4.8

I understood he was asking how to model this.
A

> Or easier:
>
> X, Xhalf \in {0, 1, 2, ...}
>
> X = 2*Xhalf
>
> BR Oscar
>
> Skickat från min Sony Ericsson Xperia pro
>
> ANTONIO MORETTI <address@hidden> skrev:
>
>>Zvonko,
>>you may use binary variables to solve this problem, but, x must have a
>>upper bound.
>>For example, suppose x <= 10 and x \in \{2,4,6,8,10 \}, then define a
>>binary variable
>>
>>Y_j = 1 , if x = 2*j  or 0,  otherwise for j = 1,2,3,4,5
>>
>>Therefore, x = 2*y_1 + 4*y_2 + 6*y_3 + 8*y_4 + 10*y_5
>>                   y_1 + y_2 + y_3 + y_4 + y_5 = 1
>>
>>I hope this helps.
>>
>>Antonio
>>
>>Em 01/10/2014 08:31, Zvonko Bregar escreveu:
>>>
>>> Hi everybody,
>>>
>>> Does there exist an expression
>>>
>>> That forces
>>>
>>> An integer variable X \in { 1, 2, 3, ...}
>>>
>>> To take the values only from even numbers
>>>
>>> X \in {2, 4, 6, ...}
>>>
>>> Regards,
>>>
>>> --Zvonko
>>>
>>>
>>> OPOZORILO: To elektronsko sporoc(ilo in vse njegove morebitne priloge
>>> lahko vsebujejo zaupne in/ali privilegirane informacije, ki so last
>>> Elektroins(tituta Milan Vidmar in so namenjene izkljuc(no naslovniku.
>>> C(e ste sporoc(ilo prejeli pomotoma zaradi napake v naslovu ali pri
>>> prenosu sporoc(ila, Vas prosimo, da nas o tem obvestite s povratno
>>> pos(to. V tem primeru vsebine prejetega sporoc(ila ne smete uporabiti,
>>> kopirati, tiskati, objaviti ali distribuirati, ampak ga morate takoj
>>> unic(iti.
>>>
>>> DISCLAIMER: This e-mail is for the intended recipient only. It
>>> contains proprietary information some or all of which may be legally
>>> privileged. If you received this e-mail by mistake please notify us by
>>> replying to this e-mail. Consequently, the contents of this e-mail
>>> must be deleted and not be used, copied, printed, disclosed or
>>> distributed.
>>>
>>>
>>>
>>> _______________________________________________
>>> Help-glpk mailing list
>>> address@hidden
>>> https://lists.gnu.org/mailman/listinfo/help-glpk
>>
>>
>>
>>---
>>Este email está limpo de vírus e malwares porque a proteção do avast!
>> Antivírus está ativa.
>>http://www.avast.com
>>
>>_______________________________________________
>>Help-glpk mailing list
>>address@hidden
>>https://lists.gnu.org/mailman/listinfo/help-glpk
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]