#
Optimization

Mathematical optimization helps you to use limited resources to produce the best possible outcome based on a variety of inputs and settings.

It starts with a mathematical model of some aspect of your business - also known as a "Business Model". The business model can then be extended into a "**Decision Model**" which includes the resources that are required for your business process (people, trucks, raw materials), the constraints to be satisfied (parts available, physical constraints), and your objective (minimizing cost, minimizing late deliveries, maximizing profit). Decision variables are items whose values can be changed, so as to find the best possible value of the objective. A mathematical optimization solver then combs through all possible solutions to find the best one.

The Solve plug-in is designed to let users build such models through the Tabulate spreadsheet interface.

## Optimization Examples

The following examples are provided to help users better grasp the use case for such analyses and models

- An ecommerce company wants to minimize the time taken to complete an order – this is the objective. The constraints might include the space available in different parts of the warehouse, and the logistics of moving items from one part of the warehouse to another. The decision variables are what items to put in different areas.
- High performance elevators are designed to learn traffic patterns by time of day, and place themselves in the optimal positions. For example, the restaurant floors at the top of a building might be busy in the evenings, so the elevators should be positioned there - whereas a lot of people are coming into the building early in the morning, so the elevators should be at the bottom. The objective is the time that people must wait for an elevator, which must be minimized. The constraints are the number, and capacity, of elevators, and the number of floors – a full elevator must empty its passengers before it can take on another load. The decision variables here are the positions at which the empty elevators wait.
- A solar panel manufacturer needs to reduce costs regularly to remain competitive. The objective here is the unit cost, which must be minimized; the constraints are the costs of running the factories, and the expense of the machines required. The decision variables might relate to the time of day to run the machines, or how long to run them for continuously.
- A marketing team tries different pricing strategies and promotions for a given product, location, and customer. The objective in this case is the revenue from sales of the product, which must be maximized. The constraints might relate to the cost price of the product – there is no point in discounting a product so much that it becomes unprofitable to make. The decision variables relate to the selling price – not so low that it makes the product unviable, not so high that it becomes unattractive to purchasers.

## Explanation of Terms used in Optimization

The following terms are frequently used in optimization. Variables can be *integers*, and optimization problems always involve *constraints*, and *decision variables*. Optimization often focuses on finding a *local maximum*, rather than a *global* one, and optimization techniques are often referred to as *linear programming*.

### Integers

When some, or all, of the variables are integers (whole numbers) – for example, numbers of people, cities, or engineering parts – the problem can be more difficult to solve than one with no integers.

### Constraints

Constraints specify limits on resources, which must be followed for the solution to be valid. *Decision variables* are values that can be adjusted to find the best solution that satisfies the constraints.

Maximize profit (or revenue) for the manufacture of cake, given that there is a maximum amount of ingredients available, and a specified minimum amount of different ingredients to be used, in order to improve the flavor.

In this example:

- The optimization
*objective*is to maximize profit or revenue. - The
*constraints*are that a certain minimum amount of different ingredients must be used, but there is also a maximum amount available of each. - The
*decision variable*is the amount of each ingredient to use. This amount can be varied to maximize the profit (or revenue), as long as the constraints are satisfied.

### Global Maximum, versus Local Maximum

While a local maximum is the best answer in a certain range of values, a global maximum is the best of all possible answers.

Finding the global maximum (over all possible values) might take too much time, or too many resources, or the maximum might not satisfy the constraints. If this happens, the local maximum is found, with all constraints satisfied.

Your business sells to people in a certain geographical area. You want to set an appropriate price, which will maximize your profit, but which your customers also find acceptable. You think that people in a different part of the country will probably be willing to pay more, so your profits might be higher there – but for a variety of reasons, you don’t want to take your business there. Perhaps costs are too high, or the logistics of shipping there are too difficult. Therefore, instead of seeking a global maximum for your profit (over all possible values), you are happy to find the maximum within the region where you are comfortable selling.

### Linear Programming

Linear programming (LP), also called linear optimization, seeks to achieve the best outcome (such as maximum profit or minimum cost) in a model whose requirements are represented by linear relationships.

The following is an example of a linear constraint. Suppose that you have a bakery, which bakes different kinds of pies. The cost of each pie depends on the cost of each ingredient, and the amount of each ingredient that is included in each pie. For example:

Apple Pie – Ingredients: Flour (225g), Butter (140g), Apples (3), Egg (1)

Let us call the cost of an apple pie CA, and let a gram of each ingredient be represented by the first letter of its name. Then we have a cost equation:

CA = 225F + 140B + 3A + E

The constraints might be a restriction on the amount of an ingredient available – for instance, you might only have a limited amount of flour and butter, and a limited number of apples. So these constraints might be represented as:

F ≤ 100,000

B ≤ 100,000

A ≤ 10,000

On the other hand, while the number of eggs might be limited in the same way, you might have a constraint to use a minimum number of eggs – perhaps you have a discounted deal with a local supplier. So the constraint on eggs might take the form:

100 ≤ E ≤ 500

## Summary

Optimization can involve finding either the maximum value (for profit, for example), or minimum value (for cost, for example) for a given scenario. The optimization solution might require you to set a particular price, or produce a specific number of items. The solution can be constrained, depending on factors such as lack of resources, or a requirement to use a certain minimum number of items. Any solution that finds the optimal value must satisfy these constraints, if it is to be usable.