BookmarkSubscribeRSS Feed
Quartz | Level 8

I'm trying to implement an algorithm in Proc Optmodel that has a quadratic term and, I believe, requires the application of integer quadratic programming.  Proc Optmodel produces an error message that the "QP solver does not allow integer variables. The LSO solver might be suitable for this problem".  But when I attempt to solve with the LSO solver, I get an "out of memory"  error message.  The relevant code for Proc Optmodel is below.  I would appreciate any guidance on this issue.  






Proc optmodel;
/* Read CoverageMatrix data into index sets*/
	set <str> stations;
	read data socal.stationdataexisting  into stations=[station];
	set <num> TARGETS;
	read data work.targets into TARGETS=[target];
	num Matrix {stations, ORIENTATIONS, TARGETS};
	read data work.CoverageMatrixOpt into [station orientation target] Matrix=k;
/* Set Constants*/
	%Let N=3; /*number of stations*/
	num N=&N;

/*Declare Variables*/
	/* Sadik Equation 11--Sets CHI as binary variable that is 1 when using station i and POSITION j else 0.*/ 
	var CHI {stationS,ORIENTATIONS} binary;

	/*Sadik Equation 9.*/

	var PSI{TARGETS} integer <=3;

/* Declare Model*/

	/*Sadik Equation 7--the function to be minimized where 3 is constant k (max value of variable PSI{TARGETS}*/
	minimize OptCoverage=sum{target in TARGETS} (3-Psi[target])**2
	-sum{station in stations, orientation in ORIENTATIONS}Chi[station,orientation];

/*Subject to Following Constraints*/

	con CHI_constraint {station in stations}: 
	sum{orientation in ORIENTATIONS}CHI[station,orientation] <=1;

/* Sadik Equation 8*/
		var XIT{TARGETS} integer;
	con XIT_CON1{target in TARGETS}:
   XIT[target]=sum{station in stations, orientation in ORIENTATIONS}
               matrix[station, orientation, target] * Chi[station,orientation];
	/*XIT_N[target]= XIT[target]/N;*/

	con XIT_CON2{target in TARGETS}:XIT[target]/N <= PSI[target];
	con XIT_CON3{target in TARGETS}:PSI[target] <= XIT[target];

/* Call Solver and Save Results*/

Can you please also provide the input data sets?

Quartz | Level 8



Thanks for your prompt response.


I don't know the preferred way for posters like myself to send large datasets in support of questions like the one I posted today.  I started to winnow down the size of the dataset in the hope of finding a more manageable size and discovered that the LSO Solver would run on a smaller subset without an "out of memory" error so obviously problem #1 is that the dataset is too large for SAS OnDemad for Academics. But the LSO Solver also reported the "best solution found does not satisfy the feasibility tolerance".  Not exactly sure what that means but it appears to suggest I'm heading down a dark alley to a dead end anyway.  So I'll terminate this thread for now until I can come up with a better posed question.  And I thank you again for your generous offer to help.






Here's an approach that linearizes the quadratic objective so that you can use the MILP solver:

   num k = 3;
   var Psi {TARGETS} integer <= k;
   set VALUES = 0..k;
   var IsValue {TARGETS, VALUES} binary;
   con OneValue {t in TARGETS}:
      sum {v in VALUES} IsValue[t,v] = 1;
   con LinkIsValuePsi {t in TARGETS}:
      sum {v in VALUES} v*IsValue[t,v] = Psi[t];
   minimize OptCoverage = sum{t in TARGETS, v in VALUES} (k-v)^2 * IsValue[t,v]
	-sum{station in STATIONS, orientation in ORIENTATIONS} Chi[station,orientation];
Quartz | Level 8

Thanks, Rob.  I'll try your suggestion.





Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.


Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 


Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2 in conversation