Success in chess is all about anticipation — you have to plan your moves by guessing what your opponent will do. Now scientists are taking a page from Bobby Fischer’s book to fight a wily foe: drug-resistant staph bacteria, which stymies drug therapies with its swift mutation strategy. Researchers led by Bruce Donald, a professor of computer science and biochemistry at Duke University, are using a computer algorithm to predict MRSA’s next move.

Some bacteria, including MRSA (methicillin-resistant Staphylococcus aureus), evolve mutations to change the shape of the active site of their enzymes, which is what antibiotics are after. The algorithm, called K* (pronounced K-star), tries to anticipate those changes.

The team modeled mutations in an MRSA enzyme called dihydrofolate reductase, which is targeted by several drugs. Almost every living thing has a version of DHFR, because it helps turn folic acid into thymidine, the “T” among the DNA nucleotides.

The K* algorithm helped the researchers find DHFR mutation candidates that would be able to block new antibiotics. This knowledge could be incorporated into a drug-design strategy — anticipating how bacteria would mutate to fight antibiotics, and designing antibiotics around those predicted mutations.

When the team studied the mutant enzymes, they realized their structures were one reason why they were able to evade antibiotics, according to a Duke news release.

Donald’s team has also studied using the K* algorithm to diagnose cancer and to design enzymes that could improve antibiotics’ efficacy.