What Is a Solver? Definition, Types, and How They Work

A solver is a piece of software that finds the best answer to a mathematical problem, or determines whether an answer exists at all. You give it a goal (like maximizing profit or minimizing cost), a set of rules the answer must follow, and the solver works through possibilities until it lands on a solution. Solvers power everything from airline scheduling and supply chain logistics to the Solver tool built into Microsoft Excel.

How a Solver Actually Works

At its core, a solver takes three inputs: an objective (what you want to optimize), decision variables (the things you can change), and constraints (the rules those variables must obey). It then uses an algorithm to test and refine possible solutions, converging toward the best one it can find.

Consider a simple example. A factory makes two products and wants to maximize profit. The decision variables are how many units of each product to make. The constraints are limits on raw materials, machine hours, and labor. The solver tries different production combinations, evaluates profit for each, and narrows in on the mix that earns the most money while staying within every limit.

This process happens through iteration. The solver evaluates the objective, moves the variables in a direction that improves the result (often using a technique called steepest descent, which follows the path of fastest improvement), then compares the new result to the previous one. It repeats this cycle until further improvement becomes negligible. The answer is technically an approximation, but it’s so close to exact that for practical purposes it’s the right answer.

Types of Solvers

Different mathematical problems require different solving strategies. The major categories break down by the kind of math involved.

Linear programming (LP) solvers handle problems where both the objective and constraints are straight-line relationships. Think of allocating a fixed budget across advertising channels to maximize reach. These are the fastest and most mature solvers, and linear programming sits at the center of many other optimization techniques.

Mixed integer programming (MIP) solvers add a twist: some variables must be whole numbers. This matters when you’re deciding how many trucks to dispatch or whether to open a warehouse (yes or no, not 0.7 warehouses). The integer requirement makes these problems dramatically harder to solve.

Nonlinear programming (NLP) solvers tackle problems where relationships curve rather than forming straight lines. Pricing optimization often falls here, since doubling a price doesn’t simply double or halve demand.

Quadratic programming (QP) solvers are a specific flavor of nonlinear solver designed for problems where the objective involves squared terms. Portfolio optimization in finance is a classic use case.

SAT and SMT solvers work differently from optimization solvers. Instead of finding the “best” answer, they determine whether a logical statement can be true at all. Software engineers use them to verify that code behaves correctly, generate test cases that exercise every path through a program, and even solve logic puzzles like Sudoku.

Local vs. Global Solutions

One critical limitation applies to most solvers: they typically find a local optimum, not necessarily the global one. A local minimum is a point where the solution looks better than anything nearby, but a much better answer might exist in a completely different region of the problem. Imagine standing in a valley and concluding you’re at the lowest point on Earth because every direction goes uphill, when a deeper valley sits 50 miles away.

Standard solvers find the best solution within the “basin” determined by their starting point. This is why trying different starting values is a common strategy when a solver’s result seems off. Specialized global optimization tools attempt to search multiple basins, using techniques like simulated annealing that deliberately explore distant regions of the problem space before settling down.

Solvers in Everyday Software

The most accessible solver for most people is the one built into Microsoft Excel. It’s an add-in that lets you set a target cell to minimize or maximize, specify which cells can change, and define constraints. Under the hood, it uses the same iterative algorithms as industrial solvers.

Excel’s Solver can fail in two distinct ways. A “miserable result” is when it reports that it can’t find an answer, which at least tells you something went wrong. A “disastrous result” is worse: the solver returns an answer that’s incorrect but reports success. To reduce the chance of either outcome, you can try different starting values in your changing cells, add constraints like requiring variables to be zero or positive, or restructure the problem entirely.

Industrial-Grade Solver Software

For problems too large or complex for a spreadsheet, dedicated solver software handles millions of variables. The industry splits between commercial and open-source options.

On the commercial side, Gurobi and CPLEX are the dominant solvers for linear and mixed integer programming, used heavily in logistics, finance, and energy. MOSEK covers a broader range including conic optimization. AMPL and GAMS serve as modeling languages that let users describe problems in near-mathematical notation and then pass them to whichever solver fits best.

Open-source alternatives have become increasingly capable. HiGHS handles linear and mixed integer programming. SCIP tackles both mixed integer and mixed integer nonlinear problems. GLPK, the GNU Linear Programming Kit, provides a free option for linear and integer programming. IPOPT specializes in large-scale nonlinear optimization for continuous problems.

How Solvers Are Evaluated

Two metrics matter most when comparing solvers: solution quality and speed. Solution quality is often measured by the optimality gap, which is the difference between the best solution found so far and a theoretical bound on how good the solution could possibly be. A gap of zero means the solver has proven its answer is optimal. Speed is measured by the time to reach a solution of acceptable quality, which can range from milliseconds for small linear problems to hours or days for large mixed integer ones.

The cutoff time you allow a solver matters more than you might expect. Research on algorithm configuration shows that the time budget you give a solver can fundamentally change which solving strategy performs best. A solver that’s fastest at finding a good-enough answer in 10 seconds may not be the same one that finds the best possible answer given 10 minutes.

Machine Learning and Modern Solvers

A newer development combines traditional solvers with neural networks. Rather than replacing solvers, machine learning provides them with much better starting points. In one approach, a neural network learns the pattern between a problem’s parameters and its likely solution by studying previously solved examples. It then generates a high-quality initial guess at negligible computational cost. A traditional iterative solver takes over from there, refining the prediction to whatever level of accuracy is needed.

This hybrid strategy has shown strong advantages over conventional solving for large-scale problems that need to be solved repeatedly with slightly different parameters, like re-optimizing a supply chain as demand forecasts update. The neural network handles the broad pattern recognition while the solver handles the precise math, combining the strengths of both approaches.