Gerrymandering — the manipulation of district boundaries to give one group a political advantage — is not part of anyone’s idea of democracy. Although it is difficult to define gerrymandering precisely, the contorted shapes of electoral districts defy simple explanation and imbue a public perception of a rigged system. And when, as in Pennsylvania in 2014, a party captures 72% of its US House of Representatives seats with only 55.5% of the statewide vote, suspicions are piqued.

Thus this week’s decision by the Supreme Court, which all but squelched hopes for a manageable standard ahead of the 2020 redistricting cycle, is unwelcome news for those who anticipated that the court would take a forceful lead in curtailing partisan gerrymandering. However, even with such a standard for detecting gerrymanders, politicians have shown us that they are extremely savvy when it comes to circumventing legal constraints.

An ounce of prevention is worth a pound of cure. I argue that the means of such prevention lies not with the courts but in technological advances, as long as we are mindful of Supreme Court Justice Anthony Kennedy’s admonishment in 2004 that, for partisan gerrymandering, “technology is both a threat and a promise”.

In the United States, electoral districts are redrawn every ten years. In more than two-thirds of the states, partisan legislators control congressional redistricting. A proliferation of software that emerged about 30 years ago has facilitated the drawing of electoral maps that simultaneously entrench power while meticulously adhering to legal districting practices. Worse, current redistricting software requires experts with political and legal savvy, who generally work in secret behind closed doors. Hence, the software has served only to advance the threat of technology in redistricting.

We must now work to enable its promise.

I develop statistical and computational models that intelligently extract information. My research uses the world’s fastest supercomputers in the service of social progress. For redistricting, this means devising efficient algorithms that make quadrillions of calculations per second on highly sophisticated computing architectures to explore how best to ensure fairness in electoral maps.

The task of redistricting is well suited for computational algorithms because the goals can be articulated clearly, performance metrics can be specified easily and the tasks are distinct and structured. Moreover, computational algorithms are able to present a wide array of possibilities that capture the interests of diverse societal groups. Perhaps most importantly, computers are impervious to the lure of power.

Because our collective voice is composed of the individual voices of many distinct and diverse groups, political fairness is a complex phenomenon. It requires compromise and balancing competing interests so that members of all groups (racial and ethnic minorities, labour unions, all socio-economic levels and so forth) are represented.

Citizens and interest groups can articulate what political fairness means to them, but they lack the legal and political expertise to translate their goals into actual electoral maps, so their voices are easily muted. This is where intelligent computational algorithms can play a part. They can search for possible maps that simultaneously adhere to legal thresholds (for example, compactness, representation of minority groups, percentage of split municipal subdivisions) while fulfilling criteria from partisan groups and non-partisan ones, such as the League of Women Voters, and Common Cause, which promote competitive voting districts, and groups such as the American Civil Liberties Union, whose mission it is to protect the civil rights of all Americans. Algorithms could amalgamate these wide and varied interests to identify electoral maps that are acceptable to a broad swathe of society.

Technological innovation could supply missing information that is highly significant for improving democratic society. Maps that encompass competing interests must be made central to redistricting discussions and deliberation by politicians and independent commissions.

Of course, algorithms can themselves embody bias. Concerns include well-publicized issues around ‘predictive-policing’ programs (see Nature 558, 357–360; 2018) that aim to determine who is at risk of reoffending; these can unfairly penalize African Americans. In the case of redistricting, however, the algorithms are not making decisions, but fostering more-inclusive conversations. The criteria are supplied by diverse groups with valid competing interests. These maps do not become law in secret, but set the stage for deliberative democracy. Humans are free to reject and modify them as they see fit.

That is why my colleague, Yan Liu, and I have been developing PEAR (Parallel Evolutionary Algorithm for Redistricting), a computational algorithm that integrates Supreme Court mandates and carries out intelligent analysis to identify legally viable maps that satisfy an array of specific goals. (PEAR is tailored for the United States, but the core ideas of exploring redistricting possibilities transfer easily to other locales.) Our hope is to move technological advances in the direction of supplying objective information that empowers the inclusion of diverse societal groups and enhances human deliberation.

So far, technology for redistricting has led only to the exclusion and isolation of power. Moving forward, we must harness the power of technology to ensure democracy. The promise of technology is to augment human capabilities to engage in productive, inclusive and contemplative decision-making about how society is governed.