GAP (Digraphs) - Contents

Goto Chapter: Top 1 2 3 4 5 6 7 8 9 A Bib Ind
[Top of Book] [Contents] [Next Chapter]

[MathJax off]

# Digraphs

## Graphs, digraphs, and multidigraphs in GAP

1.9.0

6 September 2024

Jan De Beule
Email: jdebeule@cage.ugent.be
Homepage: http://homepages.vub.ac.be/~jdbeule/
Address:
Vrije Universiteit Brussel, Vakgroep Wiskunde, Pleinlaan 2, B - 1050 Brussels, Belgium

Julius Jonusas
Email: j.jonusas@gmail.com
Homepage: http://julius.jonusas.work

James Mitchell
Email: jdm3@st-andrews.ac.uk
Homepage: https://jdbm.me
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Wilf A. Wilson
Email: gap@wilf-wilson.net
Homepage: https://wilf.me

Michael Young
Email: mct25@st-andrews.ac.uk
Homepage: https://mct25.host.cs.st-andrews.ac.uk
Address:
Jack Cole Building, North Haugh, St Andrews, Fife, KY16 9SX, Scotland

Marina Anagnostopoulou-Merkouri
Email: mam49@st-andrews.ac.uk
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Finn Buck
Email: finneganlbuck@gmail.com
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Stuart Burrell
Email: stuartburrell1994@gmail.com
Homepage: https://stuartburrell.github.io

Graham Campbell

Raiyan Chowdhury

Reinis Cirpons
Email: rc234@st-andrews.ac.uk
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Ashley Clayton
Email: ac323@st-andrews.ac.uk
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Tom Conti-Leslie
Email: tom.contileslie@gmail.com
Homepage: https://tomcontileslie.com

Joseph Edwards
Email: jde1@st-andrews.ac.uk
Homepage: https://github.com/Joseph-Edwards
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Luna Elliott
Email: TODO
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Isuru Fernando
Email: isuruf@gmail.com

Ewan Gilligan
Email: eg207@st-andrews.ac.uk

Sebastian Gutsche
Email: gutsche@momo.math.rwth-aachen.de

Samantha Harper
Email: seh25@st-andrews.ac.uk

Max Horn
Email: horn@mathematik.uni-kl.de
Homepage: https://www.quendi.de/math
Address:
Fachbereich Mathematik, TU Kaiserslautern, Gottlieb-Daimler-Straße 48, 67663 Kaiserslautern, Germany

Christopher Jefferson
Email: caj21@st-andrews.ac.uk
Homepage: https://caj.host.cs.st-andrews.ac.uk
Address:
Jack Cole Building, North Haugh, St Andrews, Fife, KY16 9SX, Scotland

Olexandr Konovalov
Email: obk1@st-andrews.ac.uk
Homepage: https://olexandr-konovalov.github.io/
Address:
Jack Cole Building, North Haugh, St Andrews, Fife, KY16 9SX, Scotland

Hyeokjun Kwon
Email: hk78@st-andrews.ac.uk

Andrea Lee
Email: ahwl1@st-andrews.ac.uk
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Saffron McIver
Email: sm544@st-andrews.ac.uk

Michael Orlitzky
Email: michael@orlitzky.com
Homepage: https://michael.orlitzky.com/

Matthew Pancer
Email: mp322@st-andrews.ac.uk

Markus Pfeiffer
Email: markus.pfeiffer@morphism.de
Homepage: https://markusp.morphism.de/

Daniel Pointon
Email: dp211@st-andrews.ac.uk

Lea Racine
Email: lr217@st-andrews.ac.uk
Address:
Jack Cole Building, North Haugh, St Andrews, Fife, KY16 9SX, Scotland

Christopher Russell

Artur Schaefer
Email: as305@st-and.ac.uk

Isabella Scott
Email: iscott@uchicago.edu

Kamran Sharma
Email: kks4@st-andrews.ac.uk
Address:
Jack Cole Building, North Haugh, St Andrews, Fife, KY16 9SX, Scotland

Finn Smith
Email: fls3@st-andrews.ac.uk
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Ben Spiers
Email: bspiers972@outlook.com

