Hi guys

Thanks for all the answers, I haven't had much time to look at them.

However I can tell you that the range of y and w are [0...4] maybe a little=
larger.=A0 And if w is 0 then so is y.

Hope this helps.

Best regards,

Kasper

On Apr 29, 2012 5:23 AM, "Michael Hennebry&=
quot; <hennebry@web.cs=
.ndsu.nodak.edu> wrote:

--20cf3074b016016b4204bef6294b--
From MAILER-DAEMON Wed May 02 03:03:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SPTbQ-0006oM-SP
for mharc-help-glpk@gnu.org; Wed, 02 May 2012 03:03:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57622)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from Hi guys

Thanks for all the answers, I haven't had much time to look at them.

However I can tell you that the range of y and w are both [0..6] maybe a li=
ttle higher. And if w is 0, then so are y.

Maybe this helps a little.=

Best regards,

Kasper

On Apr 29, 2012 5:23 AM, "Michael Hennebry&=
quot; <hennebry@web.cs.ndsu.nodak.edu> wrote:

**
Divisiblilty can be used to reduce the problem somewhat.**

On Fri, 27 Apr 2012, Michael Hennebry wrote:

# Since pn/pd is in lowest terms, y must be a multiple of pd.

var ypd, integer, >=3D 10/pd, <=3D 200/pd

# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 =A0 =A0 =A0 =A0 11

s.t. y_formula :

=A0 =A0y =3D ypd*pd;

**
**

--

Michael =A0 hennebry@web.cs.ndsu.NoDak.edu

"On Monday, I'm gonna have to tell my kindergarten class,

whom I teach not to run with scissors,

that my fiance ran me through with a broadsword." =A0-- =A0Lily

--20cf307d011659090204bf084995--
From MAILER-DAEMON Wed May 02 03:29:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SPU0d-0004sr-P2
for mharc-help-glpk@gnu.org; Wed, 02 May 2012 03:29:59 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51979)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from On Fri, 27 Apr 2012, Michael Hennebry wrote:

# Solve

# x =3D p * y / w

# w * pd * x =3D pn * y

# where x, y, w are natural numbers and

# p =3D 11 / 17

# pn =3D 11

# pd =3D 17

# x in [23, 100]

# y in [10, 200]

# w in [3, 7]

# Since pn/pd is in lowest terms, y must be a multiple of pd.

param w_min :=3D 3;

param w_max :=3D 7;

param pn :=3D 11;

param pd :=3D 17;

set I :=3D {w_min..w_max};

var w{I}, binary;

var y, integer, >=3D 10, <=3D 200;

var x, integer, >=3D 23, <=3D 100;

var ypd, integer, >=3D 10/pd, <=3D 200/pd

# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 =A0 =A0 =A0 =A0 11

s.t. y_formula :

=A0 =A0y =3D ypd*pd;

s.t. lb{i in I} :=A0 =A0 i =A0 * =A0 =A0x >=3D pn*ypd - (1-w[i]) * (pn*11 -i* =A0 23);

=A0 i * pd * x >=3D pn * y - (1-w[i]) * (pn*200-i*pd*23);

s.t. ub{i in I} :=A0 =A0 i =A0 * =A0 =A0x <=3D pn*ypd + (1-w[i]) * (i * =A0100-pn =A0 );=

=A0 i * pd * x <=3D pn * y + (1-w[i]) * (i*pd*100-pn*10);

s.t. sm :

=A0 sum{i in I} w[i] =3D 1;

solve;

printf "x =3D %f\ny =3D %f\nw =3D %f\n", x, y, sum{i in I} w[i] *= i;

end;

--

Michael =A0 hennebry@web.cs.ndsu.NoDak.edu

"On Monday, I'm gonna have to tell my kindergarten class,

whom I teach not to run with scissors,

that my fiance ran me through with a broadsword." =A0-- =A0Lily

After looking over=A0Xypron's example, it=
became clear to me that you lack some information, sorry for that.<=
/div>

--

**Kasper Tordrup - Stud. M. Sc.**

IMADA @ University of Southern Denmark

KTordrup@gmail.com<= /a> - +45 27 44 58 49

--90e6ba53a91afa0e4104bf08a6fb--
From MAILER-DAEMON Wed May 02 12:36:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SPcXo-000291-Au
for mharc-help-glpk@gnu.org; Wed, 02 May 2012 12:36:48 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41638)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPcXk-000272-8f
for help-glpk@gnu.org; Wed, 02 May 2012 12:36:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SPcXe-0003Vf-OB
for help-glpk@gnu.org; Wed, 02 May 2012 12:36:43 -0400
Received: from mail.cs.ndsu.nodak.edu ([134.129.125.92]:32970)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPcXe-0003La-Dk
for help-glpk@gnu.org; Wed, 02 May 2012 12:36:38 -0400
Received: from mail.cs.ndsu.nodak.edu (localhost [127.0.0.1])
by mail.cs.ndsu.NoDak.edu (8.14.2/8.14.2/Debian-2build1) with ESMTP id
q42GaS3L006024; Wed, 2 May 2012 11:36:29 -0500
Received: from localhost (hennebry@localhost)
by mail.cs.ndsu.nodak.edu (8.14.2/8.14.2/Submit) with ESMTP id
q42GaSnu006021; Wed, 2 May 2012 11:36:28 -0500
X-Authentication-Warning: mail.cs.ndsu.nodak.edu: hennebry owned process doing
-bs
Date: Wed, 2 May 2012 11:36:28 -0500 (CDT)
From: Michael Hennebry
X-X-Sender: hennebry@mail.cs.ndsu.nodak.edu
To: Kasper Tordrup
In-Reply-To:
Message-ID:
References:
<20120427185852.3030@gmx.net>
User-Agent: Alpine 1.00 (DEB 882 2007-12-20)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 134.129.125.92
Cc: help-glpk
Subject: Re: [Help-glpk] fraction with vars
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 02 May 2012 16:36:46 -0000
On Wed, 2 May 2012, Kasper Tordrup wrote:
> After looking over Xypron's example, it became clear to me that you lack
> some information, sorry for that.
> The x represent a percentage of p that I need, and this means that y is <=
> to w.
> So summing up:
> x will always be <= to p.
> y will always be <= to w.
> if w is 0, then so are y.
> p is a constant.
> x,y and w are variables.
> y and w are in the range [0..6] (or close to that)
> and I want to calculate:
> x_suj = p_s * (y_suj/w_su)
(repeating)
> if w is 0, then so are y.
x_suj * w_su = p_s * y_suj
No division issues.
(repeating)
> The x represent a percentage of p that I need, and this means that y is <=
> to w.
Are you sure?
> Sorry for the mess, hope this clarifies it.
Actually, 'tis a bit foggier now.
What is p? Can it be 22/7, 7/22, sqrt(2.), 1/123, pi?
Is the equality exact?
Why is there a percentage involved instead of a fraction?
One does not normally calculate with percentages.
Usually, percentages are just human-friendly input or output.
--
Michael hennebry@web.cs.ndsu.NoDak.edu
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily
From MAILER-DAEMON Wed May 02 13:43:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SPdaR-0002lr-E2
for mharc-help-glpk@gnu.org; Wed, 02 May 2012 13:43:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59785)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPdaO-0002lk-2Z
for help-glpk@gnu.org; Wed, 02 May 2012 13:43:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SPdaL-0007HK-WC
for help-glpk@gnu.org; Wed, 02 May 2012 13:43:31 -0400
Received: from mail-qc0-f169.google.com ([209.85.216.169]:48534)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPdaL-0007H8-Ol
for help-glpk@gnu.org; Wed, 02 May 2012 13:43:29 -0400
Received: by qcsd16 with SMTP id d16so724543qcs.0
for ; Wed, 02 May 2012 10:43:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type; bh=YWkcUktl5jVlz8yoXx3R4S4G3kC/yDP5WUjf5tH0FMg=;
b=nUgGLW7fU4nXchJTkBDMfN3VBiF8WSSHosygu/U5vX3BVfqU7p2FsQzxDGaXCG4fob
zgsMOtluo2fri4P9hBUXZcIqHAwB6w6QL4iskuDy2SbLxz8pE3aH5kEbLwpYJk9f1WUN
+T/VCeciiCqT/2Cnbsdd+LtTLJvczR9uksSRz2fEBlJ/AmdOSdW2SNxThKWYGMj3Q7yX
Xh0vumUpafD7k565McF0Mhb23ZzMt2MyMqrabPhWK4acgGjweYvi6fJS8jvlJAjG2oif
zcW4j6m1wUqNBCi0YJx4QwOjvibnRzibVQbVyiZxzy5sccyoJlDfgo0/NdjuQkaSTdGp
mPpQ==
MIME-Version: 1.0
Received: by 10.224.27.5 with SMTP id g5mr154414qac.2.1335980607265; Wed, 02
May 2012 10:43:27 -0700 (PDT)
Received: by 10.224.217.67 with HTTP; Wed, 2 May 2012 10:43:27 -0700 (PDT)
In-Reply-To:
References:
<20120427185852.3030@gmx.net>
Date: Wed, 2 May 2012 19:43:27 +0200
Message-ID:
From: Kasper Tordrup
To: help-glpk
Content-Type: multipart/alternative; boundary=bcaec517ac9c85d9a504bf11394c
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 209.85.216.169
Subject: [Help-glpk] Fwd: fraction with vars
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 02 May 2012 17:43:33 -0000
--bcaec517ac9c85d9a504bf11394c
Content-Type: text/plain; charset=ISO-8859-1
forgot to send it to all
---------- Forwarded message ----------
From: Kasper Tordrup
Date: Wed, May 2, 2012 at 7:41 PM
Subject: Re: [Help-glpk] fraction with vars
To: Michael Hennebry
On Wed, May 2, 2012 at 6:36 PM, Michael Hennebry <
hennebry@web.cs.ndsu.nodak.edu> wrote:
> On Wed, 2 May 2012, Kasper Tordrup wrote:
>
> After looking over Xypron's example, it became clear to me that you lack
>> some information, sorry for that.
>> The x represent a percentage of p that I need, and this means that y is <=
>> to w.
>> So summing up:
>> x will always be <= to p.
>> y will always be <= to w.
>> if w is 0, then so are y.
>> p is a constant.
>> x,y and w are variables.
>> y and w are in the range [0..6] (or close to that)
>> and I want to calculate:
>> x_suj = p_s * (y_suj/w_su)
>>
>
> (repeating)
>
> if w is 0, then so are y.
>>
>
> x_suj * w_su = p_s * y_suj
>
> No division issues.
>
> (repeating)
>
> The x represent a percentage of p that I need, and this means that y is <=
>> to w.
>>
>
> Are you sure?
I might be using the wrong words, x is NOT a percentage number (0..100 or
0..1) it is a fraction of p i.e. 2/3 or p.
>
>
> Sorry for the mess, hope this clarifies it.
>>
>
> Actually, 'tis a bit foggier now.
> What is p? Can it be 22/7, 7/22, sqrt(2.), 1/123, pi?
>
No, p is integer.
> Is the equality exact?
> Why is there a percentage involved instead of a fraction?
>
Sorry, x is a fraction of p.
> One does not normally calculate with percentages.
> Usually, percentages are just human-friendly input or output.
>
>
> --
> Michael hennebry@web.cs.ndsu.NoDak.edu
> "On Monday, I'm gonna have to tell my kindergarten class,
> whom I teach not to run with scissors,
> that my fiance ran me through with a broadsword." -- Lily
>
So, as an example p=1000, y=1 and w=3 and so I want to find x=333.3333
Does this make it a bit more clear?
--
*Kasper Tordrup - Stud. M. Sc.
IMADA @ University of Southern Denmark
KTordrup@gmail.com - +45 27 44 58 49*
--bcaec517ac9c85d9a504bf11394c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
forgot to send it to all

