1
$\begingroup$

I am trying to work with graphs in MAGMA, but to my surprise I noticed that the vertices of the graph are no longer considered elements of the set I started with. Here is an example:

X:={1.. 13}; g:=Graph< X | { {u,v} : u,v in X |(u-v)^6 mod 13 eq 1}>; Random(Vertices(g)) in X;

The output is:

Runtime error in 'in': No valid universe containing all elements

This is a bit unfortunate for my purposes, because I want to construct cliques and cocliques and then compare this to other structural relations in the original set. How can I solve this?

Many thanks, Kind regards

$\endgroup$

1 Answer 1

0
$\begingroup$

This may be very late, but the 'index' operation is what you need here.

Index(v) : GrphVert -> RngIntElt Given a vertex v of some graph G, return the index of v in the (indexed) vertex-set of G.

In this case, it simply changes the type from GrphVert to RngIntElt, but in general you would then call Vertices(g)[Index(v)] to get back to the ground set.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .