An Introduction to Operations Research

Samuel Parrott
Gousto Engineering & Data
6 min readMay 18, 2022

What is Operations Research?

Operations research (OR) is a scientific approach to determining the optimal solution to a defined business problem. Through applying mathematical techniques, operations research allows complex issues to be optimally solved that would otherwise be impossible to determine. It is a very useful field of study for companies with complex operating models like Gousto, especially when applied alongside the fields of data science and machine learning.

Give Me Some Examples!

Operations research is a large area of study and so the best way to help grasp the idea of what it can do is to go through some examples of the various techniques used and some specific real world applications. The list below is not exhaustive but just some of the most widely used examples.

Linear and Integer Programming

The most commonly known method, linear programming computes the optimal solution to a problem modelled as a set of linear relationships.

The model is set up with three main components, a linear objective function to minimise or maximise, a set of decision variables and a set of linear constraints that define the feasible region a solution must fall into. A number of the following techniques and examples use linear programming applied to specific types of problems.

At Gousto it has been used to solve a number of problems such as how to optimally distribute our picking between ambient and chilled locations in the factory or how to optimally transfer stock between our factory sites to reduce surplus of stock and improve deficits of stock across our factories. One of the larger Gousto problems that uses OR is our order routing algorithm, which takes care of optimally routing our boxes around the factory picking stations to collect all of the required ingredients. If you want to get your hands a bit more dirty with the details, one of our data scientists Dominic has written an excellent more in depth post on how this algorithm works, which can be accessed here.

Routing

Representation of a solution for the best route for a fleet of 4 vehicles to optimally deliver to all 16 locations

Routing problems have the goal of determining the best route for an object or vehicle that needs to travel between two points or visit a set of locations. This can be extended to optimise how a fleet of vehicles visits a set of locations.

OR routing problems are an area of OR which you will have interacted with and used in your own day to day life regardless of if you knew what OR was before reading this post or not.

Obvious examples for this application are logistics and courier companies where they need to determine the optimal routes for each of their drivers to service all the required delivery locations in a day. As mentioned though you have run a routing OR model yourself! Every time you open google maps and want to know the fastest route home from the pub a routing model is solved.

Scheduling/Sequencing

This type of problem is used by companies to solve difficult scheduling problems where it is required to assign people or resources to various tasks at specific times. Examples include employee rostering and assigning jobs to machines in a manufacturing line where the jobs are constrained to visit every machine and must do so in a specific order.

The images below demonstrate how ordering the various jobs in a certain way can help reduce the time required to finish all the work, over thousands of jobs the 5 mins saved by solution 2 (on the right) could add up to an extremely large saving of time and in turn money.

Solution 1 on the left & Solution 2 on the right

Simulation

All the examples talked about so far concentrate on optimisation and finding the best or optimal solution but OR is wider than just this.

Simulation is a large area of OR that can be utilised to help find the best solution but it changes the question we are looking to answer. Instead of Gousto looking to answer what is the best route for our boxes through the factory we can use simulation to determine what the effect of changing certain parameters would be.

This extension to optimisation allows Gousto to not only determine the best box routes with the current real world set up but also experiment with many different ways in which we can improve the set up of our factories.

Limitations of OR and Solutions

As we have discussed, operations research involves finding the optimal solution to a complex business problem, to ensure this though the model needs to be modelled very accurately (which can take time to set up) and also needs to search every possible solution to find the best one.

A rather simple employee shift problem demonstrates this. Looking at a company that runs three 8-hour shifts per day and assigns three of its four employees to different shifts each day, while giving the fourth the day off. With no constraints to shift patterns or volume of work the number of possible shifts for this problem is immense.

  • Each day we have 4! employee assignments = 24
  • Number of possible weekly schedules = 24⁷ or 4.5 billion possibilities

There are techniques to help reduce the set of possibilities, through the use of constraints and also the specific algorithms used to solve the problems but even then very complex problems could take a long time to solve.

Heuristics is an area that can help solve the above limitations. Heuristics is defined as a practical algorithm that is designed and applied to solve the same problems but isn’t guaranteed to give the optimal solution. Heuristics allow a simplified model to be designed to reduce complexity so a solution can be found much quicker. It can also be good practice to use a heuristic in conjunction with the optimisation techniques discussed earlier, the heuristic is used to find a ‘good’ solution quickly and narrow the feasible region for an optimal solution to be found.

The blog post linked above which goes into more depth about our order routing algorithm describes a good example on how optimisation and heuristics are used together at Gousto or there is another post by one of our data scientists that goes into some great examples in a post you can find here.

Let’s Wrap it All Up!

Mathematical Modelling

Behind the specific use cases and techniques discussed are complex statistical algorithms that will solve your model. Luckily though you don’t need a PhD in maths and statistics to use them as these algorithms are easily accessible to use through free python packages or even plugins for excel and g-sheets. All you need to do is know how to set up your model through an objective function, decision variables and constraints and let the algorithm do the rest.

Optimisation

As mentioned above there are three key aspects to any OR problem:

  • An optimisation problem will always be about either minimising or maximising a cost or benefit which is incorporated into the objective function of the model. For example when Gousto optimises its stock transfers the model works to minimise the number of transfers and also the distance stock travels for a transfer between sites.
  • Decision variables are the aspects of the model that will change to tell us what the final optimal decision is, such as what stock is transferred from site A to site B.
  • Finally the constraints are applied, these shape the model to replicate the rules in the real world for the problem we are trying to model, they will also reduce the size of the problem set. Without constraints you would get illegal solutions such as transferring stock between Gousto factories which aren’t able to do so in our actual operation.

Hopefully you now have a better grasp of where and how operations research can be used and what it can achieve if implemented correctly, especially at a business as complex as Gousto.

--

--