Social distancing versus early detection and contacts tracing in epidemic management