Constructing minimal supplements with GAP The problem is this: 

Suppose we are given a finite group $G$ and a normal subgroup $N$ of $G$ which is not contained in $\Phi(G)$. Call a subgroup $H$ of $G$ a minimal supplement for $N$ (in $G$) if $G=NH$ and $G>NM$ for every proper subgroup $M$ of $H$. Given, $G$, $N$, what is an efficient way of constructing a minimal supplement for $N$ in $G$ with GAP?

I'd appreciate any ideas.
 A: This is a difficult problem in general.
One method that should work for moderately sized groups is to start by finding representatives of the conjugacy classes of maximal subgroups of $G$ using the function $\mathtt{ConjugacyClassesMaximalSubgroups}$. Then create a list $\mathtt{L}$ say of those maximal subgroup representatives that do not contain $N$. Since you are assuming that $N \not\le \Phi(G)$, the list $\mathtt{L}$ will be nonempty.
Now repeat the following process. Find representatives of the conjugacy classes of maximal subgroups of $\mathtt{L[1]}$, and make a list $\mathtt{LL}$ of those groups in $\mathtt{L}$ that supplement $N$. If $\mathtt{LL}$ is nonempty then replace $\mathtt{L}$ by $\mathtt{LL}$ and repeat. When $\mathtt{LL}$ is empty, you know that the current $\mathtt{L[1]}$ is a minimal supplement.
This should find you a minimal supplement moderately quickly. If you wanted all minimal supplements (up to conjugacy), then it would be more difficult, because you would have to do these calculations for every group in each list $\mathtt{L}$.
If $N$ happened to be abelian, then all supplements would intersect $N$ in a normal subgroup of $G$, so another approach might be to find the normal subgroups $M$ of $G$ that are properly contained in $N$, and find complements of $N/M$ in $G/M$, using the function $\mathtt{ComplementClassesRepresentatives}$.
Here is some GAP code for the procedure above.
MinimalSupplement := function(G,N)
  local max, supp, oldsupp, gN;
  max := MaximalSubgroupClassReps(G);
  supp := Filtered(max, x -> not IsSubset(x,N));
  if Length(supp) = 0 then
    Error("Normal subgroup lies in Frattini subgroup");
  fi;
  gN := GeneratorsOfGroup(N);
  while Length(supp) > 0 do
    oldsupp := supp;
    supp := MaximalSubgroupClassReps(oldsupp[1]);
    supp := Filtered(supp, x ->
              G = Subgroup(G, Concatenation(GeneratorsOfGroup(x),gN)) );
  od;
  return oldsupp[1];
end;

