[R] Linear programming question

2007-07-18 Thread Tobias Schlottmann
 Hi everybody,
  consider please an optimization problem:  
   
  minimize   sum S1+S2
   
  Subject to :  y - x = A + S1
 x - y = A + S2
   
  and we want to add two more constraints:
   
   y - x = B - S3
   x - y = B - S4
   
  where A is a small constant value and B is a large constant value, S1 and S2 
are surplus and S3 and S4 are slack variables.
   
  S3 and S4 have to be maximized in objective function. As objective function, 
is this correct?  :
   
  minimize sum S1+ S2 - S3 -S4
   
  where actually we want to minimize S1 and S2; and maximize S3 and S4.
   
  If it is not correct, what to do ?
   
  Thank you for any guide.
   
  Tobias

 
-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Linear programming question

2007-07-18 Thread Ravi Varadhan
Tobias,

Adding the first constraints yields:
S1 + S2 = -2A

Similarly adding the second set of constraints:
S3 + S4 = 2B

If A and B are positive (which you didn't specify) then
The minimum of S1+S2 is -2A, and the maximum of S3+S4 is 2B.

Thus, the minimum of S1+S2-S3-S4 is -2(A+B).  

Ravi. 


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tobias Schlottmann
Sent: Wednesday, July 18, 2007 1:24 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Linear programming question

 Hi everybody,
  consider please an optimization problem:  
   
  minimize   sum S1+S2
   
  Subject to :  y - x = A + S1
 x - y = A + S2
   
  and we want to add two more constraints:
   
   y - x = B - S3
   x - y = B - S4
   
  where A is a small constant value and B is a large constant value, S1 and
S2 are surplus and S3 and S4 are slack variables.
   
  S3 and S4 have to be maximized in objective function. As objective
function, is this correct?  :
   
  minimize sum S1+ S2 - S3 -S4
   
  where actually we want to minimize S1 and S2; and maximize S3 and S4.
   
  If it is not correct, what to do ?
   
  Thank you for any guide.
   
  Tobias

 
-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Linear programming question

2007-07-18 Thread Ravi Varadhan
Tobias,

Just a clarification/correction to my solution: it makes no difference
whether A and B are positive or negative.  The minimum of S1+S2-S3-S4 is
always -2(A+B).

Ravi.


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ravi Varadhan
Sent: Wednesday, July 18, 2007 1:52 PM
To: 'Tobias Schlottmann'; r-help@stat.math.ethz.ch
Subject: Re: [R] Linear programming question

Tobias,

Adding the first constraints yields:
S1 + S2 = -2A

Similarly adding the second set of constraints:
S3 + S4 = 2B

If A and B are positive (which you didn't specify) then
The minimum of S1+S2 is -2A, and the maximum of S3+S4 is 2B.

Thus, the minimum of S1+S2-S3-S4 is -2(A+B).  

Ravi. 


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tobias Schlottmann
Sent: Wednesday, July 18, 2007 1:24 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Linear programming question

 Hi everybody,
  consider please an optimization problem:  
   
  minimize   sum S1+S2
   
  Subject to :  y - x = A + S1
 x - y = A + S2
   
  and we want to add two more constraints:
   
   y - x = B - S3
   x - y = B - S4
   
  where A is a small constant value and B is a large constant value, S1 and
S2 are surplus and S3 and S4 are slack variables.
   
  S3 and S4 have to be maximized in objective function. As objective
function, is this correct?  :
   
  minimize sum S1+ S2 - S3 -S4
   
  where actually we want to minimize S1 and S2; and maximize S3 and S4.
   
  If it is not correct, what to do ?
   
  Thank you for any guide.
   
  Tobias

 
-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Linear programming question

2007-07-18 Thread Moshe Olshansky
Hi Tobias,

Could you please explain the role of x and y - are
they somehow related to S1,S2,S3,S4?  Are they
constant?  Are they additional variable?
What was your original problem (without the slack
variables)?

Regards,

Moshe.

--- Tobias Schlottmann [EMAIL PROTECTED]
wrote:

  Hi everybody,
   consider please an optimization problem:  

   minimize   sum S1+S2

   Subject to :  y - x = A + S1
  x - y = A + S2

   and we want to add two more constraints:

y - x = B - S3
x - y = B - S4

   where A is a small constant value and B is a large
 constant value, S1 and S2 are surplus and S3 and S4
 are slack variables.

   S3 and S4 have to be maximized in objective
 function. As objective function, is this correct?  :

   minimize sum S1+ S2 - S3 -S4

   where actually we want to minimize S1 and S2; and
 maximize S3 and S4.

   If it is not correct, what to do ?

   Thank you for any guide.

   Tobias
 
  
 -
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.