Species dispersal mediates opposing influences of a branching network on genetic variation in a metapopulation