@@ -67,8 +67,8 @@ cdef extern from "bliss_cpp/bliss_find_automorphisms.h":
67
67
68
68
cdef int encoding_numbits(int n):
69
69
r """
70
- Return the number of bits needed to encode the ``n`` numbers from ``1`` to ``n`` . In
71
- other words, the last bit set in ``n` `.
70
+ Return the number of bits needed to encode the `n` numbers from `1` to
71
+ `n` . In other words, the last bit set in `n `.
72
72
"""
73
73
if n <= 0 :
74
74
return 0
@@ -480,9 +480,9 @@ cpdef canonical_form(G, partition=None, return_graph=False, use_edge_labels=True
480
480
sage: # needs sage. modules
481
481
sage: g1 = Graph( [(0, 1, matrix(ZZ, 2)), (0, 2, RDF.pi()), (1, 2, 'a') ])
482
482
sage: g2 = Graph( [(1, 2, matrix(ZZ, 2)), (2, 0, RDF.pi()), (0, 1, 'a') ])
483
- sage: g1can = canonical_form( g1, use_edge_labels=True) # optional - bliss
484
- sage: g2can = canonical_form( g2, use_edge_labels=True) # optional - bliss
485
- sage: g1can == g2can # optional - bliss
483
+ sage: g1can = canonical_form( g1, use_edge_labels=True) # optional - bliss
484
+ sage: g2can = canonical_form( g2, use_edge_labels=True) # optional - bliss
485
+ sage: g1can == g2can # optional - bliss
486
486
True
487
487
488
488
Check that :trac:`32395` is fixed::
@@ -666,12 +666,12 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True):
666
666
667
667
- ``G`` -- a Sage graph
668
668
669
- - ``partition`` -- ``list``(default: ``None``); a partition of the vertices
669
+ - ``partition`` -- ``list`` (default: ``None``); a partition of the vertices
670
670
of ``G`` into color classes. Defaults to ``None``, which is equivalent to
671
671
a partition of size 1.
672
672
673
- - ``use_edge_labels`` -- boolean (default: ``True``); whether to consider edge
674
- labels
673
+ - ``use_edge_labels`` -- boolean (default: ``True``); whether to consider
674
+ edge labels
675
675
676
676
EXAMPLES::
677
677
@@ -687,9 +687,9 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True):
687
687
sage: automorphism_group(D).cardinality()
688
688
2
689
689
690
- Observe that the order 12 is given by permuting the first three vertices, or the last two
691
- in the case of a graph, while only the latter two are possible in the case of a directed
692
- graph.
690
+ Observe that the order 12 is given by permuting the first three vertices, or
691
+ the last two in the case of a graph, while only the latter two are possible
692
+ in the case of a directed graph.
693
693
694
694
Partitioning the vertices into classes::
695
695
@@ -701,24 +701,23 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True):
701
701
2
702
702
sage: automorphism_group(G,partition=[[0],[1,2],[3,4]]).cardinality()
703
703
4
704
-
705
- sage: automorphism_group(G,partition=[[1,2],[0,3],[4]]).cardinality() # optional - bliss
704
+ sage: automorphism_group(G,partition=[[1,2],[0,3],[4]]).cardinality()
706
705
2
707
706
708
707
Partitioning the edges into classes::
709
708
710
- sage: G = Graph(graphs.CompleteMultipartiteGraph([8, 2]), sparse=True) # optional - bliss
711
- sage: for i,j in G.edges(labels=False, sort=False): # optional - bliss
709
+ sage: # optional - bliss
710
+ sage: G = Graph(graphs.CompleteMultipartiteGraph([8, 2]), sparse=True)
711
+ sage: for i,j in G.edges(labels=False, sort=False):
712
712
....: if 0 <= i < 3:
713
713
....: G.set_edge_label(i, j, "A")
714
714
....: if 3 <= i < 6:
715
715
....: G.set_edge_label(i, j, "B")
716
716
....: if 6 <= i < 8:
717
717
....: G.set_edge_label(i, j, "C")
718
-
719
- sage: factor(automorphism_group(G).cardinality()) # optional - bliss
718
+ sage: factor(automorphism_group(G).cardinality())
720
719
2^4 * 3^2
721
- sage: automorphism_group(G,[[0],[1],[2,3],[4,5],[6,7],[8],[9]]).cardinality() # optional - bliss
720
+ sage: automorphism_group(G,[[0],[1],[2,3],[4,5],[6,7],[8],[9]]).cardinality()
722
721
4
723
722
724
723
TESTS::
@@ -735,9 +734,9 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True):
735
734
sage: automorphism_group(G, partition=p).is_isomorphic(A)
736
735
True
737
736
738
- sage: G = graphs.CompleteMultipartiteGraph([5,7, 11])
737
+ sage: G = graphs.CompleteMultipartiteGraph([5, 7, 11])
739
738
sage: B = automorphism_group(G) # optional - bliss
740
- sage: B.cardinality() == prod(factorial(n) for n in [5,7, 11]) # optional - bliss
739
+ sage: B.cardinality() == prod(factorial(n) for n in [5, 7, 11]) # optional - bliss
741
740
True
742
741
743
742
sage: # optional - bliss
@@ -749,11 +748,14 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True):
749
748
....: G.set_edge_label(i, j, "B")
750
749
....: if 6 <= i < 8:
751
750
....: G.set_edge_label(i, j, "C")
752
- sage: automorphism_group(G).cardinality() == prod( factorial(n) for n in [3,3,2,8,8,5,2] )
751
+ sage: card = automorphism_group(G).cardinality()
752
+ sage: card == prod(factorial(n) for n in [3, 3, 2, 8, 8, 5, 2])
753
753
True
754
- sage: automorphism_group(G, use_edge_labels=False).cardinality() == prod( factorial(n) for n in [8,8,8,5,3] )
754
+ sage: card = automorphism_group(G, use_edge_labels=False).cardinality()
755
+ sage: card == prod(factorial(n) for n in [8, 8, 8, 5, 3])
755
756
True
756
- sage: automorphism_group(G,[[0 .. 7],[8 .. 11],[12 .. 28]]).cardinality() == prod( factorial(n) for n in [3,3,2,4,4,8,5] )
757
+ sage: card = automorphism_group(G, [[0 .. 7], [8 .. 11] ,[12 .. 28]]).cardinality()
758
+ sage: card == prod(factorial(n) for n in [3, 3, 2, 4, 4, 8, 5])
757
759
True
758
760
759
761
sage: # optional - bliss
@@ -781,17 +783,17 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True):
781
783
(('m','n'), ('l','m'), ('k','l'), ('j','k'), ('h','i'),
782
784
('g','h'), ('f','g'), ('d','e'), ('c','d'), ('s','t'),
783
785
('r','s'), ('q','r'), ('p','q'), ('o','p'), ('a','b'))
784
- sage: A.cardinality() == prod(factorial(n) for n in [2,3,4,5, 6])
786
+ sage: A.cardinality() == prod(factorial(n) for n in [2, 3, 4, 5, 6])
785
787
True
786
788
787
789
sage: # optional - bliss
788
790
sage: gg = graphs.CompleteGraph(5)
789
791
sage: gg.allow_loops(True)
790
- sage: gg.add_edge(0,0)
791
- sage: gg.add_edge(1,1)
792
+ sage: gg.add_edge(0, 0)
793
+ sage: gg.add_edge(1, 1)
792
794
sage: automorphism_group(gg).cardinality()
793
795
12
794
- sage: automorphism_group(gg,[[0],[1,2,3, 4]]).cardinality()
796
+ sage: automorphism_group(gg, [[0], [1, 2, 3, 4]]).cardinality()
795
797
6
796
798
"""
797
799
# We need this to convert the numbers from <unsigned int> to
0 commit comments