04 — Personal Analytics / Optimization

Impact Index + Auction Strategy

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.

DomainIPL Auctions
ApproachScoring + ILP
SolverPuLP · CBC
Player Pool543
01 / Problem

Auctions are a constrained optimization. Treat them like one.

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.

02 / Part One

A weighted, transparent Impact Score.

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.

▸ Batting Impact Score ◂
impact = 0.25 · total_runs
        + 0.25 · impact_innings  // scored 30+ in match
        + 0.15 · SR_vs_avg_SR
        + 0.15 · powerplay_runs
        + 0.15 · middle_runs
        + 0.05 · death_runs
▸ Bowling Impact Score ◂
impact = 0.30 · wickets
        + 0.20 · eco_vs_avg_eco
        + 0.15 · impact_matches  // 2+ wickets in match
        + 0.15 · powerplay_overs
        + 0.15 · middle_overs
        + 0.05 · death_overs
Top Batters by Impact
01V Kohli0.860
02S Dhawan0.747
03DA Warner0.742
04RG Sharma0.712
05SK Raina0.612
06RV Uthappa0.567
07CH Gayle0.557
08AB de Villiers0.544
09F du Plessis0.530
10AM Rahane0.529
Top Bowlers by Impact
01R Ashwin0.620
02YS Chahal0.619
03B Kumar0.612
04PP Chawla0.595
05SP Narine0.582
06DJ Bravo0.553
07SL Malinga0.534
08JJ Bumrah0.532
09A Mishra0.532
10RA Jadeja0.517
03 / Part Two

The squad as an integer program.

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.

INPUT543 playersx ∈ {0, 1}⁵⁴³ INTEGER LINEAR PROGRAM // MAXIMIZE Σ xᵢ · scoreᵢ // SUBJECT TO Σ xᵢ = 15squad size Σ xᵢ · costᵢ ≤ 95crbudget cap Σ xᵢ [overseas] ≥ 4league rule Σ xᵢ [batsman] ≥ 5role min Σ xᵢ [bowler] ≥ 5role min Σ xᵢ [allrnd] ≥ 3role min Σ xᵢ [wk] ≥ 2role min OUTPUTOptimal 15CBC · < 1s
543 binary decision variables · 1 linear objective · 7 linear constraints · solved by branch-and-bound via CBC. Search space C(543, 15) ≈ 10²⁸, but LP relaxation prunes most of it in under a second.
04 / How It Works

From ball-by-ball to auction squad.

01

Compute career stats from ball-by-ball

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.

pandasgroupbyphase tagging
02

Normalize and compute Impact Score

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.

MinMaxScalercomposite scoring
03

Join with auction price data

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.

mergefilter
04

Formulate the ILP in PuLP

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.

PuLPLpProblemLpVariable
05

Solve with CBC, get the optimum

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.

CBC solverbranch-and-bound
06

Visualize squad composition

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.

matplotlibseaborn
05 / Output

The optimal 15.

LP-selected squad
15 players · 12.55 / 95 cr · 4 overseas
Player
Role
Origin
Cost
Shubman Gill
Batsman
Indian
1.8 cr
KL Rahul
Batsman
Indian
1.0 cr
Anmolpreet Singh
Batsman
Indian
80 lakh
Joe Denly
Batsman
Overseas
1.0 cr
Sachin Baby
Batsman
Indian
10 lakh
Harbhajan Singh
Bowler
Indian
2.0 cr
Imran Tahir
Bowler
Overseas
1.0 cr
Avesh Khan
Bowler
Indian
70 lakh
Akash Deep
Bowler
Indian
20 lakh
Shivam Sharma
Bowler
Indian
10 lakh
Shakib Al Hasan
All-Rounder
Overseas
2.8 cr
Mohammad Nabi
All-Rounder
Overseas
30 lakh
Ramandeep Singh
All-Rounder
Indian
20 lakh
Ishan Kishan
Wicket Keeper
Indian
35 lakh
Dhruv Jurel
Wicket Keeper
Indian
20 lakh
06 / Honest Bug

The LP is right. The objective is wrong.

⚠ Real Bug Worth Confronting

A 12.5-crore squad under a 95-crore cap is not a strategy. It's a tell.

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.

