The Bergman cyclizations of the enediyne and its four N-substituted analogs [(Z)-pent-2-en-4-ynenitrile, 3-azahex-3-en-1,5-diyne, malenotrile, and 3,4-azahex-3-en-1,5-diyne] have been studied using the complete active space self-consistent field and multiconfigurational second-order perturbation theory methods in conjunction with the atomic natural orbital basis sets. The geometries and energies of the reactants, transition states, and products along both the S(0) (the ground state) and T(1) (the lowest-lying triplet state) potential energy surfaces (PESs) were calculated. The calculated geometries are in good agreement with the available experimental data. The distance between two terminal carbons in enediyne, which was considered as an important parameter governing the Bergman cyclization, was predicted to be 4.319 Å, in agreement with the experimental value of 4.321 Å. Our calculations indicate that the replacements of the terminal C atom(s) or the middle C atom(s) in the C=C bond by the N atom(s) increase or decrease the energy barrier values, respectively. There exist stable ring biradical products on the T(1) PESs for the five reactions. However, on the S(0) PESs the ring biradical products exist only for the reactions of enediyne, (Z)-pent-2-en-4-ynenitrile, and 3-azahex-3-en-1,5-diyne.