[GAP Forum] Issue with "Read" function - in GAP

Sreedevi Muthukumar sreedevimk at gmail.com
Sat Oct 26 19:03:15 BST 2013


Dear All,

I'm a new GAP user and a student, I'm working with Grape package in GAP to
learn about graphs.

I tried to execute a "xxx.g"  file using "Read" function as given below in
two methods.

Please kindly check the methods I have tried and guide me to correct this
problem.


*Method 1: *

As Read("Path/filename.g"); function is used to read and execute set of
commands in GAP.

I created a file named "Symm_Star_3.g" to create a cayley graph.

*Symm_Star_3.g*
C := CayleyGraph(SymmetricGroup(3),[(1,2),(1,3)]);
Diameter(C);

After executing  the Read function I got the below error message.

gap>
Read("C:/Users/Home/Desktop/Collage/Independent_Studies/Programs/Symm_Star_3.g");
Error, Variable: 'CayleyGraph' must have a value
not in any function at line 1 of
C:/Users/Home/Desktop/Collage/Independent_Studies/Programs/Symm_Star_3.g

*As CayleyGraph command is present in grape package , I invoked the grape
package as follows,then executed the .g file*

gap> LoadPackage("grape");
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading  GRAPE 4.6.1 (GRaph Algorithms using PErmutation groups)
by Leonard H. Soicher (http://www.maths.qmul.ac.uk/~leonard/).
Homepage: http://www.maths.qmul.ac.uk/~leonard/grape/
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
true

gap>
Read("C:/Users/Home/Desktop/Collage/Independent_Studies/Programs/Symm_Star_3.g");
gap>

Now after invoking the grape package and then executing the Read function,
is not producing any output as shown above.

*Method 2:*

I tried to invoke the package directly from the .g file as follows.

*Symm_Star_3.g*
*
*
LoadPackage("grape");
C := CayleyGraph(SymmetricGroup(3),[(1,2),(1,3)]);
Diameter(C);


Now executing the Read function , is just invoking the package and not
executing the other commands in the .g file.

gap>
Read("C:/Users/Home/Desktop/Collage/Independent_Studies/Programs/Symm_Star_3.g");
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading  GRAPE 4.6.1 (GRaph Algorithms using PErmutation groups)
by Leonard H. Soicher (http://www.maths.qmul.ac.uk/~leonard/).
Homepage: http://www.maths.qmul.ac.uk/~leonard/grape/
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
gap>


Please guide me to correct this issue and help me to use "Read" function ,
to read a file with set of graph commands, after invoking Grape package.

Thanking you,
Sree Devi.


More information about the Forum mailing list