Skip to content

Commit 30ac2d7

Browse files
james-d-mitchellMurray Whyte
andauthored
Add IsModularLatticeDigraph (#629)
* Add IsModularLatticeDigraph * Add IsModularLatticeDigraph * Add documentation and tests --------- Co-authored-by: Murray Whyte <mw231@st-andrews.ac.uk>
1 parent f4c601e commit 30ac2d7

5 files changed

Lines changed: 78 additions & 6 deletions

File tree

doc/prop.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,40 @@ false]]></Example>
13341334
</ManSection>
13351335
<#/GAPDoc>
13361336

1337+
<#GAPDoc Label="IsModularLatticeDigraph">
1338+
<ManSection>
1339+
<Prop Name="IsModularLatticeDigraph" Arg="digraph"/>
1340+
<Returns><K>true</K> or <K>false</K>.</Returns>
1341+
<Description>
1342+
<C>IsModularLatticeDigraph</C> returns <K>true</K> if the digraph
1343+
<A>digraph</A> is a <E>modular lattice digraph</E>.<P/>
1344+
1345+
A <E>modular lattice digraph</E> is a <E>lattice digraph</E>
1346+
(<Ref Prop="IsLatticeDigraph"/>) which is modular. That is to say,
1347+
the <E>lattice digraph</E> representing <M>N5</M> is not
1348+
embeddable as a lattice
1349+
(see <URL>https://en.wikipedia.org/wiki/Modular_lattice</URL> and
1350+
<Ref Prop="IsLatticeEmbedding"/>).
1351+
1352+
&MUTABLE_RECOMPUTED_PROP;
1353+
1354+
<Example><![CDATA[
1355+
gap> D := ChainDigraph(5);
1356+
<immutable chain digraph with 5 vertices>
1357+
gap> D := DigraphReflexiveTransitiveClosure(D);
1358+
<immutable preorder digraph with 5 vertices, 15 edges>
1359+
gap> IsModularLatticeDigraph(D);
1360+
true
1361+
gap> N5 := Digraph([[2, 3], [4], [4], []]);
1362+
<immutable digraph with 4 vertices, 4 edges>
1363+
gap> DigraphReflexiveTransitiveClosure(N5);
1364+
<immutable preorder digraph with 4 vertices, 9 edges>
1365+
gap> IsModularLatticeDigraph(N5);
1366+
false
1367+
]]></Example>
1368+
</Description>
1369+
</ManSection>
1370+
<#/GAPDoc>
13371371

13381372
<#GAPDoc Label="IsPreorderDigraph">
13391373
<ManSection>

doc/z-chap5.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<#Include Label="DigraphMeetTable">
3737
<#Include Label="IsUpperSemimodularDigraph">
3838
<#Include Label="IsDistributiveLatticeDigraph">
39+
<#Include Label="IsModularLatticeDigraph">
3940
</Section>
4041

4142
<Section><Heading>Regularity</Heading>

gap/prop.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ DeclareProperty("IsJoinSemilatticeDigraph", IsDigraph);
5151
DeclareProperty("IsMeetSemilatticeDigraph", IsDigraph);
5252
DeclareProperty("IsPermutationDigraph", IsDigraph);
5353
DeclareProperty("IsDistributiveLatticeDigraph", IsDigraph);
54+
DeclareProperty("IsModularLatticeDigraph", IsDigraph);
5455
DeclareSynonymAttr("IsLatticeDigraph",
5556
IsMeetSemilatticeDigraph and IsJoinSemilatticeDigraph);
5657
DeclareSynonymAttr("IsPreorderDigraph",

gap/prop.gi

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -661,19 +661,28 @@ end);
661661

662662
InstallMethod(IsDistributiveLatticeDigraph, "for a digraph", [IsDigraph],
663663
function(D)
664-
local N5, M3;
664+
local M3;
665+
665666
if not IsLatticeDigraph(D) then
666667
return false;
667668
fi;
668669

669-
N5 := DigraphReflexiveTransitiveClosure(
670-
Digraph([[2, 4], [3], [5], [5], []]));
671670
M3 := DigraphReflexiveTransitiveClosure(
672671
Digraph([[2, 3, 4], [5], [5], [5], []]));
673672

674-
if LatticeDigraphEmbedding(N5, D) <> fail or
675-
LatticeDigraphEmbedding(M3, D) <> fail then
673+
return IsModularLatticeDigraph(D) and
674+
LatticeDigraphEmbedding(M3, D) = fail;
675+
end);
676+
677+
InstallMethod(IsModularLatticeDigraph, "for a digraph", [IsDigraph],
678+
function(D)
679+
local N5;
680+
if not IsLatticeDigraph(D) then
676681
return false;
677682
fi;
678-
return true;
683+
684+
N5 := DigraphReflexiveTransitiveClosure(
685+
Digraph([[2, 4], [3], [5], [5], []]));
686+
687+
return LatticeDigraphEmbedding(N5, D) = fail;
679688
end);

tst/standard/prop.tst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,33 @@ gap> D := DigraphReflexiveTransitiveClosure(D);
13301330
gap> IsDistributiveLatticeDigraph(D);
13311331
true
13321332

1333+
# IsModularLatticeDigraph
1334+
gap> D := Digraph([[11, 10], [], [2], [2], [3], [4, 3], [6, 5], [7], [7],
1335+
> [8], [9, 8]]);
1336+
<immutable digraph with 11 vertices, 14 edges>
1337+
gap> D := DigraphReflexiveTransitiveClosure(D);
1338+
<immutable preorder digraph with 11 vertices, 60 edges>
1339+
gap> IsModularLatticeDigraph(D);
1340+
true
1341+
gap> D := ChainDigraph(10);
1342+
<immutable chain digraph with 10 vertices>
1343+
gap> D := DigraphReflexiveTransitiveClosure(D);
1344+
<immutable preorder digraph with 10 vertices, 55 edges>
1345+
gap> IsModularLatticeDigraph(D);
1346+
true
1347+
gap> D := Digraph([[2, 4], [3, 5], [9], [5, 6], [7], [7, 8], [9], [9], []]);
1348+
<immutable digraph with 9 vertices, 12 edges>
1349+
gap> D := DigraphReflexiveTransitiveClosure(D);
1350+
<immutable preorder digraph with 9 vertices, 34 edges>
1351+
gap> IsModularLatticeDigraph(D);
1352+
false
1353+
gap> M3 := Digraph([[2, 3, 4], [5], [5], [5], []]);
1354+
<immutable digraph with 5 vertices, 6 edges>
1355+
gap> M3 := DigraphReflexiveTransitiveClosure(M3);
1356+
<immutable preorder digraph with 5 vertices, 12 edges>
1357+
gap> IsModularLatticeDigraph(M3);
1358+
true
1359+
13331360
# IsPartialOrderDigraph
13341361
gap> gr := NullDigraph(5);
13351362
<immutable empty digraph with 5 vertices>

0 commit comments

Comments
 (0)