--

**Kasper Tordrup - Stu=
d. M. Sc.**

IMADA @ University= of Southern Denmark

KTordrup@gmail.com<= /a> - +45 27 44 58 49

--bcaec517ac9c85d9a504bf11394c-- From MAILER-DAEMON Wed May 02 20:40:37 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SPk61-0004Nx-Jq for mharc-help-glpk@gnu.org; Wed, 02 May 2012 20:40:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from) id 1SPk5y-0004Np-Ul
for help-glpk@gnu.org; Wed, 02 May 2012 20:40:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SPk5x-0001PI-2w
for help-glpk@gnu.org; Wed, 02 May 2012 20:40:34 -0400
Received: from mail.cs.ndsu.nodak.edu ([134.129.125.92]:45095)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPk5w-0001Ov-Pq
for help-glpk@gnu.org; Wed, 02 May 2012 20:40:33 -0400
Received: from mail.cs.ndsu.nodak.edu (localhost [127.0.0.1])
by mail.cs.ndsu.NoDak.edu (8.14.2/8.14.2/Debian-2build1) with ESMTP id
q430eRL2010834; Wed, 2 May 2012 19:40:28 -0500
Received: from localhost (hennebry@localhost)
by mail.cs.ndsu.nodak.edu (8.14.2/8.14.2/Submit) with ESMTP id
q430eRH3010831; Wed, 2 May 2012 19:40:27 -0500
X-Authentication-Warning: mail.cs.ndsu.nodak.edu: hennebry owned process doing
-bs
Date: Wed, 2 May 2012 19:40:27 -0500 (CDT)
From: Michael Hennebry
X-X-Sender: hennebry@mail.cs.ndsu.nodak.edu
To: Kasper Tordrup
In-Reply-To:
Message-ID:
References:
<20120427185852.3030@gmx.net>
User-Agent: Alpine 1.00 (DEB 882 2007-12-20)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 134.129.125.92
Cc: help-glpk
Subject: Re: [Help-glpk] Fwd: fraction with vars
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 03 May 2012 00:40:36 -0000
On Wed, 2 May 2012, Kasper Tordrup wrote:
> So, as an example p=1000, y=1 and w=3 and so I want to find x=333.3333
>
> Does this make it a bit more clear?
Yes.
w and y are arrays of non-negative integer variables.
p is a vector of positive integers.
x is an array of continous variables.
If w_su is zero, then y_suj are zero and x_suj may be anything.
x_suj * w_su = p_s * y_suj
w_su = SUM k*q_suk
k
q_suk binary
SUM q_suk = 1
k
small-M method, M's are G's and L's.
q_suk = 1 -->
x_suj * k >= p_s * y_suj
x_suj * k <= p_s * y_suj
The constraints will be:
x_suj * k + G_sujk * (1-q_suk) >= p_s * y_suj
x_suj * k <= p_s * y_suj + L_sujk * (1-q_suk)
for all s, u, j, k
Regardless of the values of the G's and L's,
those constraints for which q_suk=1 are valid.
The G's and L's need to be selected big enough to be valid if q_suk=0.
x_suj * k + G_sujk * (1-q_suk) >= p_s * y_suj
G_sujk * (1-q_suk) >= p_s * y_suj - x_suj * k for all s, u, j, k
G_sujk * (1-q_suk) >= p_s * y_suj * (1-k/w_su) for all s, u, j, k
It is sufficient that
G_sujk == p_s*max(y_suj)*(1-k/max(w_su)) == p_s*(max(w_su)-k),
assuming y_suj and w_su have the same range.
For k==max(w_su), w_su<=k-1 and it is sufficient that
G_sujk == -p_s
Likewise
L_sujk * (1-q_suk) >= p_s * y_suj * (k/w_su-1) for all s, u, j, k
It is sufficient that
L_sujk == p_s*max(y_suj*(k/w_su-1))
== p_s*max(y_suj*(k/y_suj-1)) assuming a common range
== p_s*max(k-y_suj)
== p_s*k assuming y_suj has lower bound of zero
--
Michael hennebry@web.cs.ndsu.NoDak.edu
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily
From MAILER-DAEMON Thu May 03 05:42:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SPsYE-0007ba-Ln
for mharc-help-glpk@gnu.org; Thu, 03 May 2012 05:42:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57639)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPsY8-0007aB-5R
for help-glpk@gnu.org; Thu, 03 May 2012 05:42:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SPsY1-0007K2-GZ
for help-glpk@gnu.org; Thu, 03 May 2012 05:42:11 -0400
Received: from mail-qc0-f169.google.com ([209.85.216.169]:56412)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPsY1-0007Jt-8v
for help-glpk@gnu.org; Thu, 03 May 2012 05:42:05 -0400
Received: by qcsd16 with SMTP id d16so1173059qcs.0
for ; Thu, 03 May 2012 02:42:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type; bh=0vD1K5XXmYvWuyESdT3fSqnDbgUtUsFvcxWivU2G19Y=;
b=PCj5HPBX3N2o8oib94rYaYXI2MDeNXQeYzkdp4c2hsIPSJi01MSyU2Zfwu5FGLNFkQ
tIr0He3DCqhw+132vQKgfP2WVJNlNp/pt4AwIDjv6lifX2rp3xoArMMFN5hhj3rdcXpd
JDn/jJh94Suy5HRKU33eTpMdbORzfJpLJjJdOxnsmrcR0TMTrKX6/0ZwBpL/8H3G30Nx
lTMQo4O/97BeZV5TQwd/XtqlDPOXo/9CKHiqOh1lVJXv5palfBY4WcAJoocKoJX6XK11
tiw1KrkLaxlR6LhMun2vJanwtY6K9H0CSqr1uxu4lHA03HiohpAmnbFirP2AfkUxKtSe
9HFQ==
MIME-Version: 1.0
Received: by 10.224.117.77 with SMTP id p13mr2445247qaq.71.1336038123477; Thu,
03 May 2012 02:42:03 -0700 (PDT)
Received: by 10.224.217.67 with HTTP; Thu, 3 May 2012 02:42:03 -0700 (PDT)
In-Reply-To:
References:
<20120427185852.3030@gmx.net>
Date: Thu, 3 May 2012 11:42:03 +0200
Message-ID:
From: Kasper Tordrup
To: help-glpk
Content-Type: multipart/alternative; boundary=20cf3074b264c19acb04bf1e9d83
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 209.85.216.169
Subject: Re: [Help-glpk] Fwd: fraction with vars
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 03 May 2012 09:42:17 -0000
--20cf3074b264c19acb04bf1e9d83
Content-Type: text/plain; charset=ISO-8859-1
thank you very much, this was a big help, exactly what I need
Best regards,
Kasper
On Thu, May 3, 2012 at 2:40 AM, Michael Hennebry <
hennebry@web.cs.ndsu.nodak.edu> wrote:
> On Wed, 2 May 2012, Kasper Tordrup wrote:
>
> So, as an example p=1000, y=1 and w=3 and so I want to find x=333.3333
>>
>> Does this make it a bit more clear?
>>
>
> Yes.
>
> w and y are arrays of non-negative integer variables.
> p is a vector of positive integers.
> x is an array of continous variables.
> If w_su is zero, then y_suj are zero and x_suj may be anything.
>
>
> x_suj * w_su = p_s * y_suj
>
> w_su = SUM k*q_suk
> k
>
> q_suk binary
>
> SUM q_suk = 1
> k
>
> small-M method, M's are G's and L's.
> q_suk = 1 -->
> x_suj * k >= p_s * y_suj
> x_suj * k <= p_s * y_suj
>
> The constraints will be:
> x_suj * k + G_sujk * (1-q_suk) >= p_s * y_suj
> x_suj * k <= p_s * y_suj + L_sujk * (1-q_suk)
> for all s, u, j,
> k
>
> Regardless of the values of the G's and L's,
> those constraints for which q_suk=1 are valid.
>
> The G's and L's need to be selected big enough to be valid if q_suk=0.
>
> x_suj * k + G_sujk * (1-q_suk) >= p_s * y_suj
> G_sujk * (1-q_suk) >= p_s * y_suj - x_suj * k for all s, u, j, k
> G_sujk * (1-q_suk) >= p_s * y_suj * (1-k/w_su) for all s, u, j, k
>
> It is sufficient that
> G_sujk == p_s*max(y_suj)*(1-k/max(w_su)) == p_s*(max(w_su)-k),
> assuming y_suj and w_su have the same range.
>
> For k==max(w_su), w_su<=k-1 and it is sufficient that
> G_sujk == -p_s
>
>
> Likewise
> L_sujk * (1-q_suk) >= p_s * y_suj * (k/w_su-1) for all s, u, j, k
>
> It is sufficient that
> L_sujk == p_s*max(y_suj*(k/w_su-1))
> == p_s*max(y_suj*(k/y_suj-1)) assuming a common range
> == p_s*max(k-y_suj)
> == p_s*k assuming y_suj has lower bound of zero
>
>
> --
> Michael hennebry@web.cs.ndsu.NoDak.edu
> "On Monday, I'm gonna have to tell my kindergarten class,
> whom I teach not to run with scissors,
> that my fiance ran me through with a broadsword." -- Lily
>
--
*Kasper Tordrup - Stud. M. Sc.
IMADA @ University of Southern Denmark
KTordrup@gmail.com - +45 27 44 58 49*
--20cf3074b264c19acb04bf1e9d83
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
thank you very much, this was a big help, exactly what I need

--

=**Kasper Tordrup - Stud. M. Sc.**

IMADA @ University of Southern Denmark

KTordrup@gmail.com<= /a> - +45 27 44 58 49

