An efficient policy for curing epidemics on graphs