A genetic algorithm to evaluate the effect of topology on network resilience