--20cf3074b264c19acb04bf1e9d83--
From MAILER-DAEMON Thu May 03 08:30:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SPvAe-0003FK-91
for mharc-help-glpk@gnu.org; Thu, 03 May 2012 08:30:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43362)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPvAR-00032j-Jf
for help-glpk@gnu.org; Thu, 03 May 2012 08:30:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SPvAJ-0001IS-K1
for help-glpk@gnu.org; Thu, 03 May 2012 08:29:55 -0400
Received: from ikar.perftech.si ([195.246.0.20]:11759)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPvAJ-0001Ho-8x
for help-glpk@gnu.org; Thu, 03 May 2012 08:29:47 -0400
X-ASG-Debug-ID: 1336048179-00adbe08b23c890002-HoBLG4
Received: from mailix.eimv.si ([193.2.45.18]) by ikar.perftech.si with ESMTP
id UAGuZpcD8lDdiE2k (version=TLSv1 cipher=AES128-SHA bits=128
verify=NO) for ;
Thu, 03 May 2012 14:29:40 +0200 (CEST)
X-Barracuda-Envelope-From: Zvonko.Bregar@eimv.si
X-Barracuda-AUTH-User: smtp
X-Barracuda-Apparent-Source-IP: 193.2.45.18
Received: from MAILIX.eimv.si ([::1]) by mailix.eimv.si ([::1]) with mapi;
Thu, 3 May 2012 14:29:09 +0200
From: Zvonko Bregar
To: "help-glpk@gnu.org"
Thread-Topic: binary boolean
X-ASG-Orig-Subj: binary boolean
Thread-Index: Ac0pKFXIriuaBetbQzqtaHdJjdyS0g==
Date: Thu, 3 May 2012 12:29:07 +0000
Message-ID: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
Accept-Language: sl-SI, en-US
Content-Language: sl-SI
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Content-Type: multipart/alternative;
boundary="_000_94CFC53F44B33041A7D49133F54DF168C5375EA5mailixeimvsi_"
MIME-Version: 1.0
X-Barracuda-Connect: UNKNOWN[193.2.45.18]
X-Barracuda-Start-Time: 1336048179
X-Barracuda-Encrypted: AES128-SHA
X-Barracuda-URL: http://10.12.0.14:5000/cgi-mod/mark.cgi
X-Virus-Scanned: by bsmtpd at perftech.si
X-Barracuda-Spam-Score: 0.00
X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0
QUARANTINE_LEVEL=1000.0 KILL_LEVEL=7.0 tests=HTML_MESSAGE
X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.95870
Rule breakdown below
pts rule name description
---- ----------------------
--------------------------------------------------
0.00 HTML_MESSAGE BODY: HTML included in message
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 195.246.0.20
Subject: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 03 May 2012 12:30:06 -0000
--_000_94CFC53F44B33041A7D49133F54DF168C5375EA5mailixeimvsi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
My name is Zvonko.
I have a question regarding binary variables in GLPK.
Is it possible to implement a kind of a boolean addition to binary variable=
s.
For example:
Let X, Y and Z be binary variables.
X and Y ara inputs, Z is a result.
X + Y =3D Z
Such that
0 + 0 =3D 0
0 + 1 =3D 1
1 + 0 =3D 1
1 + 1 =3D 1
So this would be sometning like a logical .OR. addition?
Many thanks
Regards
--Zvonko
OPOZORILO: To elektronsko sporo?ilo in vse njegove morebitne priloge lahko =
vsebujejo zaupne in/ali privilegirane informacije, ki so last Elektroin?tit=
uta Milan Vidmar in so namenjene izklju?no naslovniku. ?e ste sporo?ilo pre=
jeli pomotoma zaradi napake v naslovu ali pri prenosu sporo?ila, Vas prosim=
o, da nas o tem obvestite s povratno po?to. V tem primeru vsebine prejetega=
sporo?ila ne smete uporabiti, kopirati, tiskati, objaviti ali distribuirat=
i, ampak ga morate takoj uni?iti.
DISCLAIMER: This e-mail is for the intended recipient only. It contains pro=
prietary 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-mai=
l. Consequently, the contents of this e-mail must be deleted and not be use=
d, copied, printed, disclosed or distributed.
--_000_94CFC53F44B33041A7D49133F54DF168C5375EA5mailixeimvsi_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
) id 1SPwiH-00081n-HN
for help-glpk@gnu.org; Thu, 03 May 2012 10:09:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SPwiC-0001Tn-6Y
for help-glpk@gnu.org; Thu, 03 May 2012 10:08:57 -0400
Received: from mail-wg0-f49.google.com ([74.125.82.49]:41493)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SPwiB-0001OM-Qt
for help-glpk@gnu.org; Thu, 03 May 2012 10:08:52 -0400
Received: by wgbds1 with SMTP id ds1so1341197wgb.30
for ; Thu, 03 May 2012 07:08:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:sender:in-reply-to:references:from:date
:x-google-sender-auth:message-id:subject:to:cc:content-type;
bh=cRNh0dOrIbQ4Kz73BsQWpqmONHSFbQc03s3kkdkCMnI=;
b=aIKQr6ub7s/uoqzQV241b/beF9J9OrXbZjIYdsm+COqtYQ4FzsFmvDp9XpfW01Kw37
zuhHTKPP9rThwyNgesDMNPYzsnb/9vc/8pxjXZAHKBJW2SY39Nlj/RKB5ML5p68ig4Tl
6DrIAoe3ILzxvVQS/NX2PLPYNnEixyzQHykyogWi7wBR6xGi6JM7bCjxlgxr0/InOc7y
Qiwry/ZXoJoXEE3vxdBmy75pMDFg6ju1gtOTs3wpYOm2ULqdcBJdQ3fAbTrg2f4Hj2mc
FWprYwx5kNYL8FQAVUw18l4iwgmEXaeESDtygtisJTjh6OWZIHzUd9/j7g9fdWGw3j1w
C6yg==
Received: by 10.180.88.169 with SMTP id bh9mr3793004wib.5.1336054128780; Thu,
03 May 2012 07:08:48 -0700 (PDT)
MIME-Version: 1.0
Sender: erwin.kalvelagen@gmail.com
Received: by 10.223.96.133 with HTTP; Thu, 3 May 2012 07:08:28 -0700 (PDT)
In-Reply-To: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
From: Erwin Kalvelagen
Date: Thu, 3 May 2012 10:08:28 -0400
X-Google-Sender-Auth: a1dXr6XPe5t5IBSBlEpBJb7RcEo
Message-ID:
To: Zvonko Bregar
Content-Type: multipart/alternative; boundary=f46d04182570bf258a04bf225748
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 74.125.82.49
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 03 May 2012 14:09:07 -0000
--f46d04182570bf258a04bf225748
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
z >=3D x
z >=3D y
z <=3D x+y
----------------------------------------------------------------
Erwin Kalvelagen
Amsterdam Optimization Modeling Group
erwin@amsterdamoptimization.com
http://amsterdamoptimization.com
----------------------------------------------------------------
On Thu, May 3, 2012 at 8:29 AM, Zvonko Bregar wrote=
:
> Hi,****
>
> My name is Zvonko.****
>
> I have a question regarding binary variables in GLPK.****
>
> Is it possible to implement a kind of a boolean addition to binary
> variables.****
>
> For example:****
>
> Let X, Y and Z be binary variables.****
>
> X and Y ara inputs, Z is a result.****
>
> X + Y =3D Z****
>
> Such that****
>
> 0 + 0 =3D 0****
>
> 0 + 1 =3D 1****
>
> 1 + 0 =3D 1****
>
> 1 + 1 =3D 1****
>
> So this would be sometning like a logical .OR. addition?****
>
> Many thanks****
>
> Regards****
>
> --Zvonko****
>
>
> OPOZORILO: To elektronsko sporo=E8ilo in vse njegove morebitne priloge la=
hko
> vsebujejo zaupne in/ali privilegirane informacije, ki so last
> Elektroin=B9tituta Milan Vidmar in so namenjene izklju=E8no naslovniku. =
=C8e ste
> sporo=E8ilo prejeli pomotoma zaradi napake v naslovu ali pri prenosu
> sporo=E8ila, Vas prosimo, da nas o tem obvestite s povratno po=B9to. V te=
m
> primeru vsebine prejetega sporo=E8ila ne smete uporabiti, kopirati, tiska=
ti,
> objaviti ali distribuirati, ampak ga morate takoj uni=E8iti.
>
> DISCLAIMER: This e-mail is for the intended recipient only. It contains
> proprietary information some or all of which may be legally privileged. I=
f
> 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
> Help-glpk@gnu.org
> https://lists.gnu.org/mailman/listinfo/help-glpk
>
>
--f46d04182570bf258a04bf225748
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

z >=3D x

