Variable Partitioning for Distributed Optimization