NFL Optimizer

How DFS Lineup Optimizers Work — The Math, Explained Honestly

Every DFS optimizer — free, paid, whatever the marketing says — is solving the same formal problem: pick players to maximize total projection subject to exact roster slots and a salary cap. This page explains that problem, why the obvious greedy approach silently loses points, and how the exact algorithm on this site proves its answers. No calculus required; the whole thing is careful addition.

Quick answer: Lineup optimization is a multiple-choice knapsack problem: maximize the sum of projections subject to (a) exact per-position counts, (b) total salary ≤ cap, (c) each player used at most once. Exact solvers use dynamic programming to provably find the best legal lineup; greedy 'best value first' drafting fails because early picks constrain later ones. FLEX slots are handled by enumerating which position fills each FLEX, solving each case exactly.

The formal problem in one table

This is a multiple-choice knapsack problem, a cousin of the classic knapsack studied since the 1950s. It's NP-hard in general, but DFS instances are small enough (nine slots, ~150 players, salaries in $100 units) that exact dynamic programming solves them in milliseconds — which is why 'our optimizer uses advanced math' is marketing noise: at this scale, exactness is cheap and there's no excuse for heuristics.

PieceMeaningDraftKings example
ObjectiveMaximize total projected pointsmax Σ projections of the 9 chosen
Slot constraintsExact counts per position1 QB, 2 RB, 3 WR, 1 TE, 1 FLEX, 1 DST
Budget constraintSum of salaries ≤ capΣ salaries ≤ $50,000
UniquenessEach player at most onceno double-rostering
ExtrasUser rules on toplock, exclude, max per team

Why greedy drafting silently loses

The intuitive approach — sort by value, draft until full — fails on a specific, fixable flaw: it makes early picks that make later slots unaffordable or understaffed. Take the classic crunch: greedy takes the cheap elite TE early, then the two value RBs, and arrives at 3 WRs needing to fit the remaining budget — and the best legal trio under what's left projects 2 points worse than a build that paid $500 more at TE. You cannot detect that by eyeball, because the loss happens three decisions after the cause. Exact solvers don't draft — they evaluate the entire legal space at once, so the TE decision is priced against every downstream consequence.

How exact solving actually works

Dynamic programming builds the answer from sub-problems: 'using only the WR list, the best 3 WRs costing at most $S' is computed for every S — a table built once, in one pass. Each position group gets its own such table; then the tables are combined under the shared budget: for every split of salary between RBs and WRs and TEs, best-plus-best. The best legal total is read off the combined table, and walking back through the decisions reconstructs the actual lineup. The FLEX slot adds one wrinkle: a FLEX can be an RB, WR or TE, so the solver solves the problem for each FLEX-position arrangement (3 options on DK, 6 on FD) and keeps the best. On this site's 146-player sample slate, the whole computation — proof included — runs in about 20 milliseconds.

What 'optimal' does and does not promise

Optimal means: no legal lineup has a higher sum of YOUR projections. It does not mean the lineup will score the most points — projections are estimates, and the contest is decided by outcomes. When two optimizers disagree, they're disagreeing about inputs (projections, rules, correlation adjustments), never about the arithmetic — the arithmetic is settled science. That's why this site puts its sample-slate math in the open: on our default numbers, DraftKings optimal is 114.8 points at exactly $50,000, and every number on every tool page is generated by that same engine at build time, so the copy can never drift from the code.

How 'alternative lineups' are generated

There's no clean closed-form for 'the 5 best distinct lineups' — near the optimum, near-ties explode combinatorially. Practical optimizers use perturbation: take the optimum, ban one of its players, re-solve exactly; that gives nine strong candidates, each provably the best lineup missing that specific player. Rank them, filter for meaningful differences (we require 2-3 changed players so you get actual choices, not permutations), repeat one level deeper if needed. Our sample slate's alternatives land within half a point of optimal — the visible signature of a slate where many builds are nearly equal.

Rules the math can't see

  • Correlation between players (stack effects) — plain optimizers treat players as independent score sources; locking stacks is how you inject correlation by hand.
  • News and injuries — a provably optimal lineup around a player who's inactive at kickoff is an 8-man roster.
  • Ownership — the exact optimum is the most-found lineup in the field; uniqueness is a portfolio decision, not a solver output.
  • Variance — a 20-projection stalwart and a 20-projection boom-bust wildcard look identical to the objective function; the Range of Outcomes tool exists to tell them apart.

Frequently Asked Questions

Do paid optimizers use better math?
The solving math is commodity — exact knapsack at this scale is a solved problem, and any tool that isn't exact at this size simply didn't try. Paid products differentiate on inputs (daily projections, news integration) and workflow (bulk generation, ownership projections), which is real value — just not solver value.
What algorithm does this site's optimizer use?
Exact dynamic programming: per-position knapsack tables (with snapshot-based reconstruction), combined under the budget by memoized search, with FLEX handled by full position-arrangement enumeration (3 arrangements on DraftKings, 6 on FanDuel), plus deterministic leave-one-out perturbation for alternatives. It's the same answer a commercial LP solver would give, at a fraction of the dependencies.
Can I verify the optimizer is right?
Yes, and you should: take a small slate (a few QBs, RBs, WRs) and brute-force every legal lineup in a spreadsheet. Small instances are checkable by hand — that's the nature of the problem — and our unit tests do exactly this against randomized small pools.
Why do salaries get rounded to $100?
DraftKings and FanDuel publish NFL salaries in $100 increments, so solving over $100 units loses nothing on real data and keeps the DP tables small. Pasted values outside the grid round to the nearest $100 — the tools show exactly what was parsed, so nothing silently distorts.
Is 20 milliseconds fast enough for real use?
The initial solve, yes — and each alternative re-solve takes a few tens of ms more, so a full optimal-plus-alternatives result renders in under a second on the sample slate. At 150-lineup bulk scale you'd batch differently, which is a product choice, not a math limit.

More tools used in this guide

NFL Lineup Optimizer

Build the highest-projected legal lineup under DraftKings ($50,000) or FanDuel ($60,000) rules — exact solver, lock/exclude players, CSV import, no signup.

Lineup Range of Outcomes

Monte-Carlo simulate any 9-man lineup: floor (P5), median, ceiling (P95) and the odds of clearing your target score — deterministic and instant.

DFS Value Calculator

Turn any salary + projection into points per $1,000, the points needed at your target multiplier, and a surplus/deficit verdict.

More guides

How to Use a DFS Optimizer

The complete workflow: bring projections, lock your stack, read the alternatives, and avoid the four mistakes that make optimizer output worthless.

DFS Glossary

Every term this site uses, defined once: cash/GPP, ceiling/floor, chalk, punt, stack, bring-back, ownership, value multiplier, and the rest.