Maria Tsalakou
Email: mt200@st-andrews.ac.uk
Homepage: https://mariatsalakou.github.io/
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Meike Weiss
Email: weiss@art.rwth-aachen.de
Homepage: https://bit.ly/4e6pUeP
Address:
Chair of Algebra and Representation Theory, Pontdriesch 10-16, 52062 Aachen

Murray Whyte
Email: mw231@st-andrews.ac.uk
Address:
Mathematical Institute, North Haugh, St Andrews, Fife, KY16 9SS, Scotland

Fabian Zickgraf
Email: f.zickgraf@dashdos.com

### Abstract

The Digraphs package is a GAP package containing methods for graphs, digraphs, and multidigraphs.

### Copyright

Jan De Beule, Julius Jonušas, James D. Mitchell, Wilf A. Wilson, Michael Young et al.

Digraphs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

### Acknowledgements

We would like to thank Christopher Jefferson for his help in including bliss in Digraphs. This package's methods for computing digraph homomorphisms are based on work by Max Neunhöffer, and independently Artur Schäfer.

### Contents

1 The Digraphs package
1.1 Introduction
1.1-1 Definitions
2 Installing Digraphs
2.1 For those in a hurry
2.1-1 Configuration options
2.2 Optional package dependencies
2.2-1 The Grape package
2.3 Compiling the kernel module
2.4 Rebuilding the documentation
2.4-1 DigraphsMakeDoc
2.5 Testing your installation
2.5-1 DigraphsTestInstall
2.5-2 DigraphsTestStandard
2.5-3 DigraphsTestExtreme
3 Creating digraphs
3.1 Creating digraphs
3.1-1 IsDigraph
3.1-2 IsMutableDigraph
3.1-3 IsImmutableDigraph
3.1-4 IsCayleyDigraph
3.1-5 IsDigraphWithAdjacencyFunction
3.1-6 DigraphByOutNeighboursType
3.1-7 Digraph
3.1-8 DigraphByAdjacencyMatrix
3.1-9 DigraphByEdges
3.1-10 EdgeOrbitsDigraph
3.1-11 DigraphByInNeighbours
3.1-12 CayleyDigraph
3.1-13 ListNamedDigraphs
3.2 Changing representations
3.2-1 AsBinaryRelation
3.2-2 AsDigraph
3.2-3 Graph
3.2-4 AsGraph
3.2-5 AsTransformation
3.3 New digraphs from old
3.3-1 DigraphImmutableCopy
3.3-2 DigraphImmutableCopyIfImmutable
3.3-3 InducedSubdigraph
3.3-4 ReducedDigraph
3.3-5 MaximalSymmetricSubdigraph
3.3-6 MaximalAntiSymmetricSubdigraph
3.3-7 UndirectedSpanningForest
3.3-8 DigraphShortestPathSpanningTree
3.3-9 QuotientDigraph
3.3-10 DigraphReverse
3.3-11 DigraphDual
3.3-12 DigraphSymmetricClosure
3.3-13 DigraphTransitiveClosure
3.3-14 DigraphTransitiveReduction
3.3-15 DigraphAddVertex
3.3-16 DigraphAddVertices
3.3-17 DigraphAddEdge
3.3-18 DigraphAddEdgeOrbit
3.3-19 DigraphAddEdges
3.3-20 DigraphRemoveVertex
3.3-21 DigraphRemoveVertices
3.3-22 DigraphRemoveEdge
3.3-23 DigraphRemoveEdgeOrbit
3.3-24 DigraphRemoveEdges
3.3-25 DigraphRemoveLoops
3.3-26 DigraphRemoveAllMultipleEdges
3.3-27 DigraphContractEdge
3.3-28 DigraphReverseEdges
3.3-29 DigraphDisjointUnion
3.3-30 DigraphEdgeUnion
3.3-31 DigraphJoin
3.3-32 DigraphCartesianProduct
3.3-33 DigraphDirectProduct
3.3-34 ConormalProduct
3.3-35 HomomorphicProduct
3.3-36 LexicographicProduct
3.3-37 ModularProduct
3.3-38 StrongProduct
3.3-39 DigraphCartesianProductProjections
3.3-40 DigraphDirectProductProjections
3.3-41 LineDigraph
3.3-42 LineUndirectedDigraph
3.3-43 DoubleDigraph
3.3-44 BipartiteDoubleDigraph
3.3-45 DigraphAddAllLoops
3.3-46 DistanceDigraph
3.3-47 DigraphClosure
3.3-48 DigraphMycielskian
3.4 Random digraphs
3.4-1 RandomDigraph
3.4-2 RandomMultiDigraph
3.4-3 RandomTournament
3.4-4 RandomLattice
3.5 Standard examples
3.5-1 AndrasfaiGraph
3.5-2 BananaTree
3.5-3 BinaryTree
3.5-4 BinomialTreeGraph
3.5-5 BishopsGraph
3.5-6 BondyGraph
3.5-7 BookGraph
3.5-8 StackedBookGraph
3.5-9 ChainDigraph
3.5-10 CirculantGraph
3.5-11 CompleteDigraph
3.5-12 CompleteBipartiteDigraph
3.5-13 CompleteMultipartiteDigraph
3.5-14 CycleDigraph
3.5-15 CycleGraph
3.5-16 EmptyDigraph
3.5-17 GearGraph
3.5-18 HaarGraph
3.5-19 HalvedCubeGraph
3.5-20 HanoiGraph
3.5-21 HelmGraph
3.5-22 HypercubeGraph
3.5-23 JohnsonDigraph
3.5-24 KellerGraph
3.5-25 KingsGraph
3.5-26 KneserGraph
3.5-27 KnightsGraph
3.5-28 LindgrenSousselierGraph
3.5-29 LollipopGraph
3.5-30 MobiusLadderGraph
3.5-31 MycielskiGraph
3.5-32 OddGraph
3.5-33 PathGraph
3.5-34 PermutationStarGraph
3.5-35 PetersenGraph
3.5-36 GeneralisedPetersenGraph
3.5-37 PrismGraph
3.5-38 StackedPrismGraph
3.5-39 QueensGraph
3.5-40 RooksGraph
3.5-41 SquareGridGraph
3.5-42 TriangularGridGraph
3.5-43 StarGraph
3.5-44 TadpoleGraph
3.5-45 WalshHadamardGraph
3.5-46 WebGraph
3.5-47 WheelGraph
3.5-48 WindmillGraph
4 Operators
4.1 Operators for digraphs
4.1-1 IsSubdigraph
4.1-2 IsUndirectedSpanningTree
5 Attributes and operations
5.1 Vertices and edges
5.1-1 DigraphVertices
5.1-2 DigraphNrVertices
5.1-3 DigraphEdges
5.1-4 DigraphNrEdges
5.1-5 DigraphNrAdjacencies
5.1-6 DigraphNrAdjacenciesWithoutLoops
5.1-7 DigraphNrLoops
5.1-8 DigraphSinks
5.1-9 DigraphSources
5.1-10 DigraphTopologicalSort
5.1-11 DigraphVertexLabel
5.1-12 DigraphVertexLabels
5.1-13 DigraphEdgeLabel
5.1-14 DigraphEdgeLabels
5.1-15 DigraphInEdges
5.1-16 DigraphOutEdges
5.1-17 IsDigraphEdge
5.1-18 IsMatching
5.1-19 DigraphMaximalMatching
5.1-20 DigraphMaximumMatching
5.2 Neighbours and degree
5.2-1 AdjacencyMatrix
5.2-2 CharacteristicPolynomial
5.2-3 BooleanAdjacencyMatrix
5.2-4 DigraphAdjacencyFunction
5.2-5 DigraphRange
5.2-6 OutNeighbours
5.2-7 InNeighbours
5.2-8 OutDegrees
5.2-9 InDegrees
5.2-10 OutDegreeOfVertex
5.2-11 OutNeighboursOfVertex
5.2-12 InDegreeOfVertex
5.2-13 InNeighboursOfVertex
5.2-14 DigraphLoops
5.2-15 DegreeMatrix
5.2-16 LaplacianMatrix
5.3 Orders
5.3-1 PartialOrderDigraphMeetOfVertices
5.3-2 NonUpperSemimodularPair
5.4 Reachability and connectivity
5.4-1 DigraphDiameter
5.4-2 DigraphShortestDistance
5.4-3 DigraphShortestDistances
5.4-4 DigraphLongestDistanceFromVertex
5.4-5 DigraphDistanceSet
5.4-6 DigraphGirth
5.4-7 DigraphOddGirth
5.4-8 DigraphUndirectedGirth
5.4-9 DigraphConnectedComponents
5.4-10 DigraphConnectedComponent
5.4-11 DigraphStronglyConnectedComponents
5.4-12 DigraphStronglyConnectedComponent
5.4-13 DigraphBicomponents
5.4-14 ArticulationPoints
5.4-15 Bridges
5.4-16 StrongOrientation
5.4-17 DigraphPeriod
5.4-18 DigraphFloydWarshall
5.4-19 IsReachable
5.4-20 IsDigraphPath
5.4-21 VerticesReachableFrom
5.4-22 DigraphPath
5.4-23 DigraphShortestPath
5.4-24 DigraphRandomWalk
5.4-25 DigraphAbsorptionProbabilities
5.4-26 DigraphAbsorptionExpectedSteps
5.4-27 Dominators
5.4-28 DominatorTree
5.4-29 IteratorOfPaths
5.4-30 DigraphAllSimpleCircuits
5.4-31 DigraphLongestSimpleCircuit
5.4-32 DigraphAllUndirectedSimpleCircuits
5.4-33 DigraphAllChordlessCycles
5.4-34 DigraphLayers
5.4-35 DigraphDegeneracy
5.4-36 DigraphDegeneracyOrdering
5.4-37 HamiltonianPath
5.4-38 NrSpanningTrees
5.4-39 DigraphDijkstra
5.4-40 DigraphCycleBasis
5.5 Cayley graphs of groups
5.5-1 GroupOfCayleyDigraph
5.5-2 GeneratorsOfCayleyDigraph
5.6 Associated semigroups
5.6-1 AsSemigroup
5.6-2 AsSemigroup
5.7 Planarity
5.7-1 KuratowskiPlanarSubdigraph
5.7-2 KuratowskiOuterPlanarSubdigraph
5.7-3 PlanarEmbedding
5.7-4 OuterPlanarEmbedding
5.7-5 SubdigraphHomeomorphicToK23
5.8 Hashing
5.8-1 DigraphHash
6 Properties of digraphs
6.1 Vertex properties
6.1-1 DigraphHasAVertex
6.1-2 DigraphHasNoVertices
6.2 Edge properties
6.2-1 DigraphHasLoops
6.2-2 IsAntiSymmetricDigraph
6.2-3 IsBipartiteDigraph
6.2-4 IsCompleteBipartiteDigraph
6.2-5 IsCompleteDigraph
6.2-6 IsCompleteMultipartiteDigraph
6.2-7 IsEmptyDigraph
6.2-8 IsEquivalenceDigraph
6.2-9 IsFunctionalDigraph
6.2-10 IsPermutationDigraph
6.2-11 IsMultiDigraph
6.2-12 IsNonemptyDigraph
6.2-13 IsReflexiveDigraph
6.2-14 IsSymmetricDigraph
6.2-15 IsTournament
6.2-16 IsTransitiveDigraph
6.3 Edge Weights
6.3-1 EdgeWeights
6.3-2 EdgeWeightedDigraph
6.3-3 EdgeWeightedDigraphTotalWeight
6.3-4 EdgeWeightedDigraphMinimumSpanningTree
6.4 Orders
6.4-1 IsPreorderDigraph
6.4-2 IsPartialOrderDigraph
6.4-3 IsMeetSemilatticeDigraph
6.4-4 DigraphMeetTable
6.4-5 IsUpperSemimodularDigraph
6.4-6 IsDistributiveLatticeDigraph
6.4-7 IsModularLatticeDigraph
6.5 Regularity
6.5-1 IsInRegularDigraph
6.5-2 IsOutRegularDigraph
6.5-3 IsRegularDigraph
6.5-4 IsDistanceRegularDigraph
6.6 Connectivity and cycles
6.6-1 IsAcyclicDigraph
6.6-2 IsChainDigraph
6.6-3 IsConnectedDigraph
6.6-4 IsBiconnectedDigraph
6.6-5 IsBridgelessDigraph
6.6-6 IsStronglyConnectedDigraph
6.6-7 IsAperiodicDigraph
6.6-8 IsDirectedTree
6.6-9 IsUndirectedTree
6.6-10 IsEulerianDigraph
6.6-11 IsHamiltonianDigraph
6.6-12 IsCycleDigraph
6.7 Planarity
6.7-1 IsPlanarDigraph
6.7-2 IsOuterPlanarDigraph
6.8 Homomorphisms and transformations
6.8-1 IsDigraphCore
6.8-2 IsEdgeTransitive
6.8-3 IsVertexTransitive
7 Homomorphisms
7.1 Acting on digraphs
7.1-1 OnDigraphs
7.1-2 OnMultiDigraphs
7.1-3 OnTuplesDigraphs
7.2 Isomorphisms and canonical labellings
7.2-1 DigraphsUseNauty
7.2-2 AutomorphismGroup
7.2-3 BlissAutomorphismGroup
7.2-4 NautyAutomorphismGroup
7.2-5 AutomorphismGroup
7.2-6 AutomorphismGroup
7.2-7 BlissCanonicalLabelling
7.2-8 BlissCanonicalLabelling
7.2-9 BlissCanonicalDigraph
7.2-10 DigraphGroup
7.2-11 DigraphOrbits
7.2-12 DigraphOrbitReps
7.2-13 DigraphSchreierVector
7.2-14 DigraphStabilizer
7.2-15 IsIsomorphicDigraph
7.2-16 IsIsomorphicDigraph
7.2-17 IsomorphismDigraphs
7.2-18 IsomorphismDigraphs
7.2-19 RepresentativeOutNeighbours
7.2-20 IsDigraphIsomorphism
7.2-21 IsDigraphColouring
7.2-22 MaximalCommonSubdigraph
7.2-23 MinimalCommonSuperdigraph
7.3 Homomorphisms of digraphs
7.3-1 HomomorphismDigraphsFinder
7.3-2 DigraphHomomorphism
7.3-3 HomomorphismsDigraphs
7.3-4 DigraphMonomorphism
7.3-5 MonomorphismsDigraphs
7.3-6 DigraphEpimorphism
7.3-7 EpimorphismsDigraphs
7.3-8 DigraphEmbedding
7.3-9 EmbeddingsDigraphs
7.3-10 IsDigraphHomomorphism
7.3-11 IsDigraphEmbedding
7.3-12 SubdigraphsMonomorphisms
7.3-13 DigraphsRespectsColouring
7.3-14 GeneratorsOfEndomorphismMonoid
7.3-15 DigraphColouring
7.3-16 DigraphGreedyColouring
7.3-17 DigraphWelshPowellOrder
7.3-18 ChromaticNumber
7.3-19 DigraphCore
7.3-20 LatticeDigraphEmbedding
7.3-21 IsLatticeHomomorphism
8 Finding cliques and independent sets
8.1 Finding cliques
8.1-1 IsClique
8.1-2 CliquesFinder
8.1-3 DigraphClique
8.1-4 DigraphMaximalCliques
8.1-5 CliqueNumber
8.2 Finding independent sets
8.2-1 IsIndependentSet
8.2-2 DigraphIndependentSet
8.2-3 DigraphMaximalIndependentSets
9 Visualising and IO
9.1 Visualising a digraph
9.1-1 Splash
9.1-2 DotDigraph
9.1-3 DotSymmetricDigraph
9.1-4 DotPartialOrderDigraph
9.1-5 DotPreorderDigraph
9.1-6 DotHighlightedDigraph
9.2 Reading and writing digraphs to a file
9.2-1 String
9.2-2 DigraphFromGraph6String
9.2-3 Graph6String
9.2-4 DigraphFile
9.2-5 ReadDigraphs
9.2-6 WriteDigraphs
9.2-7 IteratorFromDigraphFile
9.2-8 DigraphPlainTextLineEncoder
9.2-9 TournamentLineDecoder
9.2-10 AdjacencyMatrixUpperTriangleLineDecoder
9.2-11 TCodeDecoder
9.2-12 PlainTextString
9.2-13 WritePlainTextDigraph
9.2-14 WriteDIMACSDigraph
A Grape to Digraphs Command Map
A.1 Functions to construct and modify graphs
A.2 Functions to inspect graphs, vertices and edges
A.3 Functions to determine regularity properties of graphs
A.4 Some special vertex subsets of a graph
A.5 Functions to construct new graphs from old
A.6 Vertex-Colouring and Complete Subgraphs
A.7 Automorphism groups and isomorphism testing for graphs
References
Index
[Top of Book] [Contents] [Next Chapter]
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 A Bib Ind

generated by GAPDoc2HTML