Optimal political districting