@@ -18667,33 +18667,33 @@ def _color_by_label(self, format='hex', as_function=False, default_color="black"
18667
18667
We consider the Cayley graph of the symmetric group, whose edges are
18668
18668
labelled by the numbers 1,2, and 3::
18669
18669
18670
- sage: G = SymmetricGroup(4).cayley_graph()
18671
- sage: set(G.edge_labels())
18670
+ sage: G = SymmetricGroup(4).cayley_graph() # optional - sage.groups
18671
+ sage: set(G.edge_labels()) # optional - sage.groups
18672
18672
{1, 2, 3}
18673
18673
18674
18674
We first request the coloring as a function::
18675
18675
18676
- sage: f = G._color_by_label(as_function=True)
18677
- sage: [f(1), f(2), f(3)]
18676
+ sage: f = G._color_by_label(as_function=True) # optional - sage.groups
18677
+ sage: [f(1), f(2), f(3)] # optional - sage.groups
18678
18678
['#0000ff', '#ff0000', '#00ff00']
18679
- sage: f = G._color_by_label({1: "blue", 2: "red", 3: "green"}, as_function=True)
18680
- sage: [f(1), f(2), f(3)]
18679
+ sage: f = G._color_by_label({1: "blue", 2: "red", 3: "green"}, as_function=True) # optional - sage.groups
18680
+ sage: [f(1), f(2), f(3)] # optional - sage.groups
18681
18681
['blue', 'red', 'green']
18682
- sage: f = G._color_by_label({1: "red"}, as_function=True)
18683
- sage: [f(1), f(2), f(3)]
18682
+ sage: f = G._color_by_label({1: "red"}, as_function=True) # optional - sage.groups
18683
+ sage: [f(1), f(2), f(3)] # optional - sage.groups
18684
18684
['red', 'black', 'black']
18685
- sage: f = G._color_by_label({1: "red"}, as_function=True, default_color='blue')
18686
- sage: [f(1), f(2), f(3)]
18685
+ sage: f = G._color_by_label({1: "red"}, as_function=True, default_color='blue') # optional - sage.groups
18686
+ sage: [f(1), f(2), f(3)] # optional - sage.groups
18687
18687
['red', 'blue', 'blue']
18688
18688
18689
18689
The default output is a dictionary assigning edges to colors::
18690
18690
18691
- sage: G._color_by_label()
18691
+ sage: G._color_by_label() # optional - sage.groups
18692
18692
{'#0000ff': [((), (1,2), 1), ...],
18693
18693
'#00ff00': [((), (3,4), 3), ...],
18694
18694
'#ff0000': [((), (2,3), 2), ...]}
18695
18695
18696
- sage: G._color_by_label({1: "blue", 2: "red", 3: "green"})
18696
+ sage: G._color_by_label({1: "blue", 2: "red", 3: "green"}) # optional - sage.groups
18697
18697
{'blue': [((), (1,2), 1), ...],
18698
18698
'green': [((), (3,4), 3), ...],
18699
18699
'red': [((), (2,3), 2), ...]}
@@ -18702,12 +18702,12 @@ def _color_by_label(self, format='hex', as_function=False, default_color="black"
18702
18702
18703
18703
We check what happens when several labels have the same color::
18704
18704
18705
- sage: result = G._color_by_label({1: "blue", 2: "blue", 3: "green"})
18706
- sage: sorted(result)
18705
+ sage: result = G._color_by_label({1: "blue", 2: "blue", 3: "green"}) # optional - sage.groups
18706
+ sage: sorted(result) # optional - sage.groups
18707
18707
['blue', 'green']
18708
- sage: len(result['blue'])
18708
+ sage: len(result['blue']) # optional - sage.groups
18709
18709
48
18710
- sage: len(result['green'])
18710
+ sage: len(result['green']) # optional - sage.groups
18711
18711
24
18712
18712
"""
18713
18713
if format is True:
@@ -21599,10 +21599,10 @@ def relabel(self, perm=None, inplace=True, return_map=False, check_input=True, c
21599
21599
Relabeling using a Sage permutation::
21600
21600
21601
21601
sage: G = graphs.PathGraph(3)
21602
- sage: from sage.groups.perm_gps.permgroup_named import SymmetricGroup
21603
- sage: S = SymmetricGroup(3)
21604
- sage: gamma = S('(1,2)')
21605
- sage: G.relabel(gamma, inplace=False).am()
21602
+ sage: from sage.groups.perm_gps.permgroup_named import SymmetricGroup # optional - sage.groups
21603
+ sage: S = SymmetricGroup(3) # optional - sage.groups
21604
+ sage: gamma = S('(1,2)') # optional - sage.groups
21605
+ sage: G.relabel(gamma, inplace=False).am() # optional - sage.groups
21606
21606
[0 0 1]
21607
21607
[0 0 1]
21608
21608
[1 1 0]
@@ -22537,21 +22537,21 @@ def is_isomorphic(self, other, certificate=False, verbosity=0, edge_labels=False
22537
22537
22538
22538
Graphs::
22539
22539
22540
- sage: from sage.groups.perm_gps.permgroup_named import SymmetricGroup
22540
+ sage: from sage.groups.perm_gps.permgroup_named import SymmetricGroup # optional - sage.groups
22541
22541
sage: D = graphs.DodecahedralGraph()
22542
22542
sage: E = copy(D)
22543
- sage: gamma = SymmetricGroup(20).random_element()
22544
- sage: E.relabel(gamma)
22543
+ sage: gamma = SymmetricGroup(20).random_element() # optional - sage.groups
22544
+ sage: E.relabel(gamma) # optional - sage.groups
22545
22545
sage: D.is_isomorphic(E)
22546
22546
True
22547
22547
22548
22548
::
22549
22549
22550
22550
sage: D = graphs.DodecahedralGraph()
22551
- sage: S = SymmetricGroup(20)
22552
- sage: gamma = S.random_element()
22553
- sage: E = copy(D)
22554
- sage: E.relabel(gamma)
22551
+ sage: S = SymmetricGroup(20) # optional - sage.groups
22552
+ sage: gamma = S.random_element() # optional - sage.groups
22553
+ sage: E = copy(D) # optional - sage.groups
22554
+ sage: E.relabel(gamma) # optional - sage.groups
22555
22555
sage: a,b = D.is_isomorphic(E, certificate=True); a
22556
22556
True
22557
22557
sage: from sage.graphs.generic_graph_pyx import spring_layout_fast
0 commit comments