> I have 2 questions about LP with glpk. > 1) How to deal with problems with constraint boundary disturbance quickly. > For example, originally I have L_i<x_i<U_i (i=1,...n), when I get the answer > of x, how can I get another answer with glpk quickly to > L_i-e<x_i<U_i+e,where e is a number(such as 0.2 or 0.5)?
You need to change bounds and then call lpx_simplex; this routine retains the basis from the last call, so in this case it will start from the current basis performing re-optimization. > > 2) If x_i can only be some real number defined in a known table which > satisfy L_i<x_i<U_i. For example 1<x_1<2 and x_1 can only possibly be a > number in the table of {1.1,1.13,1.5,1.77,1.93}.The table has no special > structure other than ascending sorted. How can I deal with such problems in > glpk? This can be modeled with binary variables as follows: Let A = {a1, a2, ..., an} be a set of values which x can take on, and z1, z2, ..., zn be binary variables, where zj = 1 means that x = aj. Then the following two constraints should be introduced: z1 + z2 + ... + zn = 1 x = a1 * z1 + a2 * z2 + ... + an * zn PS: George, please check your computer and mail agent for viruses. Your message posted to help-glpk was corrupted by a chinese virus; you will see that when the message will come back to you from the list, because you are subscribed. I resent your message to the list, so you do not need to send it again. _______________________________________________ Help-glpk mailing list Help-glpk@gnu.org http://lists.gnu.org/mailman/listinfo/help-glpk