The Supreme Court is currently considering the Gill v. Whitford, the Wisconsin gerrymandering case about whether Republicans gave themselves a guaranteed GOP majority when they redrew the state’s legislative districts in 2011. A key aspect of the plaintiff’s argument is a new way to test for partisan gerrymandering — the efficiency gap. The Washington Post explains how it works:
In this imaginary state, there are 20 green voters and 30 purple voters. Even though there are more purple voters, a district plan can be drawn that stacks the odds for green lawmakers to control the state.

The partisan plan makes three cracked districts, putting four purplevoters with six green voters and making it difficult for purple candidates to win. Boundaries in a cracked district are drawn in a way that intentionally dilute the vote.

Three cracked districts
Nine purple voters are packed into the two remaining districts with one green voter, where purple candidates will easily win.

Two packed districts
To measure the efficiency gap for this plan, researchers would first count how many votes are wasted by each party. Wasted votes are those cast that do not contribute to victory.
Green candidates can win with a six-vote majority in the cracked districts, so four purple votes in each district are wasted. One green vote is wasted in the packed districts. Three purple votes are also wasted, since the purple candidate has more than the six vote-majority they need to win.

Vote cast above the simple majority needed to win
Vote cast in a district this party didn’t win
The difference between the wasted votes on each side is divided by the total number of votes to get the efficiency gap:

Wasted green votes
Wasted purple votes
2-18/100 = 16% efficiency gap benefiting the green party.
The efficiency gap measurement was created by Nicholas Stephanopoulos, a University of Chicago law professor who is representing the plaintiffs in the Wisconsin case, and Eric McGhee, political scientist at the nonpartisan Public Policy Institute of California.