Comparing the efficiency of forward and backward contact tracing