__
--f46d04182570bf258a04bf225748--
From MAILER-DAEMON Thu May 03 23:07:43 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SQ8rv-0002v9-Mq
for mharc-help-glpk@gnu.org; Thu, 03 May 2012 23:07:43 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60684)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from __) id 1SQ8rn-0002uV-Q6
for help-glpk@gnu.org; Thu, 03 May 2012 23:07:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQ8rl-0000NJ-KX
for help-glpk@gnu.org; Thu, 03 May 2012 23:07:35 -0400
Received: from mail-pb0-f41.google.com ([209.85.160.41]:61767)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SQ8rl-0000NC-6q
for help-glpk@gnu.org; Thu, 03 May 2012 23:07:33 -0400
Received: by pbbrp2 with SMTP id rp2so3507264pbb.0
for ; Thu, 03 May 2012 20:07:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=references:in-reply-to:mime-version:content-transfer-encoding
:content-type:message-id:cc:x-mailer:from:subject:date:to;
bh=1g5r+YqoXq372MmEi/l8tdpnFTfq/z/HD762dbEfCW4=;
b=SR/fUqQxFpjAa7X6QIa+C+HNT2ZuFZge3HCR56s/MfXTVMr5EJ429ULKxNrnvTP/o3
cvPVbLWJPDRns5mxXe0f5KxNEA1kXJaQqYxLBhPWF4Mz1+ya9T0Fx4u+v3acO5pr7qw1
S2lRdvQvwhrAggaAlk8dJl06DPr9YtjBqR7hXKfNMOCQEhmi+Wv1krD6240ARocf8Wam
I3gNDy8QiykYLMTQx1oZC/elqz5TmyRQFEcsNEAW6j/JGyl1FWnpPtVJm3IK2IVdNWtR
VO6M7ZHcuHlikW4VFKpH+H8zvfbmIOogjW9Io1NZpI7oxevz9bsMBAjvSvIx//dfFmUk
JMLA==
Received: by 10.68.227.134 with SMTP id sa6mr13656681pbc.101.1336100850623;
Thu, 03 May 2012 20:07:30 -0700 (PDT)
Received: from [192.168.1.45] (99-27-203-84.lightspeed.irvnca.sbcglobal.net.
[99.27.203.84])
by mx.google.com with ESMTPS id pp8sm7149444pbb.21.2012.05.03.20.07.26
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 03 May 2012 20:07:28 -0700 (PDT)
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
In-Reply-To:
Mime-Version: 1.0 (1.0)
Content-Transfer-Encoding: 7bit
Content-Type: multipart/alternative;
boundary=Apple-Mail-7796C543-9124-4D5F-A0B6-6D2766D964C7
Message-Id: <3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
X-Mailer: iPhone Mail (9B176)
From: Yaron Kretchmer
Date: Thu, 3 May 2012 20:07:18 -0700
To: Erwin Kalvelagen
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 209.85.160.41
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Fri, 04 May 2012 03:07:42 -0000
--Apple-Mail-7796C543-9124-4D5F-A0B6-6D2766D964C7
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
Since the conversion from mathematical formulation to constraints is systema=
tic , could this be added to marhprog?
On May 3, 2012, at 7:08, Erwin Kalvelagen w=
rote:
>=20
> z >=3D x
> z >=3D y
> z <=3D x+y
>=20
> ----------------------------------------------------------------
> Erwin Kalvelagen
> Amsterdam Optimization Modeling Group
> erwin@amsterdamoptimization.com
> http://amsterdamoptimization.com
> ----------------------------------------------------------------
>=20
>=20
> On Thu, May 3, 2012 at 8:29 AM, Zvonko Bregar wrot=
e:
> Hi,
>=20
> My name is Zvonko.
>=20
> I have a question regarding binary variables in GLPK.
>=20
> Is it possible to implement a kind of a boolean addition to binary variabl=
es.
>=20
> For example:
>=20
> Let X, Y and Z be binary variables.
>=20
> X and Y ara inputs, Z is a result.
>=20
> X + Y =3D Z
>=20
> Such that
>=20
> 0 + 0 =3D 0
>=20
> 0 + 1 =3D 1
>=20
> 1 + 0 =3D 1
>=20
> 1 + 1 =3D 1
>=20
> So this would be sometning like a logical .OR. addition?
>=20
> Many thanks
>=20
> Regards
>=20
> --Zvonko
>=20
>=20
> OPOZORILO: To elektronsko sporo=C4=8Dilo in vse njegove morebitne priloge l=
ahko vsebujejo zaupne in/ali privilegirane informacije, ki so last Elektroin=
=C5=A1tituta Milan Vidmar in so namenjene izklju=C4=8Dno naslovniku. =C4=8Ce=
ste sporo=C4=8Dilo prejeli pomotoma zaradi napake v naslovu ali pri prenosu=
sporo=C4=8Dila, Vas prosimo, da nas o tem obvestite s povratno po=C5=A1to. V=
tem primeru vsebine prejetega sporo=C4=8Dila ne smete uporabiti, kopirati, t=
iskati, objaviti ali distribuirati, ampak ga morate takoj uni=C4=8Diti.
>=20
> DISCLAIMER: This e-mail is for the intended recipient only. It contains pr=
oprietary 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.
> =20
>=20
>=20
> _______________________________________________
> Help-glpk mailing list
> Help-glpk@gnu.org
> https://lists.gnu.org/mailman/listinfo/help-glpk
>=20
>=20
> _______________________________________________
> Help-glpk mailing list
> Help-glpk@gnu.org
> https://lists.gnu.org/mailman/listinfo/help-glpk
--Apple-Mail-7796C543-9124-4D5F-A0B6-6D2766D964C7
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
__
____=
--Apple-Mail-7796C543-9124-4D5F-A0B6-6D2766D964C7--
From MAILER-DAEMON Fri May 04 00:08:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SQ9ob-0007th-90
for mharc-help-glpk@gnu.org; Fri, 04 May 2012 00:08:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60565)
by lists.gnu.org with esmtp (Exim 4.71) (envelope-from __)
id 1SQ9oY-0007tb-Tc
for help-glpk@gnu.org; Fri, 04 May 2012 00:08:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQ9oX-0006CL-0H
for help-glpk@gnu.org; Fri, 04 May 2012 00:08:18 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:34311)
by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1SQ9oW-0006CD-Sy
for help-glpk@gnu.org; Fri, 04 May 2012 00:08:16 -0400
Received: from ppp91-77-182-217.pppoe.mtu-net.ru ([91.77.182.217]:16213
helo=[192.168.1.34])
by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_ARCFOUR_MD5:16)
(Exim 4.71) (envelope-from )
id 1SQ9oV-0008Nz-6O; Fri, 04 May 2012 00:08:15 -0400
From: Andrew Makhorin
To: Yaron Kretchmer
In-Reply-To: <3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
Content-Type: text/plain
Date: Fri, 04 May 2012 08:13:10 +0400
Message-Id: <1336104790.2954.5.camel@corvax>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.3
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.10
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Fri, 04 May 2012 04:08:20 -0000
> Since the conversion from mathematical formulation to constraints is
> systematic , could this be added to marhprog?
No, it is not. There exist infinitely many mip descriptions of the same
integer set. Even z = x OR y can be formulated in infinitely many ways.
From MAILER-DAEMON Fri May 04 01:41:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SQBGp-0003oq-NJ
for mharc-help-glpk@gnu.org; Fri, 04 May 2012 01:41:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44261)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SQBGl-0003mU-U8
for help-glpk@gnu.org; Fri, 04 May 2012 01:41:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQBGj-0000On-VM
for help-glpk@gnu.org; Fri, 04 May 2012 01:41:31 -0400
Received: from mail-bk0-f41.google.com ([209.85.214.41]:39759)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1SQBGj-0000N4-M6; Fri, 04 May 2012 01:41:29 -0400
Received: by bkcjm19 with SMTP id jm19so2431777bkc.0
for ; Thu, 03 May 2012 22:41:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:cc:content-type;
bh=2wTJbmDBmTbMByggfxZsAFw4aIpjM9ggBi63O0vJtwY=;
b=VM0l+Sru8NivCOfExPiUUCVwYGAwjnAMCX02wtOfjrTogpBplPjG8lelEy+SdgLG4J
hjFeUmFqmgn2Pde0UZjEcJvN1XBS0LxqigDvSp8myaV4eoy8GYUdop5d2RXv3EWmmUGW
smz5h46ReUruE9O7mDbZX2PK91lwSUzaocEcjLd8bRPgsv9Be5t6SlZiCiE9gk/FpWkH
CxAXqqtx8IjKmkaGrcFQuVVrJrnZ7BWRQllgyJDDY1JZycFMqhZlQPff69EB07HlTj9g
Y1ExpUdY+GVFxbASSa1dcCvebU6gmyumLjsyyYVqVfTNlet9U2Df4GBPezT3izG9+2uU
F38g==
MIME-Version: 1.0
Received: by 10.204.149.208 with SMTP id u16mr1704955bkv.81.1336110086833;
Thu, 03 May 2012 22:41:26 -0700 (PDT)
Received: by 10.204.197.133 with HTTP; Thu, 3 May 2012 22:41:26 -0700 (PDT)
In-Reply-To: <1336104790.2954.5.camel@corvax>
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
<1336104790.2954.5.camel@corvax>
Date: Thu, 3 May 2012 22:41:26 -0700
Message-ID:
From: Yaron Kretchmer
To: Andrew Makhorin
Content-Type: multipart/alternative; boundary=0015175df0521b474004bf2f5f15
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 209.85.214.41
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Fri, 04 May 2012 05:41:33 -0000
--0015175df0521b474004bf2f5f15
Content-Type: text/plain; charset=UTF-8
Is there a default that can be applied? It seems that the boolean operator
question keeps being asked (infrequently) , and very similar answers
provided.
Starting with the z=x OR y example- it would be interesting to get several
different ways of implementing that, in addition to the one already
proposed.
On Thu, May 3, 2012 at 9:13 PM, Andrew Makhorin wrote:
>
> > Since the conversion from mathematical formulation to constraints is
> > systematic , could this be added to marhprog?
>
> No, it is not. There exist infinitely many mip descriptions of the same
> integer set. Even z = x OR y can be formulated in infinitely many ways.
>
>
--0015175df0521b474004bf2f5f15
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Is there a default that can be applied? It seems that the boolean operator =
question keeps being asked (infrequently) , and very similar answers provid=
ed.

Starting with the z=3Dx OR y example- it would be interesting to= get several different ways of implementing that, in addition to the one al= ready proposed.

