def show_partition_types(n,k): G = [] Cn = graphs.CycleGraph(n) for edges in combinations_iterator(filter(lambda (x,y): abs(x-y) % (n-1) > 1, combinations_iterator(range(n), 2)), k): g = Cn.copy() g.add_edges(edges) G.append(g)
def dimension_of_span(n, k): dim_counts = {} for rays in combinations_iterator(all_ray_matrices(n), k): kers = [r.image() for r in rays] dim = reduce(lambda x,y: x.intersection(y), kers).dimension() dim_counts[dim] = dim_counts.get(dim,0) + 1 return dim_counts