Skip to content

Commit bce2677

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 bce2677

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,29 @@ 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> IsomorphismDigraphs(Digraph(Graph(D)), D) <> fail;
518+
true
519+
gap> OnDigraphs(D, IsomorphismDigraphs(Digraph(Graph(D)), D)) = D;
520+
true
521+
gap> D := CompleteBipartiteDigraph(5, 1);
522+
<immutable complete bipartite digraph with bicomponent sizes 5 and 1>
523+
gap> AutomorphismGroup(D) = SymmetricGroup([1 .. 5]);
524+
true
525+
gap> D := CompleteBipartiteDigraph(1, 1);
526+
<immutable complete digraph with 2 vertices>
527+
gap> AutomorphismGroup(D) = Group([(1, 2)]);
528+
true
529+
gap> D := CompleteBipartiteDigraph(3, 3);
530+
<immutable complete bipartite digraph with bicomponents of size 3>
531+
gap> AutomorphismGroup(D)
532+
> = Group([(1, 2, 3), (1, 2), (4, 5, 6), (4, 5), (1, 4)(2, 5)(3, 6)]);
533+
true
534+
512535
#
513536
gap> DIGRAPHS_StopTest();
514537
gap> STOP_TEST("Digraphs package: testinstall.tst", 0);

0 commit comments

Comments
 (0)