Are ecosystem structures driven by maximizing resilience?