Algorithmically finding ways to synthesize new medicine