Including topology change in loop quantum gravity with topspin network formalism with application to homogeneous and isotropic cosmology