Abstract
Financial reconciliation—the process of matching records across disparate ledgers—is a critical yet computationally intensive task. While the classic Subset Sum Problem is well-documented, real-world reconciliation often requires matching multiple disjoint subsets across two lists where sums align within a specific tolerance. This paper formalizes this challenge as the Subset Sum Matching Problem (SSMP), proves its NP-completeness, and evaluates three algorithmic strategies: Mixed-Integer Linear Programming (MILP), a Search-based solver with caching, and a discretized Dynamic Programming (DP) approach. Our results demonstrate that while MILP provides global optimality for small datasets, the DP approach offers superior scalability for large-scale financial applications.
1. Introduction
In the financial services industry, reconciliation ensures that internal ledgers accurately reflect external bank statements. This process is rarely a simple one-to-one mapping; a single large payment on one side may correspond to a collection of smaller transactions on the other. Furthermore, minor discrepancies due to timing differences or entry errors necessitate a matching framework that allows for a tolerance threshold ($\epsilon$).
Despite its ubiquity, this "many-to-many" matching problem lacked a formal combinatorial definition in existing literature. Researchers at J.P. Morgan have addressed this gap by introducing the Subset Sum Matching Problem (SSMP). This framework moves beyond finding a single target sum to identifying multiple, disjoint pairs of subsets across two distinct sets of values whose sums are approximately equal.
2. Problem Formalization
The SSMP is defined by two sets of real-valued numbers and a tolerance parameter $\epsilon$. The goal is to find disjoint subsets from both sets such that the sum of elements in each pair of subsets differs by no more than $\epsilon$.
A key contribution of this work is the design of a "finer-grained" objective function. Rather than simply maximizing the total number of items matched, the objective rewards a higher number of individual matches. This prevents the algorithm from producing a single, massive, low-confidence match that consumes all available data, instead favoring multiple precise matches that reflect the underlying transaction structure.
3. Algorithmic Approaches
The researchers proposed and compared three distinct methodologies to solve the SSMP:
3.1 Optimal Mixed-Integer Linear Programming (MILP)
The MILP model serves as the exact mathematical benchmark. It is designed to find the absolute global optimum by maximizing both the volume of matched items and the count of matches. While it provides a guarantee of accuracy, its computational complexity makes it "heavy," leading to performance bottlenecks as the number of items increases.
3.2 Search Solver (Greedy + Caching)
To improve speed, a heuristic search solver was developed. This approach employs a greedy strategy to identify matches sequentially. To mitigate the search space explosion, it utilizes a "meet-in-the-middle" caching technique, splitting data into manageable chunks to balance memory consumption against search time.
3.3 Dynamic Programming (DP) Solver
The DP solver leverages the fact that financial data, while real-valued, typically only carries two decimal places of precision. By scaling and rounding these values into integers, the problem can be transformed into a discrete optimization task. This allows for the application of a modified classic DP algorithm for subset sums, which proves to be the most scalable solution for high-volume datasets.
4. Experimental Evaluation
As no standard benchmark for SSMP existed, the authors generated synthetic datasets to test the algorithms under various conditions:
- Integer SSMP: Uniformly distributed integers between $[-\gamma, \gamma]$ to test performance on discrete data.
- Real-Value SSMP: Values between $[-100, 100]$ mimicking actual financial records.
- Varying Thresholds: Testing sensitivity to tolerance levels ranging from $\epsilon = 0$ to $\epsilon = 1$.
4.1 Key Results
The experiments revealed a clear trade-off between precision and scalability. For large-scale problems (e.g., 100 vs. 100 items), the DP solver was the definitive winner, reaching solutions in approximately 3.3 seconds. In contrast, the MILP and Search solvers frequently reached the 90-second timeout threshold on the same datasets.
However, for small-scale problems (10 vs. 10 items), the MILP solver demonstrated its value by finding mathematically optimal solutions that the greedy DP approach occasionally overlooked. Notably, the MILP solver’s performance degraded significantly when the tolerance was very strict ($\epsilon = 10^{-4}$), as the smaller search space became harder for traditional optimization solvers to prune effectively.
5. Discussion and Future Work
The study highlights that discretization is a powerful tool in financial optimization; by treating currency as integers, complex continuous problems become computationally tractable. While the current SSMP framework focuses on numerical alignment, the authors acknowledge that real-world reconciliation often involves unstructured text metadata, such as transaction descriptions.
Future research directions include the development of a "Hybrid SSMP" that integrates both numerical sums and text similarity scores. Additionally, the SSMP framework holds potential for applications beyond finance, including task assignment logistics and educational resource scheduling, where groups of requirements must be matched against groups of capacities.
Summary updated