def generate_graph(d, n, distribution_type): ''' generic sampling function for different point sets (dimensions, distributions) ''' assert distribution_type in DATA_DISTRIBUTION_OPTIONS if distribution_type == 'uniform': return factories.create_uniform_graph(n, d) elif distribution_type == 'grid': return factories.create_grid_graph(n, d)
def main(): from highdimgraph.factories import create_grid_graph graph = create_grid_graph(2 ** 2, 2) # graph = create_uniform_graph(2, 2) #graph.create_all_lines() graph.create_random_lines() #graph.create_stabbing_lines() assert graph.lines graph.preprocess_lines() assert graph.lines import solvers.mult_weights_solver as mws mws.compute_spanning_tree(graph) plot(graph)