Skip to content

Commit df9fe88

Browse files
committed
Fix AutomorphismGroup for CompleteBipartiteDigraph(1,n)
Simply put, our code was assuming that for `DirectProduct(SymmetricGroup([1]), SymmetricGroup([2..6]))`, GAP would return `SymmetricGroup([2..6])`. But in fact, GAP returns (the isomorphic, but not identical) `SymmetricGroup([1..5])`. Resolves #850
1 parent b46c0a3 commit df9fe88

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

gap/examples.gi

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,22 @@ InstallMethod(CompleteBipartiteDigraphCons,
6868
[IsImmutableDigraph, IsPosInt, IsPosInt],
6969
function(_, m, n)
7070
local D, aut;
71+
72+
if Maximum(m, n) = 1 then
73+
return CompleteDigraph(IsImmutableDigraph, 2);
74+
fi;
75+
7176
D := MakeImmutable(CompleteBipartiteDigraph(IsMutableDigraph, m, n));
7277
SetIsSymmetricDigraph(D, true);
7378
SetDigraphNrEdges(D, 2 * m * n);
7479
SetIsCompleteBipartiteDigraph(D, true);
7580
if m = n then
76-
aut := WreathProduct(SymmetricGroup(m), Group((1, 2)));
81+
aut := WreathProduct(SymmetricGroup([1 .. m]), Group((1, m + 1)));
82+
elif m = 1 then
83+
aut := SymmetricGroup([2 .. n + 1]);
7784
else
78-
aut := DirectProduct(SymmetricGroup(m), SymmetricGroup(n));
85+
aut := DirectProduct(SymmetricGroup([1 .. m]),
86+
SymmetricGroup([m + 1 .. m + n]));
7987
fi;
8088
SetAutomorphismGroup(D, aut);
8189
SetIsPlanarDigraph(D, m <= 2 or n <= 2);

tst/testinstall.tst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,33 @@ rec( comps := [ ], id := [ ] )
509509
gap> IsConnectedDigraph(D);
510510
true
511511

512+
# Issue #850: Problems with AutomorphismGroup for CompleteBipartiteDigraph
513+
gap> D := CompleteBipartiteDigraph(1, 5);
514+
<immutable complete bipartite digraph with bicomponent sizes 1 and 5>
515+
gap> AutomorphismGroup(D) = SymmetricGroup([2 .. 6]);
516+
true
517+
gap> not DIGRAPHS_IsGrapeLoaded() or
518+
> (DIGRAPHS_IsGrapeLoaded() and
519+
> IsomorphismDigraphs(Digraph(Graph(D)), D) <> fail);
520+
true
521+
gap> not DIGRAPHS_IsGrapeLoaded() or
522+
> (DIGRAPHS_IsGrapeLoaded() and
523+
> OnDigraphs(D, IsomorphismDigraphs(Digraph(Graph(D)), D)) = D);
524+
true
525+
gap> D := CompleteBipartiteDigraph(5, 1);
526+
<immutable complete bipartite digraph with bicomponent sizes 5 and 1>
527+
gap> AutomorphismGroup(D) = SymmetricGroup([1 .. 5]);
528+
true
529+
gap> D := CompleteBipartiteDigraph(1, 1);
530+
<immutable complete digraph with 2 vertices>
531+
gap> AutomorphismGroup(D) = Group([(1, 2)]);
532+
true
533+
gap> D := CompleteBipartiteDigraph(3, 3);
534+
<immutable complete bipartite digraph with bicomponents of size 3>
535+
gap> AutomorphismGroup(D)
536+
> = Group([(1, 2, 3), (1, 2), (4, 5, 6), (4, 5), (1, 4)(2, 5)(3, 6)]);
537+
true
538+
512539
#
513540
gap> DIGRAPHS_StopTest();
514541
gap> STOP_TEST("Digraphs package: testinstall.tst", 0);

0 commit comments

Comments
 (0)