SAS Optimization, and SAS Simulation Studio

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-14-2018 04:58 PM - last edited on 02-14-2018 05:01 PM by Reeza

Hi,

Demand for various products of a company in different regions is given. This is the quantity in demand.

```
number actual_demand{Products, Regions} = [
12 58
34 23
41 6];
```

Prices of all products in each region are also given.

```
number demand_price{Products, Regions} = [
20 8
30 10
10 20];
```

This company has 3 plants where it'll be producing the required qty and shipping to these regions where demand is present. But because of production constraints, it may produce at times more or at times less - than the total quantity that was demanded.

Objective is maximizing revenue, which is given as

```
Revenue = demand_price * demand_fulfilled.
Demand_fulfilled = min(Amount Shipped, Actual_Demand)
```

Amount Shipped is the decision variable in the model. Signifies the amount of each product that was shipped to each region.

```
var Amount_pl1{Products, Regions} >= 0;
var Amount_pl2{Products, Regions} >= 0;
var Amount_pl3{Products, Regions} >= 0;
```

With this information, I understand that the objective function should be as follows :-

```
maximize revenue = sum{i in Products, j in Regions}(demand_price[i, j]*min(Amount_pl1[i, j]+Amount_pl2[i, j]+Amount_pl3[i, j], actual_demand[i, j]))
```

But this returns the error - ERROR: The NLP solver does not allow integer variables.

I don't understand why this suddenly becomes an NLP problem by using the min function. Also, how to formulate this into a linear objective function and still captures the true essence of revenue.

I've also tried the below modification to the objective function, which still gives the same error.

Please help.

```
maximize revenue = sum{i in Products, j in Regions}(demand_price[i, j]*(Amount_pl1[i, j]+Amount_pl2[i, j]+Amount_pl3[i, j]>< actual_demand[i, j]))
```

PS :- I'm a first time poster so please be patient if I've included any bad posting practices here, and let me know.

Also, regarding the problem, I've drastically reduced the complexity for sharing code, sample data and to keep it simple.

Highlighted
## Re: Urgent - Using elementwise min(DecisionVar[,], Constant[,]) in PROC optmodel objective function

Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to arnav19930

02-15-2018 10:51 AM

Yes, the MIN function is nonlinear. To linearize your problem, you can introduce an explicit variable and linear constraints:

```
var Demand_fulfilled {Products, Regions} >= 0;
con Linearize1 {i in Products, j in Regions}:
Demand_fulfilled[i,j] <= Amount_pl1[i,j] + Amount_pl2[i, j] + Amount_pl3[i,j];
con Linearize2 {i in Products, j in Regions}:
Demand_fulfilled[i,j] <= actual_demand[i,j];
```

And then use Demand_fulfilled in the objective function. Although these constraints enforce only Demand_fulfilled <= min(Amount Shipped, Actual_Demand), the maximization objective will yield Demand_fulfilled = min(Amount Shipped, Actual_Demand) at optimality.