One of the things that fascinates me about hockey is how some players seem to find chemistry together while others do not. If you follow my game recaps, my player-with-player matrices try to tell the story of just that — they’re a microcosm of who had success together in a certain game, while who didn’t. A coach really only has a few levers to pull in any given game. One of the primary ones is which players to play together. I’ve had a nagging feeling that if a coach concentrated on compiling his lines to maximize their efficiency, you could squeeze out a few extra percentage points of Corsi just by finding a team’s optimal chemistry. This weekend, I’ve set out to prove just that.
I’ll again use the tenants of operations research, a discipline I laid out in more detail recently while optimizing the league’s divisional alignment. My objective is to create a lineup which maximizes the average player-with-player Corsi of each line and each defensive pairing. I’ll use integer mathematical programming, and use Excel to set up my calculations.
To start, I needed a massive player-with-player matrix to cover the entire season. I completed this part of the analysis yesterday using stats from http://stats.hockeyanalysis.com. To be included in my matrix, two players needed to have played at least 9 minutes of play together, good for about 10 shifts or so. This doesn’t sound like a lot, but a very small minority of players are close to that — with half a season gone most of the roster has been able to play a decent chuck of time with each other. The only data I need to add beyond this season was Ales Hemsky and Shawn Horcoff’s Corsi together, for which I used last year’s data as they hadn’t played enough time together this year to use.
So, what next?
- We have to set up a decision matrix that will allow my model to choose which players should play in which lineup spot. It’s constrained to be binary, meaning a ’1′ shows the model has selected a player in that lineup spot, and a ’0′ meaning it hasn’t.
- We then need to set up a line combination table that tabulates the results from the decision matrix to show which players are on each line together
- Finally we need to set up a calculation table, that takes the data from the line combination table and the player-with-player matrix to display how each player has done with his proposed linemates by averaging the Corsi they’ve displayed together. I then average the Corsi of each line and defensive pairing’s averages to come up a projection of how the model expects a line to perform. My ultimate objective function is then one average of all of these averages, which I set the model to maximize.
I then used my Premium Solver Platform Excel Add-In to maximize this objective function (the average Corsi of the lines and defensive pairings) to find the optimal arrangement of players. With 24 players included, the model would obviously leave 6 players out of its lineup to get to 18 skaters — we would be able to see which players are surplus to the roster.
I had to set the following parameters:
- I input positional constraints so that only certain players could be chosen for certain positions. For instance, defencemen could only be chosen to fill a defensive spot on the roster. Magnus Paajarvi could play either left or right wing. Jordan Eberle could only play right wing. Smytty could play basically anywhere.
- The first line needed to have an average Corsi higher than the 2nd line, etc. This way would could get a sense of what the true ‘line’ order is in terms of who pushes play.
- I told the model that Justin Schultz had to be included in the lineup. In early runs of Solver, it wanted to leave him out of the lineup due to a high Corsi shared by Potter and Nick Schultz. Justin struggled with anyone away from Nick Schultz, so I constrained the model to say Justin had to play.
- Each player could only be picked once for any lineup spot, therefore Taylor Hall couldn’t play on two lines, etc.
- Each lineup spot needed to be filled. We couldn’t just NOT have a fourth line, though I’m sure the model would be tempted to.
I’ll show you the results by table.
This is the decision table. The blue cells are the ones I allowed the model to change to either 1 or 0. Therefore the white cells are ones that were out of scope in that a player couldn’t play those positions. You can also see the 1′s in this table where the model has selected a player to play.
Here’s the line table. This allows my model to know who’s playing together on each line.
This table calculates how each player has done with his proposed linemates this year by using the season player-with-player matrix. The averages of each line are in the bottom row. The objective function that I maximized was the ‘Total Average’ cell, which is an average of the Line Averages.
All of this results in a proposed lineup of:
Right off, you can see that the model has left Petrell, Eager, Brown, VandeVelde, Potter, and Peckham off the roster from our original list — which is saying something if the optimal 4th line has a Corsi together of 43.1% and your bottom pairing has 44.7% together.
Not surprisingly, the top line stays intact and is the primary puck possession line on the team. The second line sees Paajarvi play with Sam Gagner and Nail Yakupov. Paajarvi has done well wherever he’s played, but has had the ability to elevate Sam Gagner’s play where it has lacked otherwise. The return of Shawn Horcoff can’t come soon enough, as this proposed third line with Hartikainen and Ales Hemsky would certainly be able to take on some tough competition to shelter that 2nd line a bit. The fourth line sees veterans Smytty, Belanger, and Jones just barely keeping their heads above replacement level. With the forward depth of this team in tatters, that is literally the best we can do.
The defence pairings probably aren’t all that surprising. The Schultz are paired together, along with Smid & Petry. These two pairs have been mainstays all year, though their results haven’t exactly been fantastic. For the third pairing, the model has chosen Ryan Whitney and Mark Fistric, whose percentage together actually is ahead of Smid and Petry’s.
So what kind of performance bump could this team see using this optimal lineup? We’re currently dead last in even strength Corsi as a team, at 44.6%. The model suggests quite a bit:
I’ve taken the Corsi’s of each line and then weighted them arbitrarily to reflect how much ice time they will receive. The first line will have more time on ice to manifest their 54.4% Corsi than the 4th line will receive to show their 43.1%.
The potential team Corsi using this lineup is 49.5%. Still not gangbusters, but good for 18th in the league. It’s 4.9% higher than the current team is doing with the whacky line combos and sub-replacement level players drawing in.
We don’t have a contending team by any stretch of the imagination, but we could be a LOT better. That is, if we believe in facts.