In this paper, a cooperative coevoluationary particle swarm optimization algorithm, CCMDPSO, is proposed to solve the optimization problem of triangulation of Bayesian networks. It arranges all the variables of a given Bayesian network into some groups according to the global best solution and performs optimization on these small-scale groups. The basic optimizer of CCMDPSO is an improved discrete particle swarm optimization algorithm, MDPSO. Experiments show that CCMDPSO is an effective and robust method for the triangulation problem.