Algorithmic Solutions for Optimal Switching Problems