Optimal Spectrum Scheduling in Cognitive Wireless Mesh Networks