--0015175df0521b474004bf2f5f15-- From MAILER-DAEMON Fri May 04 13:34:47 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SQMP1-00056B-In for mharc-help-glpk@gnu.org; Fri, 04 May 2012 13:34:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from) id 1SQMOy-000555-Ko
for help-glpk@gnu.org; Fri, 04 May 2012 13:34:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQMOx-0006PX-1y
for help-glpk@gnu.org; Fri, 04 May 2012 13:34:44 -0400
Received: from mail.cs.ndsu.nodak.edu ([134.129.125.92]:40329)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1SQMOr-0005HQ-2t; Fri, 04 May 2012 13:34:37 -0400
Received: from mail.cs.ndsu.nodak.edu (localhost [127.0.0.1])
by mail.cs.ndsu.NoDak.edu (8.14.2/8.14.2/Debian-2build1) with ESMTP id
q44HXXqN002715; Fri, 4 May 2012 12:33:34 -0500
Received: from localhost (hennebry@localhost)
by mail.cs.ndsu.nodak.edu (8.14.2/8.14.2/Submit) with ESMTP id
q44HXXfI002712; Fri, 4 May 2012 12:33:33 -0500
X-Authentication-Warning: mail.cs.ndsu.nodak.edu: hennebry owned process doing
-bs
Date: Fri, 4 May 2012 12:33:33 -0500 (CDT)
From: Michael Hennebry
X-X-Sender: hennebry@mail.cs.ndsu.nodak.edu
To: Andrew Makhorin
In-Reply-To: <1336104790.2954.5.camel@corvax>
Message-ID:
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
<1336104790.2954.5.camel@corvax>
User-Agent: Alpine 1.00 (DEB 882 2007-12-20)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 134.129.125.92
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Fri, 04 May 2012 17:34:45 -0000
On Fri, 4 May 2012, Andrew Makhorin wrote:
>
>> Since the conversion from mathematical formulation to constraints is
>> systematic , could this be added to marhprog?
>
> No, it is not. There exist infinitely many mip descriptions of the same
> integer set. Even z = x OR y can be formulated in infinitely many ways.
All the sensible ones are equivalent.
Even a function from two booleans to the reals will have a simple convex hull.
If full dimensional, the convex hull will be a tetrahedron.
If not, the function is linear.
More booleans would complicate matters.
The convex hull could still be achieved with
2**n additional continuous variables,
though making them binary would still be mathematically correct.
Without additional variables, one might have to sacrifice the convex hull,
but 2**(n+1) constraints would be sufficient
and could be systematically generated.
In this case, different systems might produce inequivalent constraints.
--
Michael hennebry@web.cs.ndsu.NoDak.edu
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily
From MAILER-DAEMON Sat May 05 04:33:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SQaQj-0001Kk-5Z
for mharc-help-glpk@gnu.org; Sat, 05 May 2012 04:33:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56139)
by lists.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1SQaQg-0001Ke-K7
for help-glpk@gnu.org; Sat, 05 May 2012 04:33:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQaQe-0008Oh-TO
for help-glpk@gnu.org; Sat, 05 May 2012 04:33:26 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:58378)
by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1SQaQe-0008Ob-Pw
for help-glpk@gnu.org; Sat, 05 May 2012 04:33:24 -0400
Received: from ppp91-77-213-235.pppoe.mtu-net.ru ([91.77.213.235]:21448
helo=[192.168.1.34])
by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_ARCFOUR_MD5:16)
(Exim 4.71) (envelope-from )
id 1SQaQd-0000MM-0m; Sat, 05 May 2012 04:33:23 -0400
From: Andrew Makhorin
To: Yaron Kretchmer
In-Reply-To:
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
<1336104790.2954.5.camel@corvax>
Content-Type: text/plain
Date: Sat, 05 May 2012 12:38:20 +0400
Message-Id: <1336207100.2964.11.camel@corvax>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.3
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.10
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sat, 05 May 2012 08:33:28 -0000
> Is there a default that can be applied? It seems that the boolean
> operator question keeps being asked (infrequently) , and very similar
> answers provided.
>
> Starting with the z=x OR y example- it would be interesting to get
> several different ways of implementing that, in addition to the one
> already proposed.
>
(All variables are assumed to be binary.)
1. Most natural description based on CNF (satisfiability)
Let
f(x,y,z): z = x OR y
is a Boolean function. Then its truth table is the following:
x y z f(x,y,z)
-----------------
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
We need to exclude the points at which f takes on the value false.
For example, f(0,0,1) = 0, so
NOT (x = 0 AND y = 0 AND z = 1) ==>
x = 1 OR y = 1 OR z = 0 ==>
x = 1 OR y = 1 OR (1 - z) ==>
x + y + (1 - z) >= 1
The complete description includes the following four inequalities:
x + y + (1 - z) >= 1
x + (1 - y) + z >= 1
(1 - x) + y + z >= 1
(1 - x) + (1 - y) + z >= 1
It is a good description, because it corresponds to the feasibility
problem.
2. Another description
0 <= 2 * z - x - y <= 1
3. Yet another description (as pointed out by Erwin and Michael)
z >= x
z >= y
z <= x+y
It is a good description, because all inequalities are facet-defined
(until the mip instance includes other constraints).
Below here are more examples:
Logical condition Description
-----------------------------------------------------------
z = NOT x z = 1 - x
x1 OR ... OR xn x1 + ... + xn >= 1
x IMPL y x <= y
z = x AND y 0 <= x + y - 2 * z <= 1
z = x1 AND ... AND xn 0 <= x1 + ... + xn - n * z <= n - 1
z = x OR y 0 <= 2 * z - x - y <= 1
z = x1 OR ... OR xn 0 <= n * z - x1 - ... - xn <= n - 1
z = x XOR y x + y = 2 * s + z, where s is binary
From MAILER-DAEMON Sat May 05 04:44:47 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SQabf-0002lx-PE
for mharc-help-glpk@gnu.org; Sat, 05 May 2012 04:44:47 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47096)
by lists.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1SQabd-0002lP-4D
for help-glpk@gnu.org; Sat, 05 May 2012 04:44:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQabb-0005CO-C1
for help-glpk@gnu.org; Sat, 05 May 2012 04:44:44 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:58580)
by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1SQabb-0005C0-94
for help-glpk@gnu.org; Sat, 05 May 2012 04:44:43 -0400
Received: from ppp91-77-213-235.pppoe.mtu-net.ru ([91.77.213.235]:21455
helo=[192.168.1.34])
by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_ARCFOUR_MD5:16)
(Exim 4.71) (envelope-from )
id 1SQabZ-0003MF-H7; Sat, 05 May 2012 04:44:41 -0400
From: Andrew Makhorin
To: Yaron Kretchmer
In-Reply-To:
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
<1336104790.2954.5.camel@corvax>
Content-Type: text/plain
Date: Sat, 05 May 2012 12:49:39 +0400
Message-Id: <1336207779.3729.6.camel@corvax>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.3
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.10
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sat, 05 May 2012 08:44:46 -0000
See also Tseitin's transformations:
http://en.wikipedia.org/wiki/Tseitin-Transformation
These transformations can be used to describe any Boolean function in a
more or less efficient way, in particular, to model any digital circuit
logic like adders, multipliers, dividers, etc.
The mip preprocessor implemented in glpk uses these transformations to
reduce the mip instance to the satisfiablity problem in order to find an
integer feasible solution with the Minisat solver (--minisat).
From MAILER-DAEMON Sat May 05 14:07:52 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SQjOa-0006Vc-9S
for mharc-help-glpk@gnu.org; Sat, 05 May 2012 14:07:52 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46807)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SQjOW-0006UB-Ri
for help-glpk@gnu.org; Sat, 05 May 2012 14:07:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQjOU-00066z-Pu
for help-glpk@gnu.org; Sat, 05 May 2012 14:07:48 -0400
Received: from mail-bk0-f41.google.com ([209.85.214.41]:43573)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1SQjOU-00066a-Gg; Sat, 05 May 2012 14:07:46 -0400
Received: by bkcjm19 with SMTP id jm19so3683758bkc.0
for ; Sat, 05 May 2012 11:07:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:cc:content-type;
bh=4ePY/e73pj0zrXJFk3tuaz/oAS+R12PhuKczOhgLy84=;
b=J8Ihj7X6/0TYMqmdfOJldgpN1BoJ6AA7xNnEpTFKp0tqia52HFv2kiW+D67fQhw7fb
XqphWzaTMiJT7VGsEKNZA2rJegWVJ84HL9AeR42hGmInKXiitRegnJYn8ZaIBwX2ZhLT
Xp30s8xJ1Wu1+wUwwQ7j4FvTWLb2ynCDXGjEBCxrdYvPYjLQXII3zcmXRuHK5ggmZMbS
X/W5wyFa4Qn7nYXfqzFG9JbEkhIpph3qtOTOpOnPGFF5aenB9QrWmAPIX9oPmKLqFuy3
1I+7ET7QQK6dUu8KTnXSb6D8xozSCSAmIL6ebRQPYd+CYK9Nxz+mZ2leTcOiVHnsDS7k
6MhA==
MIME-Version: 1.0
Received: by 10.205.129.8 with SMTP id hg8mr3606109bkc.25.1336241263170; Sat,
05 May 2012 11:07:43 -0700 (PDT)
Received: by 10.204.227.80 with HTTP; Sat, 5 May 2012 11:07:43 -0700 (PDT)
In-Reply-To: <1336207779.3729.6.camel@corvax>
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
<1336104790.2954.5.camel@corvax>
<1336207779.3729.6.camel@corvax>
Date: Sat, 5 May 2012 11:07:43 -0700
Message-ID:
From: Yaron Kretchmer
To: Andrew Makhorin
Content-Type: multipart/alternative; boundary=000e0ce0b8ded3532c04bf4de9a3
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 209.85.214.41
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sat, 05 May 2012 18:07:50 -0000
--000e0ce0b8ded3532c04bf4de9a3
Content-Type: text/plain; charset=UTF-8
Thanks Andrew.
Would it make sense then to incorporate Tseitin's transforms into mathprog
as a default method for implementing boolean conditions?
Thanks
Yaron
On Sat, May 5, 2012 at 1:49 AM, Andrew Makhorin wrote:
> See also Tseitin's transformations:
> http://en.wikipedia.org/wiki/Tseitin-Transformation
>
> These transformations can be used to describe any Boolean function in a
> more or less efficient way, in particular, to model any digital circuit
> logic like adders, multipliers, dividers, etc.
>
> The mip preprocessor implemented in glpk uses these transformations to
> reduce the mip instance to the satisfiablity problem in order to find an
> integer feasible solution with the Minisat solver (--minisat).
>
>
>
--000e0ce0b8ded3532c04bf4de9a3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Thanks Andrew.

Would it make sense then to incorporate Tseitin's tr= ansforms into mathprog as a default method for implementing boolean conditi= ons?

Thanks

Yaron

--000e0ce0b8ded3532c04bf4de9a3-- From MAILER-DAEMON Sat May 05 15:54:26 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SQl3i-0000kW-Q3 for mharc-help-glpk@gnu.org; Sat, 05 May 2012 15:54:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from)
id 1SQl3g-0000kO-Dy
for help-glpk@gnu.org; Sat, 05 May 2012 15:54:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQl3e-0007ig-Qf
for help-glpk@gnu.org; Sat, 05 May 2012 15:54:23 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:40322)
by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from )
id 1SQl3e-0007iS-N4
for help-glpk@gnu.org; Sat, 05 May 2012 15:54:22 -0400
Received: from ppp91-77-217-234.pppoe.mtu-net.ru ([91.77.217.234]:22147
helo=[192.168.1.34])
by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_ARCFOUR_MD5:16)
(Exim 4.71) (envelope-from )
id 1SQl3d-0003Yy-05; Sat, 05 May 2012 15:54:21 -0400
From: Andrew Makhorin
To: Yaron Kretchmer
In-Reply-To: <1336207100.2964.11.camel@corvax>
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
<1336104790.2954.5.camel@corvax>
<1336207100.2964.11.camel@corvax>
Content-Type: text/plain
Date: Sat, 05 May 2012 23:59:22 +0400
Message-Id: <1336247962.2955.5.camel@corvax>
Mime-Version: 1.0
X-Mailer: Evolution 2.6.3
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.10
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sat, 05 May 2012 19:54:25 -0000
> 3. Yet another description (as pointed out by Erwin and Michael)
>
> z >= x
>
> z >= y
>
> z <= x+y
>
> It is a good description, because all inequalities are facet-defined
> (until the mip instance includes other constraints).
>
This case is a CNF description, because
z >= x can be written as z + (1 - x) >= 1
z >= y can be written as z + (1 - y) >= 1
z <= x+y can be written as x + y + (1 - z) >= 1
so it is equivalent to the case 1, where one of the constriants is
redundant.
From MAILER-DAEMON Sun May 06 01:33:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SQu63-0002Oq-8a
for mharc-help-glpk@gnu.org; Sun, 06 May 2012 01:33:27 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58265)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SQu61-0002Oe-DH
for help-glpk@gnu.org; Sun, 06 May 2012 01:33:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SQu5z-0003oE-Om
for help-glpk@gnu.org; Sun, 06 May 2012 01:33:24 -0400
Received: from mail.cs.ndsu.nodak.edu ([134.129.125.92]:33699)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1SQu5w-0003nK-Sj; Sun, 06 May 2012 01:33:21 -0400
Received: from mail.cs.ndsu.nodak.edu (localhost [127.0.0.1])
by mail.cs.ndsu.NoDak.edu (8.14.2/8.14.2/Debian-2build1) with ESMTP id
q465XA13023200; Sun, 6 May 2012 00:33:11 -0500
Received: from localhost (hennebry@localhost)
by mail.cs.ndsu.nodak.edu (8.14.2/8.14.2/Submit) with ESMTP id
q465XAd0023197; Sun, 6 May 2012 00:33:10 -0500
X-Authentication-Warning: mail.cs.ndsu.nodak.edu: hennebry owned process doing
-bs
Date: Sun, 6 May 2012 00:33:10 -0500 (CDT)
From: Michael Hennebry
X-X-Sender: hennebry@mail.cs.ndsu.nodak.edu
To: Andrew Makhorin
In-Reply-To: <1336207100.2964.11.camel@corvax>
Message-ID:
References: <94CFC53F44B33041A7D49133F54DF168C5375EA5@mailix.eimv.si>
<3E2E1E81-95E1-4F07-8C31-5982D68C1725@gmail.com>
<1336104790.2954.5.camel@corvax>
<1336207100.2964.11.camel@corvax>
User-Agent: Alpine 1.00 (DEB 882 2007-12-20)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 134.129.125.92
Cc: "help-glpk@gnu.org"
Subject: Re: [Help-glpk] binary boolean
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sun, 06 May 2012 05:33:26 -0000
On Sat, 5 May 2012, Andrew Makhorin wrote:
> 3. Yet another description (as pointed out by Erwin and Michael)
>
> z >= x
>
> z >= y
>
> z <= x+y
>
> It is a good description, because all inequalities are facet-defined
> (until the mip instance includes other constraints).
Together with z<=1, it is *the* sensible description.
There are no other facets.
In general, { (x, y, f(x,y)) : (x, y) in {0, 1}**2 }
has precisely four facets.
Since their bounds are not facets, but are implied by facets,
it might be useful to require that x and y never be non-basic.
Likewise, z should not be non-basis at zero.
The situation is more complicated for larger numbers of variables.
--
Michael hennebry@web.cs.ndsu.NoDak.edu
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily
From MAILER-DAEMON Wed May 09 11:13:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SS8aP-0006BT-7J
for mharc-help-glpk@gnu.org; Wed, 09 May 2012 11:13:53 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33605)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SS8aH-0006Ar-Ut
for help-glpk@gnu.org; Wed, 09 May 2012 11:13:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SS8aC-0005gj-5h
for help-glpk@gnu.org; Wed, 09 May 2012 11:13:45 -0400
Received: from mail-pb0-f41.google.com ([209.85.160.41]:49715)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SS8aB-0005cY-Tr
for help-glpk@gnu.org; Wed, 09 May 2012 11:13:40 -0400
Received: by pbbrp2 with SMTP id rp2so704390pbb.0
for ; Wed, 09 May 2012 08:13:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:date:message-id:subject:from:to:content-type;
bh=ZWXmKGqOe4wr1018I0xXppqsW8H1S736ZPDje4dHe8I=;
b=0JBeShlXrPu7BKPyL3NjHa6pnIAstcbpnk/0bRuBqu9ncdduK7cq/CUK/S5SK85lsh
LEpGWXhbkQAhM82t5SBr7qoCjLWTFb04HQwhufGNpCmsFNfVf+UzZgwItkOHB7Bap83L
URr+al8wWNl/YLP9TZ2ONyObhpGgj0sCucNm3Y4pD92qWe8eksSZd3aE8nofLEW0LfxV
51Q1UEj3RmTPz+L63/eZDJwfo7T+0yv8Uw8rCG05C+A/LBFyWEhUbWRd71IiIMZR63s9
PLkoaI7tr2u2+IY7Ycf+/lgHPeFUwmktNPYetPsnYhEUo2Cx/DOYpAnfc/aQlYxvQpFP
Bsug==
MIME-Version: 1.0
Received: by 10.68.234.197 with SMTP id ug5mr9739037pbc.163.1336576416845;
Wed, 09 May 2012 08:13:36 -0700 (PDT)
Received: by 10.68.191.231 with HTTP; Wed, 9 May 2012 08:13:36 -0700 (PDT)
Date: Wed, 9 May 2012 17:13:36 +0200
Message-ID:
From: Tony Khosravi
To: help-glpk@gnu.org
Content-Type: multipart/alternative; boundary=047d7b33c9f48a8d8f04bf9bf224
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 209.85.160.41
Subject: [Help-glpk] Generate data section files for model (in GNU MathProg
or other languages)
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 09 May 2012 15:13:51 -0000
--047d7b33c9f48a8d8f04bf9bf224
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,
I would like to know if it was possible to generate any data files in the
GNU MathProg format with the GLPK lib.
When I am talking about data file, I mean the data section of model data.
The aim would be to be able to generate many text files containing only the
data section so that they can be used later with the solver and a file
containing only the model section. I didn't find any thing like that.
My thought is now to try to implement a general lib to generate sets or
parameters in a text file according to the documentation gmpl, but I was
wondering it this had been done before (which might be probable).
I also had the idea of using the table statement with the CSV driver, but
apparently, it cannot be used in the data section, only in the model
section, and I don't want to touch the file with the model. The aim is to
keep the data section separate from the model section.
--=20
*Tony Khosravi Dehkourdi*
MSc. Student - Computer Systems
*Link=F6ping University*
El=E8ve ing=E9nieur -- G=E9nie Informatique, Syst=E8mes et R=E9seaux d'Info=
rmations
(GI06)*
Universit=E9 de Technologie de Compi=E8gne*
Tel:+46 7 60 69 51 57
--047d7b33c9f48a8d8f04bf9bf224
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,

