Ticket #14547: trac_14547_review.patch

File trac_14547_review.patch, 1.6 KB (added by chapoton, 7 years ago)
  • sage/graphs/generators/smallgraphs.py

    # HG changeset patch
    # User Frederic Chapoton <chapoton at math.univ-lyon1.fr>
    # Date 1373274887 -7200
    # Node ID 58cafce80e500fe638e65fedd35161fb4b4fccd1
    # Parent  a00210b2da29b6dc9b9c29759812499439883dae
    trac 14547 review patch for mclaughlin graph
    
    diff --git a/sage/graphs/generators/smallgraphs.py b/sage/graphs/generators/smallgraphs.py
    a b def McLaughlinGraph(): 
    28222822    from sage.sets.set import Set
    28232823
    28242824    blocks = WittDesign(23).blocks()
    2825     blocks = map(Set,blocks)
    2826     B = [b for b in blocks if     0 in b]
     2825    blocks = map(Set, blocks)
     2826    B = [b for b in blocks if 0 in b]
    28272827    C = [b for b in blocks if not 0 in b]
    28282828    g = graph.Graph()
    28292829    for b in B:
    28302830        for x in range(23):
    28312831            if not x in b:
    2832                 g.add_edge(b,x)
     2832                g.add_edge(b, x)
    28332833
    28342834    for b in C:
    28352835        for x in b:
    2836             g.add_edge(b,x)
    2837 
    2838     for b,bb in combinations(B,2):
    2839         if len(b&bb) == 1:
    2840             g.add_edge(b,bb)
    2841 
    2842     for c,cc in combinations(C,2):
    2843         if len(c&cc) == 1:
    2844             g.add_edge(c,cc)
     2836            g.add_edge(b, x)
     2837
     2838    for b, bb in combinations(B, 2):
     2839        if len(b & bb) == 1:
     2840            g.add_edge(b, bb)
     2841
     2842    for c, cc in combinations(C, 2):
     2843        if len(c & cc) == 1:
     2844            g.add_edge(c, cc)
    28452845
    28462846    for b in B:
    28472847        for c in C:
    2848             if len(b&c) == 3:
    2849                 g.add_edge(b,c)
     2848            if len(b & c) == 3:
     2849                g.add_edge(b, c)
    28502850
    28512851    g.relabel()
    28522852    g.name("McLaughlin")