On the largest scales, matter in the Universe is arranged in a complex and highly connected cosmic web, consisting of high density clusters, elongated filaments, flat walls, and large, empty voids. The characteristics of this web-like structure, such as its shape and connectivity, are determined by the interplay between dark matter and dark energy. What these consist of is among the fundamental questions in cosmology. In this thesis, I try to find answers by using topological data analysis, in the form of persistent homology. Using this mathematical formalism I investigate how connections in the Universe emerge through the process of gravitational structure formation, and how the resulting intricate network of the cosmic web is influenced by dark energy.