Originally posted by: SystemAdmin
I've been looking to incorporate sparse model data to boost the memory usage and efficiency of my code (following the IBM whitepaper: ftp://ftp.software.ibm.com/common/ssi/sa/wh/n/wsw14059usen/WSW14059USEN.PDF). To this goal, I've looked at the OPL Example
transp. In particular, I'll use
transp2.mod as an example.
In
transp2.mod two sets and a tuple are defined:
{string
} Cities = ...;
{string
} Products = ...; tuple route
{ string p; string o; string d;
}
{route
} Routes = ...;
The tuple set
Routes is a subset of the full set (number_Products)*(number_Cities)*(number_Cities), so there is an advantage to later declare parameters and decision variables over the set
Routes instead of over
p in Productso in Citiesd in Cities.
The allowed set of routes is defined in
transp2.dat as:
Routes =
{ <bands GARY FRA>, <bands GARY DET>, ...
Is there a way to load this tuple set from Excel instead? What would that look like in an Excel spreadsheet? I suspect one column for each of the 3 entries <p,o,d> in
Routes. Do I need to make an intermediate data structure that reads this matrix of string data from the Excel spreadsheet, and then pull the values one by one to form the elements of the tuple set +Routes+?
Thanks,
Alex
#DecisionOptimization#OPLusingCPLEXOptimizer