help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Re: Fwd: How to create a glp_prob pool?


From: Andrew Makhorin
Subject: [Help-glpk] Re: Fwd: How to create a glp_prob pool?
Date: Thu, 20 Sep 2007 20:16:36 +0400

Hi Ali,

> I have the following problem. In my computations i have to solve LP
> problems repeatedly. The LP problems are not at all difficult, the
> difficulty lies in the enormous number of LP problems to be solved.
> One thing is common in all LP problems: they have the same form, i.e.
> the non-zero elements of the constraint matrix always have the same
> indices, the type of the rows and columns are always the same
> (double-bounded or fixed). Here i neglected the fact that some entries
> of the constraint matrix may become zero accidentally (if so, these LP
> problems can be skipped as worst case solution).
> I guess considerable time is spent on allocating and de-allocating
> memory for the glp_prob objects, re-using a pre-allocated memory could
> speed up the computations by orders of magnitude.
> Is it possible to re-use the glp_prob object?
> By re-use i mean replacing the whole constraint matrix, left and right
> hand sides of the rows and columns. Does it make sense or the gain is
> minimal if any?
> Is there a way to minimize run-time memory allocation, and use a kind
> of pool instead?

Api routines which create/modify the problem object (glp_prob) try to
minimize allocation/deallocation of the memory by using so called
memory pools as well as by preallocating some extra memory. So even
replacing the whole constraint matrix will be performed much faster
than creating the problem object from scratch for a new instance. To
reuse the problem object you can remove extra rows/columns which are
missing in a new instance and then provide new data as if the problem
object would be just created.






reply via email to

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