Graphs, digraphs, and multidigraphs in GAP

Version 0.12.1
Released 2018-04-26

This project is maintained by J. D. Mitchell

README for digraphs-lib

Library of digraphs for the Digraphs package of GAP

In this directory is a collection of various types of digraphs, which can be loaded into the GAP computational algebra system using the Digraphs package. It is a completely optional addition to the package, which can be used to produce examples of digraphs for use in the package.

Getting digraphs-lib

The latest version of this library is available at the following link:


Simply download it and extract the archive into the root directory of your Digraphs installation. This should result in a digraphs-lib directory inside your digraphs directory.

Using digraphs-lib

Once the library is installed, simply launch GAP, load the Digraphs package, and use the ReadDigraphs function on one of the files in the digraph-lib directory. This will return a list of digraphs which can be used as required.

Here is an example GAP session:

gap> LoadPackage("digraphs", false);;
gap> filename := "~/gap/pkg/digraphs/digraphs-lib/latin.g6.gz";;
gap> latin_graphs := ReadDigraphs(filename);
[ <digraph with 100 vertices, 2700 edges>,
  <digraph with 121 vertices, 3630 edges>,
  <digraph with 144 vertices, 4752 edges>,
  <digraph with 169 vertices, 6084 edges>,
  <digraph with 196 vertices, 7644 edges>,
  <digraph with 225 vertices, 9450 edges>,
  <digraph with 256 vertices, 11520 edges>,
  <digraph with 289 vertices, 13872 edges>,
  <digraph with 324 vertices, 16524 edges>,
  <digraph with 361 vertices, 19494 edges>,
  <digraph with 4 vertices, 12 edges>,
  <digraph with 400 vertices, 22800 edges>,
  <digraph with 441 vertices, 26460 edges>,
  <digraph with 484 vertices, 30492 edges>,
  <digraph with 529 vertices, 34914 edges>,
  <digraph with 576 vertices, 39744 edges>,
  <digraph with 625 vertices, 45000 edges>,
  <digraph with 676 vertices, 50700 edges>,
  <digraph with 729 vertices, 56862 edges>,
  <digraph with 784 vertices, 63504 edges>,
  <digraph with 841 vertices, 70644 edges>,
  <digraph with 9 vertices, 54 edges>,
  <digraph with 900 vertices, 78300 edges>,
  <digraph with 16 vertices, 144 edges>,
  <digraph with 25 vertices, 300 edges>,
  <digraph with 36 vertices, 540 edges>,
  <digraph with 49 vertices, 882 edges>,
  <digraph with 64 vertices, 1344 edges>,
  <digraph with 81 vertices, 1944 edges> ]

Types of digraph available

The following files were created by the authors of the Digraphs package:

The following files contain symmetric graphs taken from the nauty and Traces website, by Brendan McKay and Adolfo Piperno:

There are also some additional files containing graphs coming from finite geometry:

which were added by Jan De Beule.