13.2%
Of the 95-crore cap is actually used by the LP-selected squad. Real franchises spend their cap because superstar talent is disproportionately valuable — but a linear objective can't see that.
0
Players from the Impact Score top 10 in the final squad. The full Impact Score from Part 1 — which has volume weighting that would naturally penalize small-sample players — is never used by the LP objective. The two halves were built sequentially and not unified.

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.

07 / Technical Decisions

Why these choices.

Why ILP over
a heuristic?
ILP guarantees the global optimum under the constraints. A greedy "best score-to-cost ratio" heuristic can violate the role minimums or pick a feasible-but-suboptimal squad. With 543 binary variables and 7 linear constraints, the CBC solver converges in under a second via branch-and-bound — the right tool for a problem this size. RL, genetic algorithms, and simulated annealing are all overkill here.
Why hand-weighted
over learned scoring?
There's no labeled "true impact" target to train against. A learned regressor would just be predicting another proxy. A weighted composite is auditable — a coach can ask "why is Kohli at 0.86?" and you can break it down into six components with their weights visible. Honesty about non-validation: the weights weren't calibrated against MOM frequency or team-win contribution, which is the V2 work.
Why 95 crore
budget cap?
That's the actual IPL franchise auction cap. The whole point of this project is to model the real constraint set a franchise faces, not a toy version.
Why 5/5/3/2
role minimums?
Standard franchise squad composition. The minimums also sum to exactly 15, which means each role inequality binds as an equality in practice — a constraint-design choice that simplifies but also rigidifies. V2 should support strategic skews like "4 batsmen + 6 bowlers" by changing the squad-size constraint, not the role floors.
Why 30 runs
for impact innings?
Domain heuristic — roughly the threshold where a T20 innings "made a difference." Not calibrated, not learned. A 15-ball 22 that wins a chase doesn't count, which is a real limitation. The proper replacement is Win Probability Added per delivery, similar to baseball's WPA — but that requires a win-probability model as a prerequisite, which is its own project.
Why CBC
over Gurobi?
CBC is open-source, free, and more than fast enough for a problem with 543 binary variables. Gurobi would be required only at much larger scale (10⁴+ variables or hundreds of constraints) or when commercial-grade solver guarantees are needed. For this problem, CBC is the right cost-quality choice.
08 / Limitations

What this misses.

Beyond the LP objective bug above, the realistic gaps between this and a production-grade franchise tool.

01
Death weighted 0.05 is too low. Pure finishers (Dhoni, Russell, Hardik) rank lower than they should because their primary value is death overs. The 0.05 was a guard against death stats being dominated by the small subset of finishers — but the side effect is undervaluing exactly those finishers.
02
Impact Score weights are not calibrated. 0.25 / 0.25 / 0.15 / 0.15 / 0.15 / 0.05 are domain reasoning, not fit to MOM frequency or win contribution. V2 calibrates them.
03
No position-level constraints in the LP. A real franchise needs at least 2 openers, at least 1 left-arm bowler, at least 1 frontline spinner. Currently only roles are constrained.
04
No bid contestation modeling. The LP assumes you can buy any player at the listed price. Real auctions have competing bids. V2 layers a Monte-Carlo over likely auction outcomes.
05
Wides counted in batting balls_faced. Bowling correctly filters extras for economy; batting does not for balls faced. Marginal but real (~3-5% effect).
06
No captaincy / leadership constraint. Real auctions need to secure a captain.
07
No retention or right-to-match logic. Existing-squad considerations not modeled.
Version 2 — Build Order

What ships next.

  • 01Unify the two halves — use the full Impact Score as the LP objective.
  • 02Apply a minimum-games filter (≥ 30 matches) to the eligible player pool.
  • 03Calibrate Impact Score weights against MOM frequency or team-win contribution.
  • 04Add position-level constraints: openers, spinners, leftie batsmen, captain.
  • 05Rebalance death-overs weighting by normalizing per opportunity.
  • 06Layer Monte-Carlo bid contestation simulation to get realistic squad outcomes.
  • 07Fix the wides-as-balls-faced bug for batting.
Read the code / Build a squad

Auctions are linear. Treat them like one.

Full notebook on GitHub — the Impact Score, the LP formulation, the solver output, the squad composition charts.