Skip to content

Fix of MinimalHereditarySubsetsVertex filter#1200

Closed
joe-dw wants to merge 1 commit into
semigroups:mainfrom
joe-dw:gis
Closed

Fix of MinimalHereditarySubsetsVertex filter#1200
joe-dw wants to merge 1 commit into
semigroups:mainfrom
joe-dw:gis

Conversation

@joe-dw

@joe-dw joe-dw commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

MinimalHereditarySubsetsVertex should take an input of a digraph and integer:

if IsMultiDigraph(D) then ErrorNoReturn("the 1st argument (a digraph) must not have multiple edges");

But it was previously defined with the filter

DeclareOperation("MinimalHereditarySubsetsVertex", [IsGraphInverseSemigroup, IsPosInt]);

I have changed this to require a digraph instead of a GIS

@james-d-mitchell

Copy link
Copy Markdown
Collaborator

As discussed, this is probably not the correct place to make this change. I suggest doing the following:

  1. Move the declaration ofMinimalHereditarySubsetsVertex to Digraphs
  2. Copy the function SEMIGROUPS_MinimalHereditarySubsetsVertex as the installed method for MinimalHereditarySubsetsVertex in Digraphs
  3. Modify the Semigroups gi file to look (something) like the following (but that actually works in case this does not):
if not IsBoundGlobal("MinimalHereditarySubsetsVertex") then
    BindGlobal("SEMIGROUPS_MinimalHereditarySubsetsVertex",
    function(D, v)
    local subsets, hereditary, u, out, s, a;
    if IsMultiDigraph(D) then
        ErrorNoReturn("the 1st argument (a digraph) must not have multiple edges");
    elif not (v in DigraphVertices(D)) then
        ErrorNoReturn("the 2nd argument (a pos. int.) is not a vertex of ",
                    "the 1st argument (a digraph)");
    fi;
    out := Set(OutNeighboursMutableCopy(D)[v]);
    subsets := [];
    for u in [1 .. Length(out)] do
        a := out[u];
        RemoveSet(out, a);
        hereditary := ShallowCopy(out);
        for s in out do
        UniteSet(hereditary, VerticesReachableFrom(D, s));
        od;
        if not (a in hereditary) and not (hereditary in subsets) then
        AddSet(subsets, hereditary);
        fi;
        AddSet(out, a);
    od;
    return AsSortedList(subsets);
    end);
else
    BindGlobal("SEMIGROUPS_MinimalHereditarySubsetsVertex",
    MinimalHereditarySubsetsVertex);
fi;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants