TITLE: GAP function to convert a subgroup lattice to a simple graph?
QUESTION [5 upvotes]: I've been using XGAP to view the subgroup lattices of various groups, and I am interested in their properties as simple graphs. I need a program that, given a group G, can output the subgroup lattice of G as a simple graph; that is, as a set V of vertices and a set E of edges.
Does such a function exist?
I have looked into GRAPE and DIGRAPH to no avail.

REPLY [3 votes]: You might look at DotFileLatticeSubgroups, which outputs the subgroup lattice to a dot file visualizable by GraphViz.  It'd be easy to modify this (or alternatively, to postprocess its output) to get a list of vertices and edges.  I agree that it'd be nice to have a clean way to get a list of edges out of a subgroup lattice sheet.  Perhaps something under the Poset menu?
PS: You mention xgap.  If you have a Mac handy, you might enjoy my slightly more modern take, Gap.app
UPDATE:  I wrote a function that will take a GraphicSubgroupLattice and return a list of edges of the represented Hasse diagram.  To use it, type
L:=GraphicSubgroupLattice(DihedralGroup(8));
then get the subgroups you'd like to look at in the Hasse diagram (e.g. by doing Subgroups | All Subgroups), then type GraphicLatticeToGraph(L);
I expect that it will also work with other poset objects in xgap/Gap.app, but have not tested it.
The function follows.

GraphicLatticeToGraph:=function(L)
  local Gr, lev, cl, H, M;

  Gr:=[];

  for lev in L!.levels do
    for cl in lev!.classes do
      for H in cl do
        for M in H!.maximals do
          AddSet(Gr, [M!.label, H!.label]);
        od;
      od;
    od;
  od;
  return Gr;
end;