memoized edge_connectivity