> If you look at the definition of ELEMSET in src/glpmpl.h you will
> see that elemental sets are stored as linked list. Hence access
> via a numeric index would cost O(n) time which is not
> efficient.
> 

ELEMSET is implemented as ARRAY, whose elements have no assigned values.
If an ARRAY is small, a linear search is used. However, if the number of
ARRAY elements becomes greater than 20, the searching routine
automatically builds a binary tree (AVL) to index elements of such
ARRAY, in which case the search time is reduced to O(log n) per one
element.


_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to