A two-part franchise system: a transparent Player Impact Score that scores batters and bowlers on contextual contribution by phase, and an Integer Linear Programming squad optimizer that constructs a 15-player squad under the real IPL constraints — 95-crore budget, ≥4 overseas, role minimums.
An IPL franchise auction looks like a bidding war, but the math underneath is an integer program. You need exactly 15 players. You need at least 4 overseas. You need at least 5 batsmen, 5 bowlers, 3 all-rounders, 2 wicket-keepers. You have 95 crore to spend. From a pool of 543 catalogued players, you're choosing 15 — that's 10²⁸ possible combinations.
Most cricket analytics work stops at the leaderboard: "here are the top 50 players by some metric." But a leaderboard isn't a squad. A scout's job ends where this project begins — translating "good players" into "the right 15 players we can actually afford under league rules."
That's a textbook operations research problem. So treat it like one.
The Impact Score is not learned — it's a hand-weighted composite of normalized features. The reason: there's no labeled "true impact" target to train against, and a learned regressor would just be predicting another proxy. A weighted index is auditable — a coach can see exactly why a player ranks where they do.
Binary decision variables — one per player. Linear objective — sum of performance scores. Linear constraints — budget, squad size, role minimums, overseas minimum. It's a textbook Integer Linear Program.
For each batter: total runs, balls faced, fours, sixes, strike rate, phase-wise runs (PP/Middle/Death), count of innings ≥ 30 runs. For each bowler: legal-delivery economy (extras correctly filtered), valid wickets (excludes run-outs), phase-wise overs bowled, count of matches with ≥ 2 wickets.
MinMax-scale each feature to [0, 1]. Apply hand-weighted composite — 0.25 for volume, 0.25 for clutch innings, 0.15 each for PP/Middle and SR vs avg, 0.05 for death (the contested phase). Weights sum to 1.0 by construction. The score is transparent: every component is inspectable.
Merge performance stats with IPLPlayerAuctionData.csv on Player name. Keep only players with auction data (amount > 0). Result: 543 eligible players with both Impact Score and price.
One binary decision variable per player: select_i ∈ {0, 1}. Linear objective: maximize the sum of (selected × performance score). Seven linear constraints — squad size, budget, overseas minimum, four role minimums. The whole formulation is < 30 lines of PuLP.
COIN-OR's CBC solver applies branch-and-bound on the LP relaxation, pruning subtrees whose relaxed bound can't beat the best integer solution found so far. For 543 binary variables and 7 constraints, this converges in well under a second. The output: an exact-optimal 15-player squad under the given objective.
Role distribution pie. Indian vs overseas bar plot. Cost vs performance bar plot. Role × origin heatmap. Standard squad-audit views a franchise analyst would want before signing off.
If you opened the squad above and immediately thought "why isn't Virat Kohli in here? Why is Sachin Baby? Why is the budget at 13%?" — that's exactly the right question. The LP is doing its job correctly. The problem is upstream, in the objective design.
The optimizer maximizes sum of performance_score, where performance_score = 0.6 × strike_rate + 0.4 × (wickets / matches × 25). That second term has a small-sample problem: a bowler who's played 3 matches and taken 4 wickets has wickets / matches × 25 = 33. The LP doesn't know to distrust low-sample players, so it picks them — they're cheap, the score is inflated, and the constraints are still satisfied.
The fix is two lines of code: apply a minimum-games filter to the eligible set, and replace the LP objective with the full Impact Score from Part 1. Both ship in V2. The bug is in the writeup because knowing why the LP found the wrong squad is more valuable than pretending it found the right one.
Beyond the LP objective bug above, the realistic gaps between this and a production-grade franchise tool.
Full notebook on GitHub — the Impact Score, the LP formulation, the solver output, the squad composition charts.