help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Help regarding expressing a constraint for a scheduling


From: Andrew Makhorin
Subject: Re: [Help-glpk] Help regarding expressing a constraint for a scheduling prob.
Date: Wed, 15 Nov 2006 15:52:50 +0300

> Ok. Let me put this question in a more generic fashion so that its
> appropriate to this group.
> 
> I have a Integer programming formulation which has a variable u{i}
> where i varies from 1 to n and another variable V. Each u{i} can
> only take binary values 0 or 1 and same for the variable V.
> 
> I have a constraint which says u{k} <= u{k+1} for k = 1 to n-1.
> Which means if a u{i}=1 for certain i=k, then the variable u is 1 for
> all values of i > k.
> 
> Now Let k be the least index such that u{k}=1 which means u{i}=1 for
> i>k i <=n.
> 
> i want to put a constraint.
>  k <= V.
> 
> Can I represent it in CPLEX LP format as a linear constraint?

From above it follows that any feasible u has the following
structure:

u[1] = u[2] = ... = u[k-1] = 0, u[k] = u[k+1] = ... = u[n] = 1

Since all u[i]'s are binary, the desired constraint can be simply
written as follows:

sum{i in 1..n} u[i] >= n - 1 + V



reply via email to

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