Introduction: From Theory to Tax Reality
In our first article, we explored whether technology is close to solving complex tax challenges. In this article, we take a closer look at the technology that delivered those results: mathematical optimisation.
What is it? What isn’t it? And an example of how it can be used in UK corporation tax.
What Is Mathematical Optimisation?
Mathematical optimisation identifies the best possible solution from a set of feasible solutions, given defined objectives and constraints. For instance, in our first article we saw how it identified the optimal group relief surrenders and sequence for a group with non-coterminous APs – a scenario where traditional approaches can fail to explore all compliant permutations efficiently.
In practical terms, this requires:
- Defining a goal
- Translating tax rules into mathematical expressions called “constraints”
- Using an optimisation engine to intelligently search the solution space to find the optimal decisions that produce the best outcome
- Incorporating cognitive influences – avoiding decisions that a tax professional might reject, even if they appear mathematically viable
It is a well-established and proven technology used daily to solve mission-critical problems. From airline scheduling to energy trading and supply chain logistics, it makes complex, high-stakes decisions with mathematical certainty.
What It Isn’t
To clarify, mathematical optimisation is:
- Not Generative AI – It doesn’t create content or generate text
- Not Machine Learning – It doesn’t learn from past data
- Not Statistical Modelling – There’s no regression, forecasting, or probability-based inference
- Not Brute Force – It doesn’t exhaustively check every combination
- Not a ‘Black Box’ – Its decisions are explainable, as demonstrated in the example below
When Should It Be Used?
Mathematical optimisation is powerful, but best applied where decisions are non-trivial or interdependent. If the best course of action is already clear, there’s no tangible benefit.
Key Concepts in Mathematical Optimisation
Before we look at an example, here’s an overview and a few key concepts.
The Objective
An optimisation model starts with a clear goal – the objective. This is what the model is trying to achieve – the “what” of the problem. Usually, this involves minimising or maximising a value, but it can aim to achieve a specific value. For example, minimise the CT payable for a group of companies over a period of time.
Corporate tax is an example where multiple, potentially conflicting, objectives can emerge such as minimising tax payable, maximising losses carried forward, TWDV carried forward and utilisation of DTR.
Constraints
Constraints are the relevant tax rules – the “must-haves” and “must-avoids”. For example,
- The maximum WDAs not claimed must be <= the available WDA.
- Pre April 2017 NTLRDs brought forward must not be relieved against trading income.
- Where a CIR disallowance has been allocated to a company this must be allocated across the five categories of tax-interest expense per s377(2) TIOPA 2010.
Constraints are expressed mathematically with the preface “subject to”, often abbreviated to “s.t”. Some common forms include:
Equality constraints, such as:
s.t. SUM(disallowed tax-interest expense across the 5 categories) = Allocated CIR disallowance
Inequality constraints, such as:
s.t. Pre 2017 NTLRDs brought forward used <= non-trading profits
s.t. Pre 2017 NTLRDs brought forward used <= Pre April 2017 NTLRDs brought forward
Important modelling notes:
- Constraints like a < b (strict inequalities) are not typically allowed and should be rewritten as a <= b.
- Expressions like a * b, where a and b are decision variables (see below), are not supported by many optimisation engines. Even where permitted, solutions may not be reliably optimal.
- Min(a, b) or max(a, b), where a or b are decision variables (see below), can be used, but they require special formulation.
Decision variables
Variables where the value is to be derived by the optimisation engine are referred to as “decision variables”. For example, WDA not claimed, loss relief claimed against current profits and allocated CIR disallowed tax-interest expense.
Practical example
The following example concerns the FA (No. 2) 2017 loss restriction – an area that often involves complex, interdependent decisions across loss types and reliefs.
Objectives
- The primary objective is to minimise aggregate CT payable after DTR.
- However, there are secondary objectives, such as maximising the utilisation of pre-2017 losses and DTR.
- Our recommended approach to this multi-objective optimisation problem is to first run the model with the primary objective. Then, introduce a constraint to fix aggregate CT at the optimal level, and re-run the optimisation with a new objective (e.g. maximising relief for pre-2017 losses).
Constraints
Rather than listing all the constraints required for this example, a few key examples are set out below. The aim is to:
- Illustrate what’s involved in constructing a constraint, and
- Show that a powerful aspect of an optimisation application can be implemented with relatively little effort – especially when compared to the complexity and formulae typically required in a spreadsheet.
Practical example – Results
Analysis
✅ Minimised CT payable to £2,060,000.
✅ Maximum relief has been given for Company A’s pre 2017 trade losses.
✅ Maximum relief has been given for Company B’s pre 2017 trade losses.
✅ CT chargeable in Company C is equal to foreign tax suffered, hence maximum DTR has been given.
✅ By surrendering Company A’s NTDLR of £3,540,000, instead of relieving it against its own profits, relief for the group’s pre 2017 NTDLRs is £1,606,000 higher.
Performance and complexity
The results are impressive but how long did the optimisation take to run? Including the re-running for the secondary objectives, it took about 2-3 seconds. These short timings allow for rapid evaluation of what-if scenarios and easy accommodation of any changes to the underlying data.
This example focuses on a small group with a small dataset, aimed at conveying the core concepts and potential of using mathematical optimisation in tax. A more complex use might involve a larger group, joiners, non-coterminous APs, capital allowances, CIR, group relief for carried forward losses and more.
The group relief in this example is intentionally straightforward. However, implementing the rules for non-coterminous APs is highly complex, and the efficiency of the implementation can have a substantial impact on performance.
Multi-year
The timeframe in this example is limited to a single year. However, optimisation models can be designed to cover multiple years, incorporating both carry-backs and carry-forwards. This enables the preparation of tax forecasts that also track movements on tax losses over time.
Priority of objectives
This example includes multiple objectives – minimising CT payable, maximising utilisation of pre-2017 losses, and maximising DTR. When a model supports several objectives, rather than building a rigid sequence for evaluating them, it can be more effective to make the priority of objectives configurable. This allows priorities to be adopted that best reflect the goals and circumstances of the companies concerned.
How optimisation outperforms spreadsheets
How optimisation outperforms spreadsheets
Why Formulation Matters
We’ve seen that optimisation models are built on objectives and constraints. But something that often surprises people is that how you write those constraints can make a big difference.
Two models can be mathematically equivalent – meaning they solve the same problem and give the same result on the same machine – but one might solve in seconds, while the other takes minutes, hours, or never finishes at all. The reason? Model formulation.
Efficient constraint construction affects:
- Performance – how quickly the optimisation engine can find a solution.
- Memory usage – whether the model can be loaded and solved on a typical machine.
- Scalability – how well the model handles larger datasets.
This doesn’t mean the model needs to be simplistic – it means it needs to be structured efficiently. We’ll explore this in more detail in the next article, where we’ll look at specific methods and tools for building optimisation models effectively