Optimizing Assortment Selection
Overview
Optimization refers to a field of applied mathematics that is utilizes mathematical techniques and algorithms to find the most optimal solution to a given equation. Given a scenario where there are budget constraints and space constraints, a set of items need to be chosen to be placed on the shelves for sale. Working within these constraints, a maximum profit is desired. In this tutorial, we will be addressing this assortment problem, and proceed to find out which subset of items will make the most profit within the given constraints.
Components
- Infor OS Platform
- Infor AI
Requirements
- Acess to an Infor CloudSuite
- Infor AI Provisioned in the Cloudsuite
- Security Roles
- COLEMANAI-Administrator
- COLEMANAI-User
- Download Package
Tutorial
- Navigate to the Artificial Intelligence section of the Infor CloudSuite.
- From the InforAI home page, navigate to the ‘Datasets’ section option under the ‘Data Collection’ tab on the lefthand menu.
- Add the datasets included in the download above. You should add data from the files ‘BudgetLimit.csv‘, ‘SelectionProblem.csv‘, and ‘SpaceLimit.csv‘ as three distinct data sets. For each imported file, provide the details below, then save the dataset.
- Name: A unique identifier referring to the current file’s dataset.
- File: The current file that we want to upload to the platform and import.
- Delimiter: Refers to the character or symbol that is used to separate (delimit) individual fields (columns) within the dataset file.
- Once all three files have been loaded successfully, navigate to the ‘Groups’ option under the ‘Data Collection’ tab.
- Add a data group, select all three files for the group, and give it a name.
- Navigate to the ‘Quests’ section of the ‘Optimization’ option in the left hand menu. The ‘Quests’ feature is where we will build the model.
- Add a new quest and provide the following:
- Name: A unique identifier referring to the optimization model. In this case, we will be naming our model, ‘Profit Optimization‘.
- Set Data Collection: Refers to the selection of the data group. In this case, we will be selecting the ‘AssortmentDemostration‘ data group (with whatever name you chose) that we just created in the prior steps.
- In the center of the ‘Quests Design’ page, there are tiles at the bottom of the screen that help deal with the process of building an optimization model. You can drag and drop each option to the center of the page and within their respective columns. Be sure to click the ‘Save’ button at the top when finished with added activities. In this tutorial, the ‘Prepare Data‘ tile is not used.
- ‘Prepare Data‘: Allows you to perform data preparation tasks that are specific to the model, which include data cleaning, handling missing values, scaling variables, and encoding categorical variables.
- ‘Setup Model‘: Enables you to define a mathematical representation of the optimization problem and you are able to define a goal for the optimization problem or define any constraints.
- ‘Optimize Model‘: Triggers the optimization process and the model is solved using optimization algorithms and techniques to find the best solution that also satisfy the given conditions.
- ‘Results‘: Provides you with the output and insights from the optimization process, such as the optimal values of the objective function, decision variables, satisfied and unsatisfied constraints, and additional analysis.
- To setup our model, drag and drop the ‘Setup Model‘ tile into its designated column, which is the space allocated above the tile. Provide the naming information. For our model, we will use ‘Profit Optimization‘
- Provide information for the Sets/Indices & Constant section. This section represents collections of related elements in the optimization model that decision variables and/or constraints are associated with. In the video walkthrough of the tutorial, we change variable names to a single character. Although not required, this extra step just helps make associated mathematical equations easier to read. Be sure to click the ‘Save’ button when finished.
- ‘Space_Limit‘ is shortened to ‘s‘.
- ‘Item_Details‘ is shortened to ‘i‘.
- ‘Budget_Limit‘ is shortened to ‘b‘.
- Click on the tab for the Decision Variables. This section represents the unknown quantities that you can control or choose in an optimization problem, in this case, the variable that represents for each item, if we have selected it in our set of items for sale or not. Add the decision variable by clicking on the ‘+’ button and provide the following information. Be sure to click the ‘Save’ button when finished.
- Name: A unique identifier referring to the decision variable, which we will name ‘ItemSelected‘.
- Variable: Refers to the label or name that is assigned to represent the decision variable within the model. We will be referring to this as ‘x‘, being the independent variable in the equation.
- Dimension: Refers to the dimensionality that the decision variable can take. In this case, the dimension of our decision variable is 1.
- Index: Refers to the set instances in which our decision variable will have value. In this case, our index, labeled ‘i‘, which will serve as an indexing element for all of the potential items we consider, as each individual item will need a decision variable value — selected or not-selected.
- Domain: Refers to the valid range that the decision variable can take in order to help capture the problem’s constraints, practicality, and restrictions. We will be selecting the ‘Binary‘ option from the drop-down menu. This will better represent the options, ‘yes’ and ‘no’, for an item to be selected on assortment.
- Move to the Constraints tab. This section represents the logical conditions that the solution to the optimization problem must satisfy. In this case, the constraints are the budget limit and the amount of space that is available to use. So, add these constraints by clicking on the ‘+’ button and provide the following information. Be sure to click the ‘Save’ button when finished.
- Name: A unique identifier referring to the constraint.
- ‘Budget‘ to represent our maximum budget constraint.
- ‘Space‘ to represent our space availability constraint.
- Dimension: Refers to the dimensionality of the constraint.
- The dimension for ‘Budget‘ is 1.
- The dimension for ‘Space‘ is 1
- Index: Refers to the set or range of values that the constraint can take.
- The index variable name for ‘Budget‘ is ‘b‘.
- The index variable name for ‘Space‘ is ‘s‘.
- Condition: An optional field that allows for more complex logical filtering. We will not be defining a condition in this tutorial. For more information, refer to the product’s documentation.
- Function Declaration: The mathematical expression that defines the constraint. You can use the expression builder to help build this mathematical expression by providing the appropriate parameters. Click on the pencil to provide the following information and be sure to click the ‘Save’ button when finished.
- For ‘Budget‘, the function declaration is the ‘sigma function‘ for the sets/indices ‘i‘ & ‘b‘ of the decision variable representation ‘x‘ and has these parameters: ‘Item_Details.COST‘ and ‘Budget_Limit.BUDGET_LIMIT‘. This expression translates to the sum of the costs of corresponding selected items in the assortment cannot exceed or must be less than or equal to the allocated budget.
- SUM<i>{x[i]*Item_Details.COST[i]}<=Budget_Limit.BUDGET_LIMIT[b]
- For ‘Space‘, the function declaration is the ‘sigma function‘ for the sets/indices ‘i‘ & ‘s‘ of the decision variable representation ‘x‘ and has these parameters: ‘Item_Details.SPACE‘ and ‘Space_Limit.SPACE_LIMIT‘. This expression translates to the sum of the available spaces of corresponding selected items in the assortment cannot exceed or must be less than or equal to the space available.
- SUM<i>{x[i]*Item_Details.SPACE[i]}<=Space_Limit.SPACE_LIMIT[b]
- For ‘Budget‘, the function declaration is the ‘sigma function‘ for the sets/indices ‘i‘ & ‘b‘ of the decision variable representation ‘x‘ and has these parameters: ‘Item_Details.COST‘ and ‘Budget_Limit.BUDGET_LIMIT‘. This expression translates to the sum of the costs of corresponding selected items in the assortment cannot exceed or must be less than or equal to the allocated budget.
- Name: A unique identifier referring to the constraint.
- Move to the Objectives tab. This section represents a mathematical equation that maximizes or minimizes a numeric value to solve the optimization problem. Click on the ‘+’ button to add a new objective function and provide the following information. Be sure to click the ‘Save’ button when finished.
- Name: A unique identifier referring to the objective, which will be named, ‘Revenue‘.
- Sense: Specifies the direction of the goal, whether to maximize or minimize the value of the objective. In this case, select ‘MAXIMIZE‘ from the drop-down menu.
- Function Declaration: The mathematical expression that defines the objective. You can use the expression builder to help build this mathematical expression by providing the appropriate parameters. Click on the pencil to provide the following information and be sure to click the ‘Save’ button when finished. In this case, the function declaration is the ‘sigma function‘ for the sets/indices ‘i‘ of the decision variable representation ‘x‘ and has the parameter ‘Item_Details.POTENTIAL_REVENUE‘. This translates to the sum of each selected item in the assortment should reach its maximum potential.
- SUM<i>{x[i]*Item_Details.POTENTIAL_REVENUE[i]}
- Return to the quest layout, and add an Optimize Model block to the workflow. Provide the following information and be sure to save your work when finished:
- Name: A unique identifier referring to the optimize model object, which we will name ‘Optimize CBC‘.
- Solver: Refers to the optimization algorithm or solver that will be used to find the optimal solution for the model. In this case, we will stick with the default, ‘CBC‘ (Coin-Or Branch and Cut), which is an open-source linear program (LP) and mixed-integer program (MIP) solver. This solver is intended to be used primarily as a callable library to create customized branch-and-cut solvers. Refer to the ‘Solvers Reference‘ section under ‘Optimization‘ for more information about the different solvers.
- Model/Custom Algorithm: Refers to the optimization model that we are currently using, which will be ‘Profit Optimization‘ in this tutorial.
- Iterations: An optional field that refers to the limit the number of iterations that will be used. This is helpful to use for large or time-consuming tasks.
- Endpoint Schema: Refers to the all the components that are going to be included in the JSON message.
- Parameters Selected: Select all the parameters from the selection list on the left.
- Constants Selected: Select all the constants from the selection list on the left.
- When finished with selections, click on the ‘Run’ button and ‘Save’ button within the ‘Endpoint Schema’ window.
- Optional: Drag and drop another ‘Optimize Model‘ tile as we utilize another solver, so that we can make comparisons. Be sure to save your work when finished.
- Name: ‘Optimize Bonmin‘
- Solver: Select ‘BONMIN‘ from the drop-down menu. BONMIN is an open-source C++ code for solving linear (LP), non-linear, and general mixed integer nonlinear programming (MINLP) problems.
- Model/Custom Algorithm: ‘Profit Optimization‘.
- Endpoint Schema: Refers to the all the components that are going to be included in the JSON message.
- Parameters Selected: Select all the parameters from the selection list on the left.
- Constants Selected: Select all the constants from the selection list on the left.
- When finished with selections, click on the ‘Run’ button and ‘Save’ button within the ‘Endpoint Schema’ window.
- Save your current progress and run the quest by clicking on the play button. The ‘Results‘ tile will provide insights about the model’s performance when the optimizer run is complete.
- We can then deploy the best performing solver, which is the ‘CBC‘ solver in our case as it had less iterations, a faster runtime, and was able to identify the same maximum profit than ‘BONMIN’. Select the solver of choice and click on the ‘Production Quest’ button. When prompted to select the type of production quest to deploy, select ‘Realtime Production‘ and click on the ‘Create Production Quest’ button.
- Save and run the production quest. Once finished, you can deploy the endpoint by clicking on the ‘Endpoint’ button. To view the results or for further testing, navigate to the created endpoint.