Algorithms and analysis of scheduling for loops with minimum switching. (5th June 2006)