Operations Research topics: SAS/OR,
SAS Optimization, and SAS Simulation Studio

How to use submit block to control constraints

Reply
Contributor
Posts: 33

How to use submit block to control constraints

Saw a youtube video yesterday. Ed Hughes showed how to use SUBMIT block with PROC CLP to add one more constraint in OPTMODEL procedure.

His example is too complicated and I have hard time to understand all details.

Is there any simple case which I can start with?

User guide and course note don't have much info.

Thanks

SAS Employee
Posts: 448

Re: How to use submit block to control constraints

Here's an example that uses a SUBMIT block to call a DATA step and PROC GPLOT to plot intermediate solutions during a classical row-generation approach to the TSP:

SAS/OR(R) 13.1 User's Guide: Mathematical Programming

If that example isn't helpful, maybe you can describe what you had in mind.

Contributor
Posts: 33

Re: How to use submit block to control constraints

Thank you Rob.

I did read the part, however the SUBMIT/ENDSUBMIT block is not a constraint. That block takes the outputs and plots a graph.

What I am looking at is to embed a constraint in SUBMIT/ENDSUBMIT block. Any simple example?

Thanks

SAS Employee
Posts: 448

Re: How to use submit block to control constraints

I'm not quite sure what you mean by embedding a constraint.  The job shop example shown by Ed uses SUBMIT to call PROC CLP, and the resulting output provides information that can be used to add valid constraints to the MILP model.  Can you provide some more detail about your use case?

Contributor
Posts: 33

Re: How to use submit block to control constraints

Thanks Rob.

The problem is in current OPTMODEL, one of our SAS programmers cannot call expmatrix function. So I rewrote everything in IML with Rick's help. However I am wondering if possible to call expmatrix function in SUBMIT/ENDSUBMIT block. My guess is it's highly possible.

So you are right, the youtube example uses SUBMIT to generate output info that can be used as a constraint. My specific question is: that example is too complicated. Do you have some simple examples I can start with?

Thanks

SAS Employee
Posts: 448

Re: How to use submit block to control constraints

Now that PROC OPTMODEL supports FCMP functions and routines, I think the examples from this post will help you:

https://communities.sas.com/message/146656#146656

Note that expmatrix is one of the routines provided by PROC FCMP.

The SUBMIT block is useful, but in this case I think FCMP support is the more appropriate OPTMODEL feature for your needs.

Contributor
Posts: 33

Re: How to use submit block to control constraints

Hi Rob,

thanks for your help. Unfortunately, we are still using SAS9.3.

My thought is: keep the original OPTMODEL, add one more constraint in SUBMIT block.

Can you show me how to use SUBMIT instead of FCMP, for example?

Thanks

SAS Employee
Posts: 448

Re: How to use submit block to control constraints

FCMP enablement has actually been hidden for several releases and is officially supported in 13.1.  You might try using it with your earlier release and see if it just works. Using SUBMIT instead would require an indirect approach with multiple solver calls.  And I would need more explicit details about your intended constraint.

Contributor
Posts: 33

Re: How to use submit block to control constraints

Hi Rob,

We tried and it didn't work. We even contact SAS support and raised a ticket. Nor working at this moment.

for example, we are minimize the function

min z=sum{i,j} ( x[i,j] - y[i,j] ) **2

the constraints are, for example:

con condition1{i}: sum{j} x[i,j]=1

now we want to introduce expmatrix(x,3,z) and make sure z is satisfied with some other conditions.

Can you give us an example how to use SUBMIT block?

Thanks

SAS Employee
Posts: 448

Re: How to use submit block to control constraints

I'll be glad to help, but I still need more details.  What does your constraint that involves expmatrix look like?  It looks like you have overloaded z as the name your objective function and as the third argument of expmatrix.

Ask a Question
Discussion stats
  • 9 replies
  • 710 views
  • 0 likes
  • 2 in conversation