Turn on suggestions

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

Showing results for

Options

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 02-14-2018 04:58 PM
(778 views)

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.

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

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.