Fast Matching Algorithms for Repetitive Optimization: An Application to Switch Scheduling