I would like to know if it was possible to generate any data fil= es in the GNU MathProg format with the GLPK lib.

When I am talking a= bout data file, I mean the data section of model data. The aim would be to = be able to generate many text files containing only the data section so tha= t they can be used later with the solver and a file containing only the mod= el section. I didn't find any thing like that.

My thought is now to try to implement a general lib to generate sets or= parameters in a text file according to the documentation gmpl, but I was w= ondering it this had been done before (which might be probable).

I also had the idea of using the table statement with the CSV driver, but a= pparently, it cannot be used in the data section, only in the model section= , and I don't want to touch the file with the model. The aim is to keep= the data section separate from the model section.

--

**Tony Khosravi Dehkourdi**

MSc. Student - Computer Systems

*Link=F6ping University*

El=E8ve ing=E9nieur -- G=E9nie Informatique, Syst=E8mes et R=E9seaux d'= Informations (GI06)

Universit=E9 de Technologie de Compi=E8gne

Tel:+46 7 60 69 51 57

--047d7b33c9f48a8d8f04bf9bf224-- From MAILER-DAEMON Wed May 09 13:04:30 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SSAJS-0003Jn-KW for mharc-help-glpk@gnu.org; Wed, 09 May 2012 13:04:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from) id 1SSAJP-0003Ii-G8
for help-glpk@gnu.org; Wed, 09 May 2012 13:04:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SSAJN-0004yl-8w
for help-glpk@gnu.org; Wed, 09 May 2012 13:04:27 -0400
Received: from metalhawk.actrix.co.nz ([203.96.16.180]:50326)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SSAJM-0004xJ-Ub
for help-glpk@gnu.org; Wed, 09 May 2012 13:04:25 -0400
Received: from my.actrix.co.nz (troy.actrix.co.nz [203.96.16.120])
by metalhawk.actrix.co.nz (Postfix) with ESMTP id 2A595D2ED3;
Thu, 10 May 2012 05:04:18 +1200 (NZST)
Received: from 78.52.197.71 (SquirrelMail authenticated user robbie)
by my.actrix.co.nz with HTTP; Thu, 10 May 2012 05:04:18 +1200
Message-ID: <710133673f8b06295a141019ebe080ac.squirrel@my.actrix.co.nz>
Date: Thu, 10 May 2012 05:04:18 +1200
From: "Robbie Morrison"
To: "GLPK help"
User-Agent: SquirrelMail/1.4.22
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
X-Priority: 3 (Normal)
Importance: Normal
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 203.96.16.180
Subject: Re: [Help-glpk] Generate data section files for model (in GNU
MathProg or other languages)
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: Robbie Morrison
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 09 May 2012 17:04:29 -0000
Hello Tony
------------------------------------------------------------
To: help-glpk@gnu.org
Subject: [Help-glpk] Generate data section files for model (in GNU
MathProg or other languages)
From: Tony Khosravi
Date: Wed, 9 May 2012 17:13:36 +0200
------------------------------------------------------------
> Hi,
>
> I would like to know if it was possible to generate any
> data files in the GNU MathProg format with the GLPK
> lib.
>
> When I am talking about data file, I mean the data
> section of model data. The aim would be to be able to
> generate many text files containing only the data
> section so that they can be used later with the solver
> and a file containing only the model section. I didn't
> find any thing like that.
>
> My thought is now to try to implement a general lib to
> generate sets or parameters in a text file according to
> the documentation gmpl, but I was wondering it this had
> been done before (which might be probable).
>
> I also had the idea of using the table statement with
> the CSV driver, but apparently, it cannot be used in
> the data section, only in the model section, and I
> don't want to touch the file with the model. The aim is
> to keep the data section separate from the model
> section.
>
> --
> *Tony Khosravi Dehkourdi*
>
> MSc. Student - Computer Systems
> *Link?ping University*
> El?ve ing?nieur -- G?nie Informatique, Syst?mes et R?seaux d'Informatio=
ns
> (GI06)*
> Universit? de Technologie de Compi?gne*
> Tel:+46 7 60 69 51 57
Hello Tony
AFAIK, once your high-level MathProg model has been
translated into a low-level problem object, it is not
possible to detranslate it.
So I guess you are talking about doing this processing
before your MathProg model + data has been irrevocably
translated.
You may therefore need to do this work outside of GLPK?
That is my best guess anyway.
These links might be useful while thinking about your
problem:
http://en.wikibooks.org/wiki/GLPK/Steps_of_GMPL_File_Processing
http://en.wikibooks.org/wiki/GLPK/Interoperability
http://en.wikibooks.org/wiki/GLPK/Scripting_plus_MathProg
best regards
---
Robbie Morrison
PhD student -- policy-oriented energy system simulation
Technical University of Berlin (TU-Berlin), Germany
University email (redirected) : morrison@iet.tu-berlin.de
Webmail (preferred) : robbie@actrix.co.nz
[from Webmail client]
From MAILER-DAEMON Wed May 09 14:06:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
id 1SSBHR-0007p4-Fg
for mharc-help-glpk@gnu.org; Wed, 09 May 2012 14:06:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52150)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SSBHI-0007hB-RX
for help-glpk@gnu.org; Wed, 09 May 2012 14:06:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1SSBHC-0007Vm-7f
for help-glpk@gnu.org; Wed, 09 May 2012 14:06:20 -0400
Received: from mail-pz0-f41.google.com ([209.85.210.41]:45154)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1SSBHB-0007VR-QW
for help-glpk@gnu.org; Wed, 09 May 2012 14:06:14 -0400
Received: by dakp5 with SMTP id p5so705039dak.0
for ; Wed, 09 May 2012 11:06:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:cc:content-type;
bh=drkTF4upY4/0zC+3vpnwPWkIBdr7Kr9TQnzfcng8kM4=;
b=KS47g0MAqyEZJkDYK+61oY42nKt0uAyiRi2NHVkHlLha1vtHK4O68M2ijSz6GAgixo
EgkFJZ5+XJj+5d9FWMlgAbxHpU7usHJvf5ucPpGAQCqwxm/gG+EW2KfJGtnXBS+nllW+
S19ToR6FbOKXXhdiUzMnfOxCpjsY9uMQ4Xe38Dixw+ohFEqZCkKMQiepfMJPDVjC6N88
5kQJDie9C100sxF5U3ULYTStZwlzhMLb1A283N+DxFinYxAuB4sIwFstkCt7cw1NBXFN
lmDWV4omJYj7H2x9xdwTkQbv5xDOGrtit7lfBq0+KVTL4oR59HQ0wAbOCnkzADjogYEW
0edQ==
MIME-Version: 1.0
Received: by 10.68.213.167 with SMTP id nt7mr11520881pbc.100.1336586771494;
Wed, 09 May 2012 11:06:11 -0700 (PDT)
Received: by 10.68.191.231 with HTTP; Wed, 9 May 2012 11:06:11 -0700 (PDT)
In-Reply-To: <710133673f8b06295a141019ebe080ac.squirrel@my.actrix.co.nz>
References: <710133673f8b06295a141019ebe080ac.squirrel@my.actrix.co.nz>
Date: Wed, 9 May 2012 20:06:11 +0200
Message-ID:
From: Tony Khosravi
To: Robbie Morrison
Content-Type: multipart/alternative; boundary=e89a8ff1c6e4b9f84304bf9e5b4a
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 209.85.210.41
Cc: GLPK help
Subject: Re: [Help-glpk] Generate data section files for model (in GNU
MathProg or other languages)
X-BeenThere: help-glpk@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Users list for GLPK \(GNU Linear Programming Kit\)"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 09 May 2012 18:06:27 -0000
--e89a8ff1c6e4b9f84304bf9e5b4a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Thank you for the answer Robbie,
2012/5/9 Robbie Morrison
>
> Hello Tony
>
> ------------------------------------------------------------
> To: help-glpk@gnu.org
> Subject: [Help-glpk] Generate data section files for model (in GNU
> MathProg or other languages)
> From: Tony Khosravi
> Date: Wed, 9 May 2012 17:13:36 +0200
> ------------------------------------------------------------
>
> > Hi,
> >
> > I would like to know if it was possible to generate any
> > data files in the GNU MathProg format with the GLPK
> > lib.
> >
> > When I am talking about data file, I mean the data
> > section of model data. The aim would be to be able to
> > generate many text files containing only the data
> > section so that they can be used later with the solver
> > and a file containing only the model section. I didn't
> > find any thing like that.
> >
> > My thought is now to try to implement a general lib to
> > generate sets or parameters in a text file according to
> > the documentation gmpl, but I was wondering it this had
> > been done before (which might be probable).
> >
> > I also had the idea of using the table statement with
> > the CSV driver, but apparently, it cannot be used in
> > the data section, only in the model section, and I
> > don't want to touch the file with the model. The aim is
> > to keep the data section separate from the model
> > section.
> >
> > --
> > *Tony Khosravi Dehkourdi*
> >
> > MSc. Student - Computer Systems
> > *Link?ping University*
> > El?ve ing?nieur -- G?nie Informatique, Syst?mes et R?seaux d'Informatio=
ns
> > (GI06)*
> > Universit? de Technologie de Compi?gne*
> > Tel:+46 7 60 69 51 57
>
> Hello Tony
>
> AFAIK, once your high-level MathProg model has been
> translated into a low-level problem object, it is not
> possible to detranslate it.
>
> So I guess you are talking about doing this processing
> before your MathProg model + data has been irrevocably
> translated.
>
> You may therefore need to do this work outside of GLPK?
> That is my best guess anyway.
>
> These links might be useful while thinking about your
> problem:
>
> http://en.wikibooks.org/wiki/GLPK/Steps_of_GMPL_File_Processing
> http://en.wikibooks.org/wiki/GLPK/Interoperability
> http://en.wikibooks.org/wiki/GLPK/Scripting_plus_MathProg
>
> best regards
> ---
> Robbie Morrison
> PhD student -- policy-oriented energy system simulation
> Technical University of Berlin (TU-Berlin), Germany
> University email (redirected) : morrison@iet.tu-berlin.de
> Webmail (preferred) : robbie@actrix.co.nz
> [from Webmail client]
>
>
>
I would say that the last link is partially the answer to my question.
I will try to explain better what I want to do.
So as I said, I would like to generate a file containing only data section
through a program in a way that I can generate many of those data files
through a program, and then run the GLPK solver on each data file according
to a model. So you understand that the data section and the model section
are in two different files.
I think I need to say that I program in C++.
Let's say that my program is split into three modules:
- one which generates data (the nature of those data are not important)
through N iterations
- one which would store those data into N files (data section in a text
file)
- one which read those data files one by one and run the solver (given a
file which contains the model section)
The first and third modules are implemented, so I am interested in
implementing the second one.
In fact, the aim is not to have a very flexible program since to be able to
generate the data files, it (I) need to know the model.
Let's say that my first module generate a matrix. With this matrix, I want
to compute different things which would corresponds to some parameters
needed for the model. Therefore, I would like to store them in file. In
order to have something a bit flexible, I was wondering if there was some
methods available in GLPK or in another library which could perform those
action like a method called "toGMPLParam(name, defaultValue,
listOfRecords)"
which would give in a file in the GMPL format
param name default defaultValue record1, record2, ..., recordsN
It is still unclear I think so I will try to explain with an example as
follow:
I have this "program" in whatever-the-language
/* myprog.cpp */
begin
// Here I generate some data that I store in a matrix
var myMatrix <- generateData
// Here I perform some operations on this matrix
var var1 <- action1(myMatrix)
var var2 <- action2(myMatrix)
// Here is the part I am interested in
fileOpen("mydata.dat")
f <- toGMPLParam("var1", 0, var1)
f <- toGMPLParam("var2", 0, var2)
// I run this file with the solver and a .mod file
var optimalSolution <- solve("mydata.dat", "mymodel.mod")
end
/* eof */
I am aware of the fact that I could implement a way of just writing those
data in a file, trying to respect the MathProg format (as long as it is
modular, I would be satisfied), but maybe GLPK or another lib provides such
methods that would generate a file with the proper syntax used in MathProg
given some parameters.
Best regards
--=20
*Tony Khosravi Dehkourdi*
MSc. Student - Computer Systems
*Link=F6ping University*
El=E8ve ing=E9nieur -- G=E9nie Informatique, Syst=E8mes et R=E9seaux d'Info=
rmations
(GI06)*
Universit=E9 de Technologie de Compi=E8gne*
Tel:+46 7 60 69 51 57
--e89a8ff1c6e4b9f84304bf9e5b4a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Thank you for the answer Robbie,

