The maximization of distributed generation (DG) hosting capacity that takes into account network configuration is a complex, non-linear combinatorial optimization problem. The search space of the configurations becomes massively large in practical-size networks with several hundreds of switches. For this reason, no existing method can handle such large-scale networks. In this paper, we propose a novel exact solution method. Our method consists of two stages. In the first stage, the method divides the entire problem into a set of small subproblems. In the second stage, it converts all subproblems into a compressed data structure called a zero-suppressed binary decision diagram (ZDD), which expresses the combinatorial sets compactly. The proposed method avoids any combinatorial explosion by using the ZDD to enable operations of the weighted combinatorial item sets. We conducted experiments on a large-scale network with 235 switches. As a result, our method obtained the global optimal solution in 49 hours.