[GAP Forum] Grape UndirectedEdges Question

Butske, Bill butske at rose-hulman.edu
Wed Dec 8 00:31:28 GMT 2021


Dear All,

I'm having a bit of trouble (at least in my mind) with GRAPE.

I'm interested in subgraphs of the following graph and its associated symmetry group which I define through the adjacency matrix as follows:

gap>A:=[ [ 0, 1, 1, 1, 1, 0 ],
           [ 1, 0, 1, 0, 1, 1 ],
           [ 1, 1, 0, 1, 0, 1 ],
           [ 1, 0, 1, 0, 1, 1 ],
           [ 1, 1, 0, 1, 0, 1,],

           [ 0, 1, 1, 1, 1, 0 ] ];;

gap>G:=Group((2,3,4,5),(1,2,6,4));:

gap>LoadPackage("grape");;

gap>gamma:=Graph(G, [1..6], OnPoints, function(x,y) return A[x][y]=1; end, true );;

gap> UndirectedEdges(gamma);
[ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 5 ], [ 2, 3 ], [ 2, 5 ], [ 2, 6 ], [ 3, 4 ],
  [ 3, 6 ], [ 4, 5 ], [ 4, 6 ], [ 5, 6 ] ]

So far so good.  Then I define the induced subgraph determined by the vertices 1,2,6

gap>gamma_1_2_6:=InducedSubgraph(gamma,[1,2,6]);;

This should, in my mind anyway, give me the subgraph with the edges [1,2] and [2,6].  However, when I check this with the UndirectedEdges command I get:

gap> UndirectedEdges(InducedSubgraph(gamma,[1,2,6]));
[ [ 1, 2 ], [ 2, 3 ] ]

This bothers me because 3 isn't a specified vertex, furthermore the UndirectedEdges command appears to be order dependent?

gap> UndirectedEdges(InducedSubgraph(gamma,[1,6,2]));
[ [ 1, 3 ], [ 2, 3 ] ]

My expectation is that either version of the command should return [[1,2],[2,6]] and I am very much confused as to why this isn't case.

Any insights are appreciated and thanks in advance,
Bill Butske



More information about the Forum mailing list