The x represen=
t a percentage of p that I need, and this means that y is <=3D to w.

So summing up:

x will alwa=
ys be <=3D to p.

y will always be <=3D to w.

if w is 0, then so =
are y.

=
p is a constant.

x,y and w are variables.

y and w are in the =
range [0..6] (or close to that)

and I want to calculate:

x_suj =3D p_s * (y_suj/w_su)

Sorry for the mess, hope this=A0clarifies=A0it.<=
/font>

Best =
regards,

Kasper

On Wed, May 2, 2=
012 at 9:03 AM, Kasper Tordrup <ktordrup@gmail.com> wrote:<=
br>

Hi guysHowever I can tell you that the range of y and w are both [0..6] maybe a li= ttle higher. And if w is 0, then so are y.

Thanks for all the answers, I haven't had much time to look at them.Maybe this helps a litt= le.

Best regards,

Kasper

On Apr 29, 2012 5:23 AM, "= ;Michael Hennebry" <hennebry@web.cs.ndsu.nodak.edu> wrote:

Divisiblilty can be used to reduce the problem somewhat.

On Fri, 27 Apr 2012, Michael Hennebry wrote:

# Solve

# x =3D p * y / w

# w * pd * x =3D pn * y

# where x, y, w are natural numbers and

# p =3D 11 / 17

# pn =3D 11

# pd =3D 17

# x in [23, 100]

# y in [10, 200]

# w in [3, 7]

# Since pn/pd is in lowest terms, y must be a multiple of pd.

param w_min :=3D 3;

param w_max :=3D 7;

param pn :=3D 11;

param pd :=3D 17;

set I :=3D {w_min..w_max};

var w{I}, binary;

var y, integer, >=3D 10, <=3D 200;

var x, integer, >=3D 23, <=3D 100;

var ypd, integer, >=3D 10/pd, <=3D 200/pd

# =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 =A0 =A0 =A0 =A0 11

s.t. y_formula :

=A0 =A0y =3D ypd*pd;

s.t. lb{i in I} :=A0 =A0 i =A0 * =A0 =A0x >=3D pn*ypd - (1-w[i]) * (pn*11 -i* =A0 23);

=A0 i * pd * x >=3D pn * y - (1-w[i]) * (pn*200-i*pd*23);

s.t. ub{i in I} :=A0 =A0 i =A0 * =A0 =A0x <=3D pn*ypd + (1-w[i]) * (i * =A0100-pn =A0 );=

=A0 i * pd * x <=3D pn * y + (1-w[i]) * (i*pd*100-pn*10);

s.t. sm :

=A0 sum{i in I} w[i] =3D 1;

solve;

printf "x =3D %f\ny =3D %f\nw =3D %f\n", x, y, sum{i in I} w[i] *= i;

end;

--

Michael =A0 hennebry@web.cs.ndsu.NoDak.edu

"On Monday, I'm gonna have to tell my kindergarten class,

whom I teach not to run with scissors,

that my fiance ran me through with a broadsword." =A0-- =A0Lily

IMADA @ University of Southern Denmark

KTordrup@gmail.com<= /a> - +45 27 44 58 49

---------- Forwa=
rded message ----------

From:**Kasper Tordr=
up** <ktordrup=
@gmail.com>

Date: Wed, May 2, 2012 at 7:41 PM

Subject: Re: [Help-glpk] fraction with= vars

To: Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu>

From:

Date: Wed, May 2, 2012 at 7:41 PM

Subject: Re: [Help-glpk] fraction with= vars

To: Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu>

On Wed, May 2, 2012 at 6:36 PM, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:

On Wed, 2 May 2012, Kasper Tordrup wrot= e:(repeating)

After looking over Xypron's example, it became clear to me that you lac= k

some information, sorry for that.

The x represent a percentage of p that I need, and this means that y is <= ;=3D

to w.

So summing up:

x will always be <=3D to p.

y will always be <=3D to w.

if w is 0, then so are y.

p is a constant.

x,y and w are variables.

y and w are in the range [0..6] (or close to that)

and I want to calculate:

x_suj =3D p_s * (y_suj/w_su)

x_suj * w_su =3D p_s * y_suj

if w is 0, then so are y.

No division issues.

(repeating)Are you sure?

The x represent a percentage of p that I need, and this means that y is <= ;=3D

to w.

I might be using the wr=
ong words, x is NOT a percentage number (0..100 or 0..1) it is a fraction o=
f p i.e. 2/3 or p.

=A0

Actually, 'tis a bit foggier now.

Sorry for the mess, hope this clarifies it.

What is p? Can it be 22/7, 7/22, sqrt(2.), 1/123, pi?

=

No, p is integer.

=A0

Is the equality exact?<= div>

Why is there a percentage involved instead of a fraction?

Sorry, x is a fraction of p.

=A0

One does not normally calculate with percentages.

Usually, percentages are just human-friendly input or output.<= /div>

--

Michael =A0 hennebry@web.cs.ndsu.NoDak.edu

"On Monday, I'm gonna have to tell my kindergarten class,

whom I teach not to run with scissors,

that my fiance ran me through with a broadsword." =A0-- =A0Lily

So, as an example p=3D1000, y=3D1 and w=3D3 and so I want to find x=3D=
333.3333

Does this make it a bit more clear?

IMADA @ University= of Southern Denmark

KTordrup@gmail.com<= /a> - +45 27 44 58 49

--bcaec517ac9c85d9a504bf11394c-- From MAILER-DAEMON Wed May 02 20:40:37 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SPk61-0004Nx-Jq for mharc-help-glpk@gnu.org; Wed, 02 May 2012 20:40:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from

Best regards,

Kasper

On T=
hu, May 3, 2012 at 2:40 AM, Michael Hennebry <hennebry@web.c=
s.ndsu.nodak.edu> wrote:

On Wed, 2 May 2012, Kasper= Tordrup wrote:

Yes.So, as an example p=3D1000, y=3D1 and w=3D3 and so I want to find x=3D333.3= 333

Does this make it a bit more clear?

w and y are arrays of non-negative integer variables.

p is a vector of positive integers.

x is an array of continous variables.

If w_su is zero, then y_suj are zero and x_suj may be anything.w_su =3D SUM k*q_suk

x_suj * w_su =3D p_s * y_suj

=A0 =A0 =A0 =A0k

