Python code for sampling and evaluating cycle covers of trees. The sections below provide brief descriptions of the code inside each script or notebook in each subfolder of Scripts.
An implementation of the FKT algorithm for constructing a Pfaffian orientation of a planar graph.
An implementation of the uniform sampling method from the paper "Random generation of combinatorial structures from a uniform distribution", by Jerrum, Valiant, and Vazirani.
An implementation of a uniform sampling method for cycle covers of planar bipartite graphs.
A method for enumerating the
An implementation of an MCMC version of the cycle basis walk on spanning trees with Metropolis-Hastings for interpolating between stars and paths.
In this notebook, a random tree
This Python script is used to compute the average running times for
This script computes the difference between the exact value of the .csv
files for each
This script computes the mean, standard deviation, and skewness of the differences computed in probabilistic_approach--uniform_sampling.py for each
This notebook generates the autocorrelation plots for uniform sampling from the tree space based on degree, maximum degree, betweenness, and closeness with
This Python script is used to generate the autocorrelation plots for
These Jupyter notebooks use statistical learning methods to classify trees (into two classes: path-like or star-like) with global betweenness centrality (Betweenness), global closeness centrality (Closeness), the Stirling numbers of the first kind (Stirling), or all three (All) as predictors. Two different data sets are used in these notebooks: The first data set (Full_Set) consists of all non-isomorphic trees of order 12 and the second data set consists of 500 non-isomorphic trees of order 18 sampled using networkx.nonisomorphic_trees
function.
These Jupyter notebooks use statistical learning methods to classify trees (into two classes: path-like or star-like) with global betweenness centrality (Betweenness), global closeness centrality (Closeness), the Stirling numbers of the first kind (Stirling). The data set used in this notebook consists of 500 trees of order 18 sampled uniformly from the space of all such trees.
Regression--{All, Subset}--{Full_Set, Sampling, Uniform_Sampling}.ipynb and Regression--Tree--{All, Subset}--{Full_Set, Sampling, Uniform_Sampling}.ipynb
These Jupyter notebooks use statistical learning methods to predict the Stirling numbers of the first kind using
These Jupyter notebooks in R create plots for comparing training and testing scores for various tree-based classification, regression and tree-based regression methods used in these notebooks in the previous set of Jupyter notebooks.
All trees of order 12 All four predictors |
A sample of trees of order 18 using `nx.nonisomorphic_trees` All four predictors |
A sample of trees of order 18 sampled uniformly All four predictors |
All trees of order 12 All four predictors |
A sample of trees of order 18 using `nx.nonisomorphic_trees` All four predictors |
A sample of trees of order 18 sampled uniformly All four predictors |
All trees of order 12 All four predictors |
A sample of trees of order 18 using `nx.nonisomorphic_trees` All four predictors |
A sample of trees of order 18 sampled uniformly All four predictors |
All the functions defined by the authors and used in the above notebooks are in this file.