Skip to content
Snippets Groups Projects
Select Git revision
  • a3c2c052e437fd1ab54fabd086f761282c24a05e
  • devel default
  • master
  • fo
  • jirka/typing
  • fo-base
  • mj/submit-images
  • jk/issue-96
  • jk/issue-196
  • honza/add-contestant
  • honza/mr7
  • honza/mrf
  • honza/mrd
  • honza/mra
  • honza/mr6
  • honza/submit-images
  • honza/kolo-vs-soutez
  • jh-stress-test-wip
  • shorten-schools
19 results

email.py

Blame
  • cdc_5_boundaries.py 1.37 KiB
    #!/usr/bin/python
    
    """
    Calculate a lower bound on the number of 4-boundaries
    of a linear representation of the number of circuit double
    covers.
    
    It uses cyclic ladder gadgets with sizes 2 up to 7 with
    permutations of all half-edges except the first one.
    This gives matrix of size 36 with rank 21.
    """
    
    import sys, os
    sys.path.append(os.path.dirname(__file__) + "/..")
    
    from itertools import permutations
    from graph_tools.all import *
    
    
    def LadderGadget(k):
      g = CyclicLadder().gadget(k)
      return Gadget.join([g, CUBIC_VERTEX], [((1, 1), (2, 1))],
        [(2,2), (2,3), (1,2), (1,3), (1,4)])
    
    ladders = list(map(LadderGadget, range(2, 8)))
    gadgets = [ l.permute((1,) + p) 
      for l in ladders for p in permutations([2, 3, 4, 5])  ] + [
      l.permute((3,) + p) for l in ladders for p in permutations([1, 2, 4, 5])  ] + [
      l.permute((4,) + p) for l in ladders for p in permutations([1, 2, 3, 5])  ] + [
      l.permute((5,) + p) for l in ladders for p in permutations([1, 2, 3, 4])  ]
    
    M = parameter_matrix(CircuitDoubleCover, gadgets, threads=None)
    pivot_rows = M.pivot_rows()
    
    J = edge_model_join_matrix(CircuitDoubleCover, 5, threads=None)
    
    if __name__ == "__main__":
      print("Circuit double covers -- 5-boundaries:")
      print("Matrix of size %i with rank %i" % (M.nrows(), M.rank()))
      print("  Pivot rows: %s" % (pivot_rows,))
      print("Upper bound: Join matrix of size %i with rank %i" % (J.nrows(), J.rank()))