Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Optimization Tool: Entering a Model Manually

JoeM
Alteryx Alumni (Retired)
Created

Optimize.png

Sometimes, we don’t rely on an entire dataset to create an optimized solution. Sometimes, it can be as simple as solving a basic question. Consider the following problem that uses the optimization tool:

There is a clothing manufacturer has 750sq. feetof cotton textile and 1,000sq. feet of polyester. Every pair of pants needs 1sq. feetof cotton and 2sq. feetof polyester. Every jacket needs 1.5sq. feetof cotton and 1square feetof polyester. Due to manufacturing restrictions, no more than 400 jackets can be produced in a day, and a minimum of 200 pairs of pants are required to be manufactured.The price of the pants is fixed at $50 and the jacket, $40.

What is the number of pants and jackets that the manufacturer must give to the stores so that these items obtain a maximum sale?

Our job as analysts is to first identify 3 basic groupings to identify our optimization:

1) What our decision variables are and what our objective is

2) Any constraints with respect to decision variables

3) Any bounds and types (continuous, binary, integer) to consider for our decision variables

First, the decision we need to make is the number of pants and jackets the manufacturer should manufacture. Thus, the number of pants to make and the number of jackets to make are our decision variables. Let’s name our decision variables:

x=number of pants

y=number of jackets

1)Identify the Objective

Based on our problem above, we have to identify what our objective is – in this case we want to be ableto maximize revenue. Revenue is nothing more than a function of the number of pant/shirts sold at their respective pricing. Therefore, our objective appears as:

Maximize Revenue = 50x + 40y

In the tool configuration, select the input mode "Enter the model manually," and based on the fact that we are looking to maximize profit, be sure to turn on the Maximize Objective toggle. Next, specify the variable list and select “+”. Now that we have an objective already sorted out, enter the objective using the same variables that we just specified.

opti2.png

2) Identify the Constraints

Sometimes a table is a great way to sort out what constraints may look like. Below, I have created a matrix which will help me identify and rules that may alter my objective.

Pants(x)Jackets(y)Availability
Cotton1 sq. feet1.5 sq. feet750 sq. feet
Polyester2 sq. feet1 sq. feet1000 sq. feet

Based on this table, I can create my constraints. For the first row, I know that whatever number of jackets and pants I produce, I have the manufacturing constraint of only 750 sq. feet of cotton. This 750 sq. feet can be used for any number of jackets and pants, but I do know that they take different amounts of cotton to manufacture. Thus, I’ll specify the amount of cotton used as x+1.5y

Enter the constraints x+1.5y and 2x+yinto the constraints tab of the configuration window.

opti1.png

*The solver in R requires all variables to be on the left hand side of the equality/inequality sign. Although the mathematical equivalent of x+1.5y

3) Identify Bounds and Types

Finally, we need to identify the bounds – namely, manufacturing limits. By default, we know that we cannot negatively manufacture pants or jackets, so the lower boundaries should be 0. However, there was a requirement that at least 200 pairs of pants needed to be manufactured per day, so we will say that X needs to be greater than 200 with no upper boundary limit. Conversely, we have jackets with an upper limit of 400/day. The range of manufacturing jackets could be anywhere from 0 to 400!

Bounds: 200 and 0

Enter the limits into the bounds & types tab in the configuration pane and run the tool.

opti3.png

4) Reviewing the Results

In the “S” (static) output, you can view the objective outcome and the values used for each variable to achieve the maximized objective. In this case, we can see that based on the material we have a manufacturing limits, we can have as much $28,750 in sales if we use the existing resources to manufacture 375 pairs of pants and 250 jackets. Also, feel free to view you interactive resultsthat return from the"I" output!

opti4.png

Happy optimizing!

Attachments
Comments
nicolascorreiacolombo
12 - Quasar

Hello @JoeM

Thanks for this article.

 

I made an example, as I learned from you.

 

 

Op_ex1.PNG

cancelikbilek
5 - Atom

How to do for loops in manual entry step? Like in the constraints for each x and y... Thanks!