This paper analyzes the optimal partisan and bipartisan gerrymandering policies in a model with electoral competitions in policy positions and transfer promises. With complete freedom in redistricting, partisan gerrymandering policy generates the most one-sidedly biased district profile, while bipartisan gerrymandering generates the most polarized district profile. In contrast, with limited freedom in gerrymandering, both partisan and bipartisan gerrymandering tend to prescribe the same policy. Friedman and Holden (2009) find no significant empirical difference between bipartisan and partisan gerrymandering in explaining incumbent reelection rates. Our result suggests that gerrymanderers may not be as free in redistricting as popularly thought.