[Scip] which SCIP data structure for sparse 2d array of pointers

James Cussens james.cussens at york.ac.uk
Wed Mar 11 12:08:48 CET 2015


Dear SCIP team,

In my SCIP project I have a 2-dimensional (square) array of pointers.
Each pointer is either NULL or a SCIP variable. This is OK if the
dimensions of the array are, say, 10x10, since the waste of storing
perhaps quite a few NULL pointers is bearable.

However, once we move to, say, 1000x1000 this is no good. The good
news is that for bigger cases like this most pointers will be NULL (ie
for most i,j pairs there is no SCIP variable).

I've been looking at which SCIP data structure to use for this (I am,
of course, too lazy to implement my own). Possibilities seem to be
hashtable or perhaps some sort of sortedvec? I would appreciate some
advice on which is most sensible. Speed of lookup (without using
memory stupidly) is more important to me than simplicity.

Thanks,

James

-- 
James Cussens
Dept of Computer Science &
York Centre for Complex Systems Analysis
Room 326, The Hub, Deramore Lane            Tel    +44 (0)1904 325371
University of York                                        Fax  +44
(0)1904 500159
York YO10 5GE, UK                               http://www.cs.york.ac.uk/~jc
http://www.york.ac.uk/docs/disclaimer/email.htm


More information about the Scip mailing list