q_suk binary

SUM q_suk =3D 1

=A0k

small-M method, M's are G's and L's.

q_suk =3D 1 -->

=A0 =A0x_suj * k >=3D p_s * y_suj

=A0 =A0x_suj * k <=3D p_s * y_suj

The constraints will be:

x_suj * k + G_sujk * (1-q_suk) >=3D p_s * y_suj

x_suj * k =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<=3D p_s * y_suj + = L_sujk * (1-q_suk)

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 for all s, u, j, k

Regardless of the values of the G's and L's,

those constraints for which =A0q_suk=3D1 are valid.

The G's and L's need to be selected big enough to be valid if q_suk= =3D0.

x_suj * k + G_sujk * (1-q_suk) >=3D p_s * y_suj

G_sujk * (1-q_suk) >=3D p_s * y_suj - x_suj * k =A0 =A0 for all s, u, j,= k

G_sujk * (1-q_suk) >=3D p_s * y_suj * (1-k/w_su) =A0 =A0for all s, u, j,= k

It is sufficient that

G_sujk =3D=3D p_s*max(y_suj)*(1-k/max(w_su)) =3D=3D p_s*(max(w_su)-k),

assuming y_suj and w_su have the same range.

For k=3D=3Dmax(w_su), w_su<=3Dk-1 and it is sufficient that

G_sujk =3D=3D -p_s

Likewise

L_sujk * (1-q_suk) >=3D p_s * y_suj * (k/w_su-1) =A0 for all s, u, j, k<= br>

It is sufficient that

L_sujk =3D=3D p_s*max(y_suj*(k/w_su-1))

=A0 =A0 =A0 =3D=3D p_s*max(y_suj*(k/y_suj-1)) =A0 assuming a common range<= br> =A0 =A0 =A0 =3D=3D p_s*max(k-y_suj)

=A0 =A0 =A0 =3D=3D p_s*k =A0 =A0 assuming y_suj has lower bound of zero

--

Michael =A0 hennebry@web.cs.ndsu.NoDak.edu

"On Monday, I'm gonna have to tell my kindergarten class,

whom I teach not to run with scissors,

that my fiance ran me through with a broadsword." =A0-- =A0Lily

=

IMADA @ University of Southern Denmark

KTordrup@gmail.com<= /a> - +45 27 44 58 49

Hi,

My name is Zvonko.

I have a question regarding binary variables in GLPK=
.

Is it possible to implement a kind of a boolean addi=
tion to binary variables.

For example:

Let X, Y and Z be binary variables.

X and Y ara inputs, Z is a result.

X + Y =3D Z

Such that

0 + 0 =3D 0

0 + 1 =3D 1

1 + 0 =3D 1

1 + 1 =3D 1

So this would be sometning like a logical .OR. addit=
ion?

Many thanks

Regards

--Zvonko

OPOZORILO: To elektronsko sporočilo in vse njegove morebitne priloge l=
ahko vsebujejo zaupne in/ali privilegirane informacije, ki so last Elektroi=
nštituta Milan Vidmar in so namenjene izključno naslovniku. Č=
;e ste sporočilo prejeli pomotoma zaradi napake v naslovu
ali pri prenosu sporočila, Vas prosimo, da nas o tem obvestite s povr=
atno pošto. V tem primeru vsebine prejetega sporočila ne smete up=
orabiti, kopirati, tiskati, objaviti ali distribuirati, ampak ga morate tak=
oj uničiti.

DISCLAIMER: This e-mail is for the intended recipient only. It contains pro=
prietary 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-mai=
l. Consequently, the contents of
this e-mail must be deleted and not be used, copied, printed, disclosed or=
distributed.

z >=3D y

z <=3D x+y

-----=
-----------------------------------------------------------

Erwin Kalvel= agen

Amsterdam Optimization Modeling Group

erwin@amsterdamoptimization.com

<= a href=3D"http://amsterdamoptimization.com" target=3D"_blank">http://amster= damoptimization.com

----------------------------------------------------------------

Erwin Kalvel= agen

Amsterdam Optimization Modeling Group

erwin@amsterdamoptimization.com

<= a href=3D"http://amsterdamoptimization.com" target=3D"_blank">http://amster= damoptimization.com

----------------------------------------------------------------

On Thu, May 3, 2012 at 8:29 AM, Zvonko B=
regar <Zvonko.Bregar@eimv.si> wrote:

Hi,

My name is Zvonko.

I have a question regarding binary variables in GLPK= .

Is it possible to implement a kind of a boolean addi= tion to binary variables.

For example:

Let X, Y and Z be binary variables.

X and Y ara inputs, Z is a result.

X + Y =3D Z

Such that

0 + 0 =3D 0

0 + 1 =3D 1

1 + 0 =3D 1

1 + 1 =3D 1

So this would be sometning like a logical .OR. addit= ion?

Many thanks

Regards

--Zvonko

OPOZORILO: To elektronsko sporo=E8ilo in vse njegove morebitne priloge lahk= o vsebujejo zaupne in/ali privilegirane informacije, ki so last Elektroin= =B9tituta Milan Vidmar in so namenjene izklju=E8no naslovniku. =C8e ste spo= ro=E8ilo prejeli pomotoma zaradi napake v naslovu ali pri prenosu sporo=E8ila, Vas prosimo, da nas o tem obvestite s povratn= o po=B9to. V tem primeru vsebine prejetega sporo=E8ila ne smete uporabiti, = kopirati, tiskati, objaviti ali distribuirati, ampak ga morate takoj uni=E8= iti.

DISCLAIMER: This e-mail is for the intended recipient only. It contains pro= prietary 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-mai= l. Consequently, the contents of this e-mail must be deleted and not be used, copied, printed, disclosed or= distributed.

=A0

_______________________________________________

Help-glpk mailing list

Help-glpk@gnu.org

https://lists.gnu.org/mailman/listinfo/help-glpk

Since the conversion from m=
athematical formulation to constraints is systematic , could this be added t=
o marhprog?

On May 3, 2012, at 7:08, Erwin Kalvelagen <erwin@amsterdamoptimization.com&= gt; wrote:

On May 3, 2012, at 7:08, Erwin Kalvelagen <erwin@amsterdamoptimization.com&= gt; wrote:

z >=3D xz >=3D yz <=3D x+y<= div>----= ------------------------------------------------------------

Erwin Kalvel= agen

Amsterdam Optimization Modeling Group

erwin@amsterdamoptimization.com

http://amsterdamo= ptimization.com

----------------------------------------------------------------

On Thu, May 3, 2012 at 8:29 AM, Zvonko Br= egar <Zvonko.Bregar@eimv.si> wrote:Hi,

My name is Zvonko.

I have a question regarding binary variables in GLPK.=

Is it possible to implement a kind of a boolean addit= ion to binary variables.

For example:

Let X, Y and Z be binary variables.

=X and Y ara inputs, Z is a result.

X + Y =3D Z

Such that

0 + 0 =3D 0

0 + 1 =3D 1

1 + 0 =3D 1

1 + 1 =3D 1

So this would be sometning like a logical .OR. additi= on?

Many thanks

Regards

--Zvonko

OPOZORILO: To elektronsko sporo=C4=8Dilo in vse njegove morebitne priloge la= hko vsebujejo zaupne in/ali privilegirane informacije, ki so last Elektroin=C5= =A1tituta Milan Vidmar in so namenjene izklju=C4=8Dno naslovniku. =C4=8Ce st= e sporo=C4=8Dilo prejeli pomotoma zaradi napake v naslovu ali pri prenosu sporo=C4=8Dila, Vas prosimo, da nas o tem obvestite s povra= tno po=C5=A1to. V tem primeru vsebine prejetega sporo=C4=8Dila ne smete upor= abiti, kopirati, tiskati, objaviti ali distribuirati, ampak ga morate takoj u= ni=C4=8Diti.

DISCLAIMER: This e-mail is for the intended recipient only. It contains prop= rietary information some or all of which may be legally privileged. If you r= eceived this e-mail by mistake please notify us by replying to this e-mail. C= onsequently, the contents of this e-mail must be deleted and not be used, copied, printed, disclosed or d= istributed.

_______________________________________________

Help-glpk mailing list

Help-glpk@gnu.org

https://lists.gnu.org/mailman/listinfo/help-glpk

____________________= ___________________________

Help-glpk mailing list

Help-glpk@gnu.org

= https://l= ists.gnu.org/mailman/listinfo/help-glpk

Starting with the z=3Dx OR y example- it would be interesting to= get several different ways of implementing that, in addition to the one al= ready proposed.

On Thu, May 3, 2012 at 9:13 PM, =
Andrew Makhorin <mao@gnu.org> wrote:

No, it is not. There exist infinitely many mip descriptions of the sa= me

> Since the conversion from mathematical formulation to constraints is> =C2=A0systematic , could this be added to marhprog?

integer set. Even z =3D x OR y can be formulated in infinitely many ways.

--0015175df0521b474004bf2f5f15-- From MAILER-DAEMON Fri May 04 13:34:47 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SQMP1-00056B-In for mharc-help-glpk@gnu.org; Fri, 04 May 2012 13:34:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from

Would it make sense then to incorporate Tseitin's tr= ansforms into mathprog as a default method for implementing boolean conditi= ons?

Thanks

Yaron

On Sat, May 5=
, 2012 at 1:49 AM, Andrew Makhorin <mao@gnu.org> wrote:

See also Tseitin's transformations:

http://en.wikipedia.org/wiki/Tseitin-Transformation

These transformations can be used to describe any Boolean function in a

more or less efficient way, in particular, to model any digital circuit

logic like adders, multipliers, dividers, etc.

The mip preprocessor implemented in glpk uses these transformations to

reduce the mip instance to the satisfiablity problem in order to find an

integer feasible solution with the Minisat solver (--minisat).

--000e0ce0b8ded3532c04bf4de9a3-- From MAILER-DAEMON Sat May 05 15:54:26 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SQl3i-0000kW-Q3 for mharc-help-glpk@gnu.org; Sat, 05 May 2012 15:54:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from

I would like to know if it was possible to generate any data fil= es in the GNU MathProg format with the GLPK lib.

When I am talking a= bout data file, I mean the data section of model data. The aim would be to = be able to generate many text files containing only the data section so tha= t they can be used later with the solver and a file containing only the mod= el section. I didn't find any thing like that.

My thought is now to try to implement a general lib to generate sets or= parameters in a text file according to the documentation gmpl, but I was w= ondering it this had been done before (which might be probable).

I also had the idea of using the table statement with the CSV driver, but a= pparently, it cannot be used in the data section, only in the model section= , and I don't want to touch the file with the model. The aim is to keep= the data section separate from the model section.

--

MSc. Student - Computer Systems

El=E8ve ing=E9nieur -- G=E9nie Informatique, Syst=E8mes et R=E9seaux d'= Informations (GI06)

Universit=E9 de Technologie de Compi=E8gne

Tel:+46 7 60 69 51 57

--047d7b33c9f48a8d8f04bf9bf224-- From MAILER-DAEMON Wed May 09 13:04:30 2012 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SSAJS-0003Jn-KW for mharc-help-glpk@gnu.org; Wed, 09 May 2012 13:04:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from

2012/5/9=
Robbie Morrison