0

I have written my optimization problem in zimpl and used SCIP to solve it. One of my constraint is

x'Qx<=0.05(portfolio risk <=0.05)

where x is n*1 vector and Q is the n*n covariance matrix. Currently I am reading my covariance matrix from a txt file and it's quite large (3000*3000), I used something like param[I]=read "cov.txt".

When I use SCIP to read the zpl file, the parsing takes a long time. I am just wondering is there a better way to load the data into my problem? Do I have to pass values to the parameters in the zimpl model through a file (disk IO) or can I use memory to pass the values?

Darwin von Corax
  • 5,201
  • 3
  • 17
  • 28
snyder
  • 1
  • 1
    Welcome to Stack Overflow. I've added some whitespace in your post to make it more readable and less a "wall of text," as well as formatting a few bits as code to make them stand out more. Good luck. – Darwin von Corax Mar 11 '16 at 04:50

1 Answers1

0

There are more efficient ways, but they would need programming. 1. You can implement your model directly through the SCIP C/C++ API. 2. You can write a program that embededds zimpl and SCIP and then it is possible to pass file to zimpl as strings from memory. But I doubt there is a tutorial/documentation and still zimpl would have to parse the file. Given that the Linux file system caches files anyway if enough memory is available, this would be probably not much faster then the time you get now if you run the same modell a 2nd time directly after the first time.

Thorsten
  • 21
  • 2