The present paper reports the structures and the third order nonlinear optical properties of four coordination polymers prepared by hydrothermal methods using nickel acetate or cobalt acetate, bisimidazolyl ligands and different aromatic carboxylic acids, namely [Co(H2O)2(1,2-BIB)2](Co(DBS)(1,2-BIB)]2·7H2O (1), [Ni(H2O)2(1,2-BIB)](CBA)·H2O (2), [Ni(1,2-BIB)(SDA)]·4H2O (3) and [Ni(H2O)(1,2-BIB)(HBTA)]·2H2O (4) (1,2-BIB = 1,2-bis((1H-imidazol-1-yl)methyl)benzene, H2DBS = sodium 3,5-dicarboxybenzenesulfonate, H2CBA = 2-(carboxymethyl)benzoic acid, H2SDA = 4,4′-sulfonyldibenzoic acid and H3BTA = benzene-1,3,5-tricarboxylic acid). Compound 1 has a one-dimensional structure, containing a polymeric cationic chain and a polymeric anionic chain. In compound 2, the Ni(II) ions are alternately linked by 1,2-BIB ligands and CBA ligands to form a joint-like chain structure. In compound 3, the metal ions are connected by 1,2-BIB to form a ladder-like structure, and SDA ligands are located on both sides of the chain. In compound 4, the Ni(II) ions are alternately connected by 1,2-BIB and BTA ligands to form a two-dimensional structure. We investigated the third-order nonlinearity of the compounds by a single-beam Z-scan technique. Interestingly, the compounds exhibit different third-order nonlinearities. Compound 1 has a saturable absorption (SA) and a self-defocusing effect with the nonlinear absorption coefficient β being -12.4 × 10-7 m W-1 and the nonlinear refractive index γ being -8.51 × 10-14 m² W-1. Compound 2 presents only a selfdefocusing effect with the nonlinear refractive index γ being -128.87 × 10-14 m² W-1, while compounds 3 and 4 show a reverse-saturation absorption (RSA) effect with the nonlinear absorption coefficient β being 4.42 × 10-7 and 2.97 × 10-7 m W-1, respectively. We calculated the band structure and the total (TDOS) and partial density of states (PDOS) of the four compounds. The calculated results are satisfactory for explaining the experimental results. This shows that intramolecular MLCTs or LMCTs have a significant impact on the third-order nonlinearity of the compounds. [ABSTRACT FROM AUTHOR]