Generating all spanning trees of a connected, undirected graph using the contraction-deletion algorithm.
A spanning tree of a connected, undirected graph is a subgraph that is a tree and includes all of the vertices of the original graph. In other words, it is a subset of the original graph, which forms a tree that includes all the vertices of the original graph with a minimum possible number of edges. If you find this code useful, please cite the following article that contains the information about the used algorithm:
Tag, M. A., & Mansour, M. E. (2019). Automatic computing of the grand potential in finite temperature many-body perturbation theory. International Journal of Modern Physics C, 30(11), 1950100.