Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  chap6_mj.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/GAP/pkg/digraphs/doc/chap6_mj.html


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/javascript"
  src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<title>GAP (Digraphs) - Chapter 6: Properties of digraphs</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap6"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chap3_mj.html">3</a>  <a href="chap4_mj.html">4</a>  <a href="chap5_mj.html">5</a>  <a href="chap6_mj.html">6</a>  <a href="chap7_mj.html">7</a>  <a href="chap8_mj.html">8</a>  <a href="chap9_mj.html">9</a>  <a href="chapA_mj.html">A</a>  <a href="chapB_mj.html">B</a>  <a href="chapBib_mj.html">Bib</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a>   <a href="chap0_mj.html#contents">[Contents]</a>    <a href="chap5_mj.html">[Previous Chapter]</a>    <a href="chap7_mj.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap6.html">[MathJax off]</a></p>
<p><a id="X7ADDEFD478D470D5" name="X7ADDEFD478D470D5"></a></p>
<div class="ChapSects"><a href="chap6_mj.html#X7ADDEFD478D470D5">6 <span class="Heading">Properties of digraphs</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7D6A52AB7C69A9CA">6.1 <span class="Heading">Vertex properties</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X82DBFFF17E708803">6.1-1 DigraphHasAVertex</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X78E16B8B7DF55B59">6.1-2 DigraphHasNoVertices</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7F49388F8245F0E9">6.2 <span class="Heading">Edge properties</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7D92935C7D535187">6.2-1 DigraphHasLoops</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7DB1BC2286FC08E2">6.2-2 IsAntiSymmetricDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X860CFB0C8665F356">6.2-3 IsBipartiteDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X790A4DBF8533516E">6.2-4 IsCompleteBipartiteDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X81F28D4D879FE3B2">6.2-5 IsCompleteDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7FD1A15779FEC341">6.2-6 IsCompleteMultipartiteDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7E894CCF7B1C27AE">6.2-7 IsEmptyDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X83762C257DED2751">6.2-8 IsEquivalenceDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7E8F37E585DAED52">6.2-9 IsFunctionalDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X793FB02C7C59D85B">6.2-10 IsPermutationDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7BB84CFC7E8B2B26">6.2-11 IsMultiDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7E14AE1F7CA23141">6.2-12 IsNonemptyDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X8462D8E2792B23F6">6.2-13 IsReflexiveDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X81B3EA7887219860">6.2-14 IsSymmetricDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7DD8D1A185EBE865">6.2-15 IsTournament</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7F0835667F29F0C0">6.2-16 IsTransitiveDigraph</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X85A9843E80A9B590">6.3 <span class="Heading">Edge Weights</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X8639092D8689333D">6.3-1 EdgeWeights</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7E14055A84A52A07">6.3-2 EdgeWeightedDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X810B2DD7794AFBE8">6.3-3 EdgeWeightedDigraphTotalWeight</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7E5060AB7FB4F31C">6.3-4 EdgeWeightedDigraphMinimumSpanningTree</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7EDB9C9A840F6A84">6.3-5 EdgeWeightedDigraphShortestPaths</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7DAF81B779BD9165">6.3-6 EdgeWeightedDigraphShortestPath</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X869EFE9F818C6E22">6.3-7 DigraphMaximumFlow</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X8194E7078167A9E4">6.3-8 RandomUniqueEdgeWeightedDigraph</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X86424F167BD4F629">6.4 <span class="Heading">Orders</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X8617726C7829F796">6.4-1 IsPreorderDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X82BAE6D37D49A145">6.4-2 IsPartialOrderDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X78D3E17B7F737516">6.4-3 IsMeetSemilatticeDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X84F4711F7FA36848">6.4-4 DigraphMeetTable</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X786213437E99065B">6.4-5 IsOrderIdeal</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7A1D8F4582F8EA53">6.4-6 IsOrderFilter</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7DEDCD177E5AE824">6.4-7 IsUpperSemimodularDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7B566B4A86E18F45">6.4-8 IsDistributiveLatticeDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X80659D5784790B52">6.4-9 IsModularLatticeDigraph</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7AAF896982EC22FA">6.5 <span class="Heading">Regularity</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7A3F78B37E31D9E1">6.5-1 IsInRegularDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7F0A806E7BCB413C">6.5-2 IsOutRegularDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7AF9DB1E7DB12306">6.5-3 IsRegularDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7E2082AC7CAE59CD">6.5-4 IsDistanceRegularDigraph</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X780DAEB37C5E07FD">6.6 <span class="Heading">Connectivity and cycles</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7BD08D4478218F77">6.6-1 IsAcyclicDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X79563B297C220FB5">6.6-2 IsChainDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X83C08C0B7EC1A91F">6.6-3 IsConnectedDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X838FAF2D825977BE">6.6-4 IsBiconnectedDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7D2A6572820B7F24">6.6-5 IsBridgelessDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7B37B9467C68C208">6.6-6 IsStronglyConnectedDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X80E883967EBE839E">6.6-7 IsAperiodicDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7B46EA6C7B2DF2FB">6.6-8 IsDirectedTree</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X80FC20FA7AC4BC2A">6.6-9 IsUndirectedTree</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X79DFBB198525544E">6.6-10 IsEulerianDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X79EFEBC37C2D262D">6.6-11 IsHamiltonianDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7E91320B8028F5D8">6.6-12 IsCycleDigraph</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X7E2305528492DDC0">6.7 <span class="Heading">Planarity</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X8606D415858C40AA">6.7-1 IsPlanarDigraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X8251E8B187E7F059">6.7-2 IsOuterPlanarDigraph</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap6_mj.html#X83DC8AD283C41326">6.8 <span class="Heading">Homomorphisms and transformations</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X78C0B2637985648B">6.8-1 IsDigraphCore</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X8361CA6E8401FF26">6.8-2 IsEdgeTransitive</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7B26E4447A1611E9">6.8-3 IsVertexTransitive</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap6_mj.html#X7FB8789A7BF847E6">6.8-4 Is2EdgeTransitive</a></span>
</div></div>
</div>

<h3>6 <span class="Heading">Properties of digraphs</span></h3>

<p><a id="X7D6A52AB7C69A9CA" name="X7D6A52AB7C69A9CA"></a></p>

<h4>6.1 <span class="Heading">Vertex properties</span></h4>

<p><a id="X82DBFFF17E708803" name="X82DBFFF17E708803"></a></p>

<h5>6.1-1 DigraphHasAVertex</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DigraphHasAVertex</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>Returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> has at least one vertex, and <code class="keyw">false</code> if it does not.</p>

<p>See also <code class="func">DigraphHasNoVertices</code> (<a href="chap6_mj.html#X78E16B8B7DF55B59"><span class="RefLink">6.1-2</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([]);</span>
<immutable empty digraph with 0 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasAVertex(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[]]);</span>
<immutable empty digraph with 1 vertex>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasAVertex(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[], [1]]);</span>
<immutable digraph with 2 vertices, 1 edge>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasAVertex(D);</span>
true</pre></div>

<p><a id="X78E16B8B7DF55B59" name="X78E16B8B7DF55B59"></a></p>

<h5>6.1-2 DigraphHasNoVertices</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DigraphHasNoVertices</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>Returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is the unique digraph with zero vertices, and <code class="keyw">false</code> otherwise.</p>

<p>See also <code class="func">DigraphHasAVertex</code> (<a href="chap6_mj.html#X82DBFFF17E708803"><span class="RefLink">6.1-1</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([]);</span>
<immutable empty digraph with 0 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasNoVertices(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[]]);</span>
<immutable empty digraph with 1 vertex>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasNoVertices(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[], [1]]);</span>
<immutable digraph with 2 vertices, 1 edge>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasNoVertices(D);</span>
false</pre></div>

<p><a id="X7F49388F8245F0E9" name="X7F49388F8245F0E9"></a></p>

<h4>6.2 <span class="Heading">Edge properties</span></h4>

<p><a id="X7D92935C7D535187" name="X7D92935C7D535187"></a></p>

<h5>6.2-1 DigraphHasLoops</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DigraphHasLoops</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>Returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> has loops, and <code class="keyw">false</code> if it does not. A loop is an edge with equal source and range.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 2], [2]]);</span>
<immutable digraph with 2 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphEdges(D);</span>
[ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasLoops(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 3], [1], [2]]);</span>
<immutable digraph with 3 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphEdges(D);</span>
[ [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 3, 2 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasLoops(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteDigraph(IsMutableDigraph, 4);</span>
<mutable digraph with 4 vertices, 12 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHasLoops(D);</span>
false</pre></div>

<p><a id="X7DB1BC2286FC08E2" name="X7DB1BC2286FC08E2"></a></p>

<h5>6.2-2 IsAntiSymmetricDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsAntiSymmetricDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsAntisymmetricDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is antisymmetric, and <code class="keyw">false</code> if it is not.</p>

<p>A digraph is <em>antisymmetric</em> if whenever there is an edge with source <code class="code">u</code> and range <code class="code">v</code>, and an edge with source <code class="code">v</code> and range <code class="code">u</code>, then the vertices <code class="code">u</code> and <code class="code">v</code> are equal.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">gr1 := Digraph([[2], [1, 3], [2, 3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAntisymmetricDigraph(gr1);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphEdges(gr1){[1, 2]};</span>
[ [ 1, 2 ], [ 2, 1 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">gr2 := Digraph([[1, 2], [3, 3], [1]]);</span>
<immutable multidigraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAntisymmetricDigraph(gr2);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphEdges(gr2);</span>
[ [ 1, 1 ], [ 1, 2 ], [ 2, 3 ], [ 2, 3 ], [ 3, 1 ] ]
</pre></div>

<p><a id="X860CFB0C8665F356" name="X860CFB0C8665F356"></a></p>

<h5>6.2-3 IsBipartiteDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsBipartiteDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is bipartite, and <code class="keyw">false</code> if it is not. A digraph is bipartite if and only if the vertices of <var class="Arg">digraph</var> can be partitioned into two non-empty sets such that thsource and range of any edge of <var class="Arg">digraph</var> lie in distinct sets. Equivalently, a digraph is bipartite if and only if it is 2-colorable; see <code class="func">DigraphGreedyColouring</code> (<a href="chap7_mj.html#X7AB7200D831013C1"><span class="RefLink">7.3-16</span></a>).</p>

<p>See also <code class="func">DigraphBicomponents</code> (<a href="chap5_mj.html#X7F1B5A2782F598B1"><span class="RefLink">5.4-13</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := ChainDigraph(4);</span>
<immutable chain digraph with 4 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBipartiteDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(3);</span>
<immutable cycle digraph with 3 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBipartiteDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4);</span>
<mutable digraph with 9 vertices, 40 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBipartiteDigraph(D);</span>
true</pre></div>

<p><a id="X790A4DBF8533516E" name="X790A4DBF8533516E"></a></p>

<h5>6.2-4 IsCompleteBipartiteDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsCompleteBipartiteDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>Returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is a complete bipartite digraph, and <code class="keyw">false</code> if it is not.</p>

<p>A digraph is a <em>complete bipartite digraph</em> if it is bipartite, see <code class="func">IsBipartiteDigraph</code> (<a href="chap6_mj.html#X860CFB0C8665F356"><span class="RefLink">6.2-3</span></a>), and there exists a unique edge with source <code class="code">i</code> and range <code class="code">j</code> if and only if <code class="code">i</code> and <code class="code">j</code> lie in different bicomponents of <var class="Arg">digraph</var>, see <code class="func">DigraphBicomponents</code> (<a href="chap5_mj.html#X7F1B5A2782F598B1"><span class="RefLink">5.4-13</span></a>).</p>

<p>Equivalently, a bipartite digraph with bicomponents of size <span class="SimpleMath">\(m\)</span> and <span class="SimpleMath">\(n\)</span> is complete precisely when it has <span class="SimpleMath">\(2mn\)</span> edges, none of which are multiple edges.</p>

<p>See also <code class="func">CompleteBipartiteDigraph</code> (<a href="chap3_mj.html#X8795B0AD856014FA"><span class="RefLink">3.5-14</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(2);</span>
<immutable cycle digraph with 2 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteBipartiteDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(4);</span>
<immutable cycle digraph with 4 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBipartiteDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteBipartiteDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4);</span>
<mutable digraph with 9 vertices, 40 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteBipartiteDigraph(D);</span>
true</pre></div>

<p><a id="X81F28D4D879FE3B2" name="X81F28D4D879FE3B2"></a></p>

<h5>6.2-5 IsCompleteDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsCompleteDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>Returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is complete, and <code class="keyw">false</code> if it is not.</p>

<p>A digraph is <em>complete</em> if it has no loops, and for all <em>distinct</em> vertices <code class="code">i</code> and <code class="code">j</code>, there is exactly one edge with source <code class="code">i</code> and range <code class="code">j</code>. Equivalently, a digraph with <span class="SimpleMath">\(n\)</span> vertices is complete precisely when it has <span class="SimpleMath">\(n(n - 1)\)</span> edges, no loops, and no multiple edges.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 3], [1, 3], [1, 2]]);</span>
<immutable digraph with 3 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 2], [1]]);</span>
<immutable multidigraph with 2 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4);</span>
<mutable digraph with 9 vertices, 40 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteDigraph(D);</span>
false</pre></div>

<p><a id="X7FD1A15779FEC341" name="X7FD1A15779FEC341"></a></p>

<h5>6.2-6 IsCompleteMultipartiteDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsCompleteMultipartiteDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property returns <code class="keyw">true</code> if <var class="Arg">digraph</var> is a complete multipartite digraph, and <code class="keyw">false</code> if not.</p>

<p>A digraph is a <em>complete multipartite digraph</em> if and only if its vertices can be partitioned into at least two maximal independent sets, where every possible edge between these independent sets occurs in the digraph exactly once.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteMultipartiteDigraph([2, 4, 6]);</span>
<immutable complete multipartite digraph with 12 vertices, 88 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteMultipartiteDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4);</span>
<mutable digraph with 9 vertices, 40 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCompleteMultipartiteDigraph(D);</span>
true</pre></div>

<p><a id="X7E894CCF7B1C27AE" name="X7E894CCF7B1C27AE"></a></p>

<h5>6.2-7 IsEmptyDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsEmptyDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsNullDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>Returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is empty, and <code class="keyw">false</code> if it is not. A digraph is <em>empty</em> if it has no edges.</p>

<p><code class="func">IsNullDigraph</code> is a synonym for <code class="func">IsEmptyDigraph</code>. See also <code class="func">IsNonemptyDigraph</code> (<a href="chap6_mj.html#X7E14AE1F7CA23141"><span class="RefLink">6.2-12</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[], []]);</span>
<immutable empty digraph with 2 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEmptyDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsNullDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[], [1]]);</span>
<immutable digraph with 2 vertices, 1 edge>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEmptyDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsNullDigraph(D);</span>
false</pre></div>

<p><a id="X83762C257DED2751" name="X83762C257DED2751"></a></p>

<h5>6.2-8 IsEquivalenceDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsEquivalenceDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>A digraph is an equivalence digraph if and only if the digraph satisfies all of <code class="func">IsReflexiveDigraph</code> (<a href="chap6_mj.html#X8462D8E2792B23F6"><span class="RefLink">6.2-13</span></a>), <code class="func">IsSymmetricDigraph</code> (<a href="chap6_mj.html#X81B3EA7887219860"><span class="RefLink">6.2-14</span></a>) and <code class="func">IsTransitiveDigraph</code> (<a href="chap6_mj.html#X7F0835667F29F0C0"><span class="RefLink">6.2-16</span></a>). A partial order <var class="Arg">digraph</var> corresponds to an equivalence relation.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 3], [2], [1, 3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEquivalenceDigraph(D);</span>
true
</pre></div>

<p><a id="X7E8F37E585DAED52" name="X7E8F37E585DAED52"></a></p>

<h5>6.2-9 IsFunctionalDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsFunctionalDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is functional.</p>

<p>A digraph is <em>functional</em> if every vertex is the source of a unique edge.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">gr1 := Digraph([[3], [2], [2], [1], [6], [5]]);</span>
<immutable digraph with 6 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsFunctionalDigraph(gr1);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">gr2 := Digraph([[1, 2], [1]]);</span>
<immutable digraph with 2 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsFunctionalDigraph(gr2);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">gr3 := Digraph(3, [1, 2, 3], [2, 3, 1]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsFunctionalDigraph(gr3);</span>
true
</pre></div>

<p><a id="X793FB02C7C59D85B" name="X793FB02C7C59D85B"></a></p>

<h5>6.2-10 IsPermutationDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsPermutationDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is functional and each node has only one in-neighbour.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">gr1 := Digraph([[3], [2], [2], [1], [6], [5]]);</span>
<immutable digraph with 6 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPermutationDigraph(gr1);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">gr2 := Digraph([[1, 2], [1]]);</span>
<immutable digraph with 2 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPermutationDigraph(gr2);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">gr3 := Digraph(3, [1, 2, 3], [2, 3, 1]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPermutationDigraph(gr3);</span>
true
</pre></div>

<p><a id="X7BB84CFC7E8B2B26" name="X7BB84CFC7E8B2B26"></a></p>

<h5>6.2-11 IsMultiDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsMultiDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>A <em>multidigraph</em> is one that has at least two edges with equal source and range.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph(["a""b""c"], ["a""b""b"], ["b""c""a"]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMultiDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphFromDigraph6String("&Bug");</span>
<immutable digraph with 3 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDuplicateFree(DigraphEdges(D));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMultiDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 2, 3, 2], [2, 1], [3]]);</span>
<immutable multidigraph with 3 vertices, 7 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDuplicateFree(DigraphEdges(D));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMultiDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphMutableCopy(D);</span>
<mutable multidigraph with 3 vertices, 7 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMultiDigraph(D);</span>
true</pre></div>

<p><a id="X7E14AE1F7CA23141" name="X7E14AE1F7CA23141"></a></p>

<h5>6.2-12 IsNonemptyDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsNonemptyDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>Returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is nonempty, and <code class="keyw">false</code> if it is not. A digraph is <em>nonempty</em> if it has at least one edge.</p>

<p>See also <code class="func">IsEmptyDigraph</code> (<a href="chap6_mj.html#X7E894CCF7B1C27AE"><span class="RefLink">6.2-7</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[], []]);</span>
<immutable empty digraph with 2 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsNonemptyDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[], [1]]);</span>
<immutable digraph with 2 vertices, 1 edge>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsNonemptyDigraph(D);</span>
true</pre></div>

<p><a id="X8462D8E2792B23F6" name="X8462D8E2792B23F6"></a></p>

<h5>6.2-13 IsReflexiveDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsReflexiveDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is reflexive, and <code class="keyw">false</code> if it is not. A digraph is <em>reflexive</em> if it has a loop at every vertex.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 2], [2]]);</span>
<immutable digraph with 2 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsReflexiveDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[3, 1], [4, 2], [3], [2, 1]]);</span>
<immutable digraph with 4 vertices, 7 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsReflexiveDigraph(D);</span>
false
</pre></div>

<p><a id="X81B3EA7887219860" name="X81B3EA7887219860"></a></p>

<h5>6.2-14 IsSymmetricDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsSymmetricDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is symmetric, and <code class="keyw">false</code> if it is not.</p>

<p>A <em>symmetric digraph</em> is one where for each non-loop edge, having source <code class="code">u</code> and range <code class="code">v</code>, there is a corresponding edge with source <code class="code">v</code> and range <code class="code">u</code>. If there are <code class="code">n</code> edges with source <code class="code">u</code> and range <code class="code">v</code>, then there must be precisely <code class="code">n</code> edges with source <code class="code">v</code> and range <code class="code">u</code>. In other words, a symmetric digraph has a symmetric adjacency matrix <code class="func">AdjacencyMatrix</code> (<a href="chap5_mj.html#X7DC2CD70830BEE60"><span class="RefLink">5.2-1</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">gr1 := Digraph([[2], [1, 3], [2, 3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsSymmetricDigraph(gr1);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">adj1 := AdjacencyMatrix(gr1);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Display(adj1);</span>
[ [  0,  1,  0 ],
  [  1,  0,  1 ],
  [  0,  1,  1 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">adj1 = TransposedMat(adj1);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">gr1 = DigraphReverse(gr1);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">gr2 := Digraph([[2, 3], [1, 3], [2, 3]]);</span>
<immutable digraph with 3 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsSymmetricDigraph(gr2);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">adj2 := AdjacencyMatrix(gr2);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Display(adj2);</span>
[ [  0,  1,  1 ],
  [  1,  0,  1 ],
  [  0,  1,  1 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">adj2 = TransposedMat(adj2);</span>
false
</pre></div>

<p><a id="X7DD8D1A185EBE865" name="X7DD8D1A185EBE865"></a></p>

<h5>6.2-15 IsTournament</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsTournament</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is a tournament, and <code class="keyw">false</code> if it is not.</p>

<p>A tournament is an orientation of a complete (undirected) graph. Specifically, a tournament is a digraph which has a unique directed edge (of some orientation) between any pair of distinct vertices, and no loops.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 3, 4], [3, 4], [4], []]);</span>
<immutable digraph with 4 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsTournament(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], [1], [3]]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsTournament(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(IsMutableDigraph, 3);</span>
<mutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsTournament(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphRemoveEdge(D, 1, 2);</span>
<mutable digraph with 3 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsTournament(D);</span>
false
</pre></div>

<p><a id="X7F0835667F29F0C0" name="X7F0835667F29F0C0"></a></p>

<h5>6.2-16 IsTransitiveDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsTransitiveDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is transitive, and <code class="keyw">false</code> if it is not. A digraph is <em>transitive</em> if whenever <code class="code">[ i, j ]</code> and <code class="code">[ j, k ]</code> are edges of the digraph, then <code class="code">[ i, k ]</code> is also an edge of the digraph.</p>

<p>Let <span class="SimpleMath">\(n\)</span> be the number of vertices of an arbitrary digraph, and let <span class="SimpleMath">\(m\)</span> be the number of edges. For general digraphs, the methods used for this property use a version of the Floyd-Warshall algorithm, and have complexity <span class="SimpleMath">\(O(n^3)\)</span>. However for digraphs which are topologically sortable [<code class="func">DigraphTopologicalSort</code> (<a href="chap5_mj.html#X785C30378064CF47"><span class="RefLink">5.1-10</span></a>)], then methods with complexity <span class="SimpleMath">\(O(m + n + m \cdot n)\)</span> will be used when appropriate.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 2], [3], [3]]);</span>
<immutable digraph with 3 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsTransitiveDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">gr2 := Digraph([[1, 2, 3], [3], [3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsTransitiveDigraph(gr2);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">gr2 = DigraphTransitiveClosure(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">gr3 := Digraph([[1, 2, 2, 3], [3, 3], [3]]);</span>
<immutable multidigraph with 3 vertices, 7 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsTransitiveDigraph(gr3);</span>
true
</pre></div>

<p><a id="X85A9843E80A9B590" name="X85A9843E80A9B590"></a></p>

<h4>6.3 <span class="Heading">Edge Weights</span></h4>

<p><a id="X8639092D8689333D" name="X8639092D8689333D"></a></p>

<h5>6.3-1 EdgeWeights</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeights</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeightsMutableCopy</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A list of lists of integers, floats or rationals.</p>

<p><code class="code">EdgeWeights</code> returns the list of lists of edge weights of the edges of the digraph <var class="Arg">digraph</var>.</p>

<p>More specifically, <code class="code">weights[i][j]</code> is the weight given to the <code class="code">j</code>th edge from vertex <code class="code">i</code>, according to the ordering of edges given by <code class="code">OutNeighbours(digraph)[i]</code>.</p>

<p>The function <code class="code">EdgeWeights</code> returns an immutable list of immutable lists, whereas the function <code class="code">EdgeWeightsMutableCopy</code> returns a copy of <code class="code">EdgeWeights</code> which is a mutable list of mutable lists.</p>

<p>The edge weights of a digraph cannot be computed and must be set either using <code class="code">SetEdgeWeights</code> or <code class="func">EdgeWeightedDigraph</code> (<a href="chap6_mj.html#X7E14055A84A52A07"><span class="RefLink">6.3-2</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">gr := EdgeWeightedDigraph([[2], [3], [1]], [[5], [10], [15]]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeights(gr);</span>
[ [ 5 ], [ 10 ], [ 15 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">a := EdgeWeightsMutableCopy(gr);</span>
[ [ 5 ], [ 10 ], [ 15 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">a[1][1] := 100;</span>
100
<span class="GAPprompt">gap></span> <span class="GAPinput">a;</span>
[ [ 100 ], [ 10 ], [ 15 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">b := EdgeWeights(gr);</span>
[ [ 5 ], [ 10 ], [ 15 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">b[1][1] := 534;</span>
Error, List Assignment: <list> must be a mutable list
</pre></div>

<p><a id="X7E14055A84A52A07" name="X7E14055A84A52A07"></a></p>

<h5>6.3-2 EdgeWeightedDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeightedDigraph</code>( <var class="Arg">digraph</var>, <var class="Arg">weights</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: A digraph or <code class="keyw">fail</code></p>

<p>The argument <var class="Arg">digraph</var> may be a digraph or a list of lists of integers, floats or rationals.</p>

<p><var class="Arg">weights</var> must be a list of lists of integers, floats or rationals of an equal size and shape to <code class="code">OutNeighbours(digraph)</code>, otherwise it will fail.</p>

<p>This will create a digraph and set the EdgeWeights to <var class="Arg">weights</var>.</p>

<p>See <code class="func">EdgeWeights</code> (<a href="chap6_mj.html#X8639092D8689333D"><span class="RefLink">6.3-1</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">g := EdgeWeightedDigraph(Digraph([[2], [1]]), [[5], [15]]);</span>
<immutable digraph with 2 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">g := EdgeWeightedDigraph([[2], [1]], [[5], [15]]);</span>
<immutable digraph with 2 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeights(g);</span>
[ [ 5 ], [ 15 ] ]
</pre></div>

<p><a id="X810B2DD7794AFBE8" name="X810B2DD7794AFBE8"></a></p>

<h5>6.3-3 EdgeWeightedDigraphTotalWeight</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeightedDigraphTotalWeight</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: An integer, float or rational.</p>

<p>If <var class="Arg">digraph</var> is a digraph with edge weights, then this attribute returns the sum of the weights of its edges.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this attribute is recomputed every time it is called.</p>

<p>See <code class="func">EdgeWeights</code> (<a href="chap6_mj.html#X8639092D8689333D"><span class="RefLink">6.3-1</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := EdgeWeightedDigraph([[2], [1], [1, 2]],</span>
<span class="GAPprompt">></span> <span class="GAPinput">                            [[12], [5], [6, 9]]);</span>
<immutable digraph with 3 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeightedDigraphTotalWeight(D);</span>
32</pre></div>

<p><a id="X7E5060AB7FB4F31C" name="X7E5060AB7FB4F31C"></a></p>

<h5>6.3-4 EdgeWeightedDigraphMinimumSpanningTree</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeightedDigraphMinimumSpanningTree</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A digraph.</p>

<p>If <var class="Arg">digraph</var> is a connected digraph with edge weights, then this attribute returns a digraph which is a minimum spanning tree of <var class="Arg">digraph</var>.</p>

<p>A <em>spanning tree</em> of a digraph is a subdigraph with the same vertices but a subset of its edges that form an undirected tree. It is <em>minimum</em> if it has the smallest possible total weight for a spanning tree of that digraph.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this attribute is recomputed every time it is called.</p>

<p>See <code class="func">EdgeWeights</code> (<a href="chap6_mj.html#X8639092D8689333D"><span class="RefLink">6.3-1</span></a>), <code class="func">EdgeWeightedDigraphTotalWeight</code> (<a href="chap6_mj.html#X810B2DD7794AFBE8"><span class="RefLink">6.3-3</span></a>) and <code class="func">IsConnectedDigraph</code> (<a href="chap6_mj.html#X83C08C0B7EC1A91F"><span class="RefLink">6.6-3</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := EdgeWeightedDigraph([[2], [1], [1, 2]],</span>
<span class="GAPprompt">></span> <span class="GAPinput">                            [[12], [5], [6, 9]]);</span>
<immutable digraph with 3 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">T := EdgeWeightedDigraphMinimumSpanningTree(D);</span>
<immutable digraph with 3 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeights(T);</span>
[ [  ], [ 5 ], [ 6 ] ]</pre></div>

<p><a id="X7EDB9C9A840F6A84" name="X7EDB9C9A840F6A84"></a></p>

<h5>6.3-5 EdgeWeightedDigraphShortestPaths</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeightedDigraphShortestPaths</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeightedDigraphShortestPaths</code>( <var class="Arg">digraph</var>, <var class="Arg">source</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A record.</p>

<p>If <var class="Arg">digraph</var> is an edge-weighted digraph, this attribute returns a record describing the paths of lowest total weight (the <em>shortest paths</em>) connecting each pair of vertices. If the optional argument <var class="Arg">source</var> is specified and is a vertex of <var class="Arg">digraph</var>, then the output will only contain information on paths originating from that vertex.</p>

<p>In the two-argument form, the value returned is a record containing three components: <code class="code">distances</code>, <code class="code">parents</code> and <code class="code">edges</code>. Each of these is a list of integers with one entry for each vertex <code class="code">v</code> as follows:</p>


<ul>
<li><p><code class="code">distances[v]</code> is the total weight of the shortest path from <var class="Arg">source</var> to <code class="code">v</code>.</p>

</li>
<li><p><code class="code">parents[v]</code> is the final vertex before <code class="code">v</code> on the shortest path from <var class="Arg">source</var> to <code class="code">v</code>.</p>

</li>
<li><p><code class="code">edges[v]</code> is the index of the edge of lowest weight going from <code class="code">parents[v]</code> to <code class="code">v</code>.</p>

</li>
</ul>
<p>Using these three components together, you can find the shortest edge weighted path to all other vertices from a starting vertex.</p>

<p>If no path exists from <var class="Arg">source</var> to <code class="code">v</code>, then <code class="code">parents[v]</code> and <code class="code">edges[v]</code> will both be <code class="keyw">fail</code>. The distance from <var class="Arg">source</var> to itself is considered to be 0, and so both <code class="code">parents[<var class="Arg">source</var>]</code> and <code class="code">edges[<var class="Arg">source</var>]</code> are <code class="keyw">fail</code>. Edge weights can have negative values, but there is currently no implemented method for this operation if a negative-weighted cycle exists.</p>

<p>In the one-argument form, the value returned is also a record containing components <code class="code">distances</code>, <code class="code">parents</code> and <code class="code">edges</code>, but each of these will instead be a list of lists in which the <code class="code">i</code>th entry is the list that corresponds to paths starting at <code class="code">i</code>.</p>

<p>For a simple way of finding the shortest path between two specific vertices, see <code class="func">EdgeWeightedDigraphShortestPath</code> (<a href="chap6_mj.html#X7DAF81B779BD9165"><span class="RefLink">6.3-6</span></a>). See also the non-weighted operation <code class="func">DigraphShortestPath</code> (<a href="chap5_mj.html#X80E9D645843973A6"><span class="RefLink">5.4-24</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := EdgeWeightedDigraph([[2, 3], [4], [4], []],</span>
<span class="GAPprompt">></span> <span class="GAPinput">                            [[5, 1], [6], [11], []]);</span>
<immutable digraph with 4 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeightedDigraphShortestPaths(D, 1);</span>
rec( distances := [ 0, 5, 1, 11 ], edges := [ fail, 1, 2, 1 ], 
  parents := [ fail, 1, 1, 2 ] )
<span class="GAPprompt">gap></span> <span class="GAPinput">D := EdgeWeightedDigraph([[2], [3], [1]], [[1], [2], [3]]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeightedDigraphShortestPaths(D);</span>
rec( distances := [ [ 0, 1, 3 ], [ 5, 0, 2 ], [ 3, 4, 0 ] ], 
  edges := [ [ fail, 1, 1 ], [ 1, fail, 1 ], [ 1, 1, fail ] ], 
  parents := [ [ fail, 1, 1 ], [ 2, fail, 2 ], [ 3, 3, fail ] ] )</pre></div>

<p><a id="X7DAF81B779BD9165" name="X7DAF81B779BD9165"></a></p>

<h5>6.3-6 EdgeWeightedDigraphShortestPath</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EdgeWeightedDigraphShortestPath</code>( <var class="Arg">digraph</var>, <var class="Arg">source</var>, <var class="Arg">dest</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A pair of lists, or <code class="keyw">fail</code>.</p>

<p>If <var class="Arg">digraph</var> is an edge-weighted digraph with vertices <var class="Arg">source</var> and <var class="Arg">dest</var>, this operation returns a directed path from <var class="Arg">source</var> to <var class="Arg">dest</var> with the smallest possible total weight. The output is a pair of lists <code class="code">[v, a]</code> of the form described in <code class="func">DigraphPath</code> (<a href="chap5_mj.html#X8039170B82A32257"><span class="RefLink">5.4-23</span></a>).</p>

<p>If <span class="SimpleMath">\(\textit{source} = \textit{dest}\)</span> or no path exists, then <code class="keyw">fail</code> is returned.</p>

<p>If <var class="Arg">digraph</var> contains a negative-weighted cycle, then there is currently no applicable method for this attribute.</p>

<p>See <code class="func">EdgeWeightedDigraphShortestPaths</code> (<a href="chap6_mj.html#X7EDB9C9A840F6A84"><span class="RefLink">6.3-5</span></a>). See also the non-weighted operation <code class="func">DigraphShortestPath</code> (<a href="chap5_mj.html#X80E9D645843973A6"><span class="RefLink">5.4-24</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := EdgeWeightedDigraph([[2, 3], [4], [4], []],</span>
<span class="GAPprompt">></span> <span class="GAPinput">                            [[5, 1], [6], [11], []]);</span>
<immutable digraph with 4 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeightedDigraphShortestPath(D, 1, 4);</span>
[ [ 1, 2, 4 ], [ 1, 1 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">EdgeWeightedDigraphShortestPath(D, 3, 2);</span>
fail</pre></div>

<p><a id="X869EFE9F818C6E22" name="X869EFE9F818C6E22"></a></p>

<h5>6.3-7 DigraphMaximumFlow</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DigraphMaximumFlow</code>( <var class="Arg">digraph</var>, <var class="Arg">start</var>, <var class="Arg">destination</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A list of lists of integers.</p>

<p>If <var class="Arg">digraph</var> is an edge-weighted digraph with vertices <var class="Arg">start</var> and <var class="Arg">destination</var>, this returns a record representing the maximum flow from <var class="Arg">start</var> to <var class="Arg">destination</var> in the digraph.</p>

<p>A <em>flow</em> is a function from the weighted edges of <var class="Arg">digraph</var> to the positive real numbers, such that:</p>


<ul>
<li><p>Each edge's flow is no more than its weight;</p>

</li>
<li><p>For each vertex other than <var class="Arg">start</var> and <var class="Arg">destination</var>, the sum of flows for all incoming edges is equal to the sum of flows for all outgoing edges;</p>

</li>
<li><p>The sum of flows of edges leaving <var class="Arg">start</var> is equal to the sum of flows of edges entering <var class="Arg">destination</var> (this sum is denoted <span class="SimpleMath">\(M\)</span>).</p>

</li>
</ul>
<p>A <em>maximum flow</em> is a flow that maximises the value of <span class="SimpleMath">\(M\)</span>.</p>

<p>The flow is represented as a list of lists where each entry is a number representing the flow on the edge in the corresponding position in <code class="code">OutNeighbours(<var class="Arg">digraph</var>)</code>. Note that the value <span class="SimpleMath">\(M\)</span> of the flow can be found with <code class="code">Sum(DigraphMaximumFlow(<var class="Arg">digraph</var>, <var class="Arg">start</var>, <var class="Arg">destination</var>)[<var class="Arg">start</var>])</code>.</p>

<p>This attribute is computed by an implementation of the push–relabel maximum flow algorithm, which has time complexity <span class="SimpleMath">\(O(v^2 e)\)</span> where <span class="SimpleMath">\(v\)</span> is the number of vertices of the digraph, and <span class="SimpleMath">\(e\)</span> is the number of edges.</p>

<p>See <code class="func">EdgeWeights</code> (<a href="chap6_mj.html#X8639092D8689333D"><span class="RefLink">6.3-1</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">g := EdgeWeightedDigraph([[2, 2], [3], []], [[3, 2], [1], []]);</span>
<immutable multidigraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">flow := DigraphMaximumFlow(g, 1, 3);</span>
[ [ 1, 0 ], [ 1 ], [  ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Sum(flow[1]);</span>
1</pre></div>

<p><a id="X8194E7078167A9E4" name="X8194E7078167A9E4"></a></p>

<h5>6.3-8 RandomUniqueEdgeWeightedDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RandomUniqueEdgeWeightedDigraph</code>( [<var class="Arg">filt</var>, ]<var class="Arg">n</var>[, <var class="Arg">p</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: An edge-weighted digraph.</p>

<p>This operation returns a random edge-weighted digraph.</p>

<p>Its behaviour is the same as that of <code class="func">RandomDigraph</code> (<a href="chap3_mj.html#X86CF9F66788B2A24"><span class="RefLink">3.4-1</span></a>) but the returned digraph will additionally have the <code class="func">EdgeWeights</code> (<a href="chap6_mj.html#X8639092D8689333D"><span class="RefLink">6.3-1</span></a>) attribute populated with random unique weights from the set <code class="code">[1 .. m]</code> where <code class="code">m</code> is the number of edges in the digraph.</p>

<p>If the optional first argument <var class="Arg">filt</var> is present, then this should specify the category or representation the digraph being created will belong to. For example, if <var class="Arg">filt</var> is <code class="func">IsMutableDigraph</code> (<a href="chap3_mj.html#X7D7EDF83820ED6F5"><span class="RefLink">3.1-2</span></a>), then the digraph being created will be mutable, if <var class="Arg">filt</var> is <code class="func">IsImmutableDigraph</code> (<a href="chap3_mj.html#X7CAFAA89804F80BD"><span class="RefLink">3.1-3</span></a>), then the digraph will be immutable. If the optional first argument <var class="Arg">filt</var> is not present, then <code class="func">IsImmutableDigraph</code> (<a href="chap3_mj.html#X7CAFAA89804F80BD"><span class="RefLink">3.1-3</span></a>) is used by default.</p>

<p>If <var class="Arg">n</var> is a non-negative integer, then the returned digraph will have <var class="Arg">n</var> vertices. If the optional second argument <var class="Arg">p</var> is a float with value <span class="SimpleMath">\(0 \leq \)</span> <var class="Arg"> p </var> <span class="SimpleMath">\( \leq 1\)</span>, then an edge will exist between each pair of vertices with probability approximately <var class="Arg">p</var>. If <var class="Arg">p</var> is not specified, then a random probability will be assumed (chosen with uniform probability).</p>

<p>For more information on the arguments and behaviour of this operation, see <code class="func">RandomDigraph</code> (<a href="chap3_mj.html#X86CF9F66788B2A24"><span class="RefLink">3.4-1</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">RandomUniqueEdgeWeightedDigraph(5);</span>
<immutable digraph with 5 vertices, 21 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">RandomUniqueEdgeWeightedDigraph(5, 1 / 2);</span>
<immutable digraph with 5 vertices, 14 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">RandomUniqueEdgeWeightedDigraph(IsEulerianDigraph, 5, 1 / 3);</span>
<immutable digraph with 5 vertices, 6 edges></pre></div>

<p><a id="X86424F167BD4F629" name="X86424F167BD4F629"></a></p>

<h4>6.4 <span class="Heading">Orders</span></h4>

<p><a id="X8617726C7829F796" name="X8617726C7829F796"></a></p>

<h5>6.4-1 IsPreorderDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsPreorderDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsQuasiorderDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>A digraph is a preorder digraph if and only if the digraph satisfies both <code class="func">IsReflexiveDigraph</code> (<a href="chap6_mj.html#X8462D8E2792B23F6"><span class="RefLink">6.2-13</span></a>) and <code class="func">IsTransitiveDigraph</code> (<a href="chap6_mj.html#X7F0835667F29F0C0"><span class="RefLink">6.2-16</span></a>). A preorder digraph (or quasiorder digraph) <var class="Arg">digraph</var> corresponds to the preorder relation <span class="SimpleMath">\(\leq\)</span> defined by <span class="SimpleMath">\(x \leq y\)</span> if and only if <code class="code">[x, y]</code> is an edge of <var class="Arg">digraph</var>.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1], [2, 3], [2, 3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPreorderDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1 .. 4], [1 .. 4], [1 .. 4], [1 .. 4]]);</span>
<immutable digraph with 4 vertices, 16 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPreorderDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], [3], [4], [5], [1]]);</span>
<immutable digraph with 5 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPreorderDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1], [1, 2], [2, 3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsQuasiorderDigraph(D);</span>
false
</pre></div>

<p><a id="X82BAE6D37D49A145" name="X82BAE6D37D49A145"></a></p>

<h5>6.4-2 IsPartialOrderDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsPartialOrderDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>A digraph is a partial order digraph if and only if the digraph satisfies all of <code class="func">IsReflexiveDigraph</code> (<a href="chap6_mj.html#X8462D8E2792B23F6"><span class="RefLink">6.2-13</span></a>), <code class="func">IsAntisymmetricDigraph</code> (<a href="chap6_mj.html#X7DB1BC2286FC08E2"><span class="RefLink">6.2-2</span></a>) and <code class="func">IsTransitiveDigraph</code> (<a href="chap6_mj.html#X7F0835667F29F0C0"><span class="RefLink">6.2-16</span></a>). A partial order <var class="Arg">digraph</var> corresponds to the partial order relation <span class="SimpleMath">\(\leq\)</span> defined by <span class="SimpleMath">\(x \leq y\)</spanif and only if <code class="code">[x, y]</code> is an edge of <var class="Arg">digraph</var>.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 3], [2, 3], [3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPartialOrderDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(5);</span>
<immutable cycle digraph with 5 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPartialOrderDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]);</span>
<immutable multidigraph with 4 vertices, 10 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPartialOrderDigraph(D);</span>
true
</pre></div>

<p><a id="X78D3E17B7F737516" name="X78D3E17B7F737516"></a></p>

<h5>6.4-3 IsMeetSemilatticeDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsMeetSemilatticeDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsJoinSemilatticeDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsLatticeDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p><code class="code">IsMeetSemilatticeDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is a meet semilattice; <code class="code">IsJoinSemilatticeDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is a join semilattice; and <code class="code">IsLatticeDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is both a meet and a join semilattice.</p>

<p>For a partial order digraph <code class="func">IsPartialOrderDigraph</code> (<a href="chap6_mj.html#X82BAE6D37D49A145"><span class="RefLink">6.4-2</span></a>) the corresponding partial order is the relation <span class="SimpleMath">\(\leq\)</span>, defined by <span class="SimpleMath">\(x \leq y\)</span> if and only if <code class="code">[x, y]</code> is an edge. A digraph is a <em>meet semilattice</em> if it is a partial order and every pair of vertices has a greatest lower bound (meet) with respect to the aforementioned relation. A <em>join semilattice</em> is a partial order where every pair of vertices has a least upper bound (join) with respect to the relation.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 3], [2, 3], [3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMeetSemilatticeDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsJoinSemilatticeDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsLatticeDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1], [2], [1 .. 3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsJoinSemilatticeDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMeetSemilatticeDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsLatticeDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1 .. 4], [2, 4], [3, 4], [4]]);</span>
<immutable digraph with 4 vertices, 9 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMeetSemilatticeDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsJoinSemilatticeDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsLatticeDigraph(D);</span>
true
</pre></div>

<p><a id="X84F4711F7FA36848" name="X84F4711F7FA36848"></a></p>

<h5>6.4-4 DigraphMeetTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DigraphMeetTable</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DigraphJoinTable</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A matrix or <code class="keyw">fail</code>.</p>

<p><code class="code">DigraphMeetTable</code> returns the <em>meet table</em> of <var class="Arg">digraph</var> if <var class="Arg">digraph</var> is a meet semilattice digraph <code class="func">IsMeetSemilatticeDigraph</code> (<a href="chap6_mj.html#X78D3E17B7F737516"><span class="RefLink">6.4-3</span></a>). Similarly, <code class="code">DigraphJoinTable</code> returns the <em>join table</em> of <var class="Arg">digraph</var> if <var class="Arg">digraph</var> is a join semilattice digraph. <code class="func">IsJoinSemilatticeDigraph</code> (<a href="chap6_mj.html#X78D3E17B7F737516"><span class="RefLink">6.4-3</span></a>).</p>

<p>When <var class="Arg">digraph</var> is a meet semilattice digraph with <span class="SimpleMath">\(n\)</span> vertices, the <em>meet table</em> of <var class="Arg">digraph</var> is the matrix <span class="SimpleMath">\(A\)</span> such that the <span class="SimpleMath">\((i, j)\)</span> entry of <span class="SimpleMath">\(A\)</span> is the meet of vertices <span class="SimpleMath">\(i\)</span> and <span class="SimpleMath">\(j\)</span>.</p>

<p>Similarly, when <var class="Arg">digraph</var> is a join semilattice digraph with <span class="SimpleMath">\(n\)</span> vertices, the <em>join table</em> of <var class="Arg">digraph</var> is the matrix <span class="SimpleMath">\(A\)</span> such that the <span class="SimpleMath">\((i, j)\)</span> entry of <span class="SimpleMath">\(A\)</span> is the join of vertices <span class="SimpleMath">\(i\)</span> and <span class="SimpleMath">\(j\)</span>. Otherwise, each function returns <code class="keyw">fail</code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 2, 3, 4], [2, 4], [3, 4], [4]]);</span>
<immutable digraph with 4 vertices, 9 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsJoinSemilatticeDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">Display(DigraphJoinTable(D));</span>
[ [  1,  2,  3,  4 ],
  [  2,  2,  4,  4 ],
  [  3,  4,  3,  4 ],
  [  4,  4,  4,  4 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(5);</span>
<immutable cycle digraph with 5 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphJoinTable(D);</span>
fail
</pre></div>

<p><a id="X786213437E99065B" name="X786213437E99065B"></a></p>

<h5>6.4-5 IsOrderIdeal</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsOrderIdeal</code>( <var class="Arg">D</var>, <var class="Arg">subset</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This function returns <code class="keyw">true</code> if the specified subset is "downwards" closed, i.e. contains every vertex less than the given vertices in the order defined by <var class="Arg">D</var>. The function can only be used on digraphs satisfying <code class="func">IsPartialOrderDigraph</code> (<a href="chap6_mj.html#X82BAE6D37D49A145"><span class="RefLink">6.4-2</span></a>) and will throw an error if passed a digraph that is not a partial order digraph.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D1 := Digraph([[1, 3], [2, 3], [3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOrderIdeal(D1, [1, 2, 3]);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D2 := DigraphDisjointUnion(D1, D1);</span>
<immutable digraph with 6 vertices, 10 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOrderIdeal(D2, [1, 2, 3]);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOrderIdeal(D2, [4, 5, 6]);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOrderIdeal(D2, [1, 5, 6]);</span>
false
</pre></div>

<p><a id="X7A1D8F4582F8EA53" name="X7A1D8F4582F8EA53"></a></p>

<h5>6.4-6 IsOrderFilter</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsOrderFilter</code>( <var class="Arg">D</var>, <var class="Arg">subset</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This function returns <code class="keyw">true</code> if the specified subset is upwards closed. A subset is upwards closed if it contains every vertex greater than the given vertices in the order defined by <var class="Arg">D</var>. The function can only be used on digraphs satisfying <code class="func">IsPartialOrderDigraph</code> (<a href="chap6_mj.html#X82BAE6D37D49A145"><span class="RefLink">6.4-2</span></a>) and will throw an error if passed a digraph that is not a partial order digraph.</p>


<div class="example"><pre><span class="GAPprompt">gap></span> <span class="GAPinput">D1 := DigraphByEdges(</span>
<span class="GAPprompt">></span> <span class="GAPinput">[[1, 2], [2, 3], [1, 3], [1, 1], [2, 2], [3, 3]]);</span>
<immutable digraph with 3 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOrderFilter(D1, [2, 3]);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOrderFilter(D1, [1, 2]);</span>
true    
    </pre></div>

<p><a id="X7DEDCD177E5AE824" name="X7DEDCD177E5AE824"></a></p>

<h5>6.4-7 IsUpperSemimodularDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsUpperSemimodularDigraph</code>( <var class="Arg">D</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsLowerSemimodularDigraph</code>( <var class="Arg">D</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p><code class="code">IsUpperSemimodularDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">D</var> represents an upper semimodular lattice and <code class="keyw">false</code> if it does not. Similarly, <code class="code">IsLowerSemimodularDigraph</codereturns <code class="keyw">true</code> if <var class="Arg">D</var> represents a lower semimodular lattice and <code class="keyw">false</code> if it does not.</p>

<p>In a lattice we say that a vertex <code class="code">a</code> <em>covers</em> a vertex <code class="code">b</code> if <code class="code">a</code> is greater than <code class="code">b</code>, and there are no further vertices between <code class="code">a</code> and <code class="code">b</code>. A lattice is <em>upper semimodular</em> if whenever the meet of <code class="code">a</code> and <code class="code">b</code> is covered by <code class="code">a</code>, the join of <code class="code">a</code> and <code class="code">b</code> covers <code class="code">b</code>. <em>Lower semimodularity</em> is defined analogously.</p>

<p>See also <code class="func">IsLatticeDigraph</code> (<a href="chap6_mj.html#X78D3E17B7F737516"><span class="RefLink">6.4-3</span></a>), <code class="func">NonUpperSemimodularPair</code> (<a href="chap5_mj.html#X824B9896798530F6"><span class="RefLink">5.3-2</span></a>), and <code class="func">NonLowerSemimodularPair</code> (<a href="chap5_mj.html#X824B9896798530F6"><span class="RefLink">5.3-2</span></a>). If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphFromDigraph6String(</span>
<span class="GAPprompt">></span> <span class="GAPinput">"&M~~sc`lYUZO__KIBboC_@h?U_?_GL?A_?c");</span>
<immutable digraph with 14 vertices, 66 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsUpperSemimodularDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsLowerSemimodularDigraph(D);</span>
false</pre></div>

<p><a id="X7B566B4A86E18F45" name="X7B566B4A86E18F45"></a></p>

<h5>6.4-8 IsDistributiveLatticeDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsDistributiveLatticeDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p><code class="code">IsDistributiveLatticeDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is a distributive lattice digraph.</p>

<p>A <em>distributive lattice digraph</em> is a lattice digraph (<code class="func">IsLatticeDigraph</code> (<a href="chap6_mj.html#X78D3E17B7F737516"><span class="RefLink">6.4-3</span></a>)) which is distributive. That is to say, the functions <code class="func">PartialOrderDigraphMeetOfVertices</code> (<a href="chap5_mj.html#X7DDB33B686B3A2C6"><span class="RefLink">5.3-1</span></a>) and <code class="func">PartialOrderDigraphJoinOfVertices</code> (<a href="chap5_mj.html#X7DDB33B686B3A2C6"><span class="RefLink">5.3-1</span></a>) distribute over each other.</p>

<p>Equivalently, a distributive lattice digraph is a lattice digraph in which the <em>lattice digraphs</em> representing <span class="SimpleMath">\(M3\)</span> and <span class="SimpleMath">\(N5\)</span> are not embeddable as lattices (see <span class="URL"><a href="https://en.wikipedia.org/wiki/Distributive_lattice">https://en.wikipedia.org/wiki/Distributive_lattice</a></span> and <code class="func">IsLatticeEmbedding</code> (<a href="chap7_mj.html#X7E183D4979D324EF"><span class="RefLink">7.3-21</span></a>)).</p>

<p><figure> <img height="200" src="m3.png"/>      <img height="200" src="n5.png"/> <figcaption>The lattices <e>M3</e> and <e>N5</e>.</figcaption> </figure> If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 3], [4], [4], []]);</span>
<immutable digraph with 4 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphReflexiveTransitiveClosure(D);</span>
<immutable preorder digraph with 4 vertices, 9 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDistributiveLatticeDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">N5 := Digraph([[2, 4], [3], [5], [5], []]);</span>
<immutable digraph with 5 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">N5 := DigraphReflexiveTransitiveClosure(N5);</span>
<immutable preorder digraph with 5 vertices, 13 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDistributiveLatticeDigraph(N5);</span>
false</pre></div>

<p><a id="X80659D5784790B52" name="X80659D5784790B52"></a></p>

<h5>6.4-9 IsModularLatticeDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsModularLatticeDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p><code class="code">IsModularLatticeDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is a modular lattice digraph.</p>

<p>A <em>modular lattice digraph</em> is a lattice digraph (<code class="func">IsLatticeDigraph</code> (<a href="chap6_mj.html#X78D3E17B7F737516"><span class="RefLink">6.4-3</span></a>)) which is modular. That is to say, the lattice digraph representing <span class="SimpleMath">\(N5\)</span> is not embeddable as a lattice (see <span class="URL"><a href="https://en.wikipedia.org/wiki/Modular_lattice">https://en.wikipedia.org/wiki/Modular_lattice</a></span> and <code class="func">IsLatticeEmbedding</code> (<a href="chap7_mj.html#X7E183D4979D324EF"><span class="RefLink">7.3-21</span></a>)).</p>

<p><figure> <img height="200" src="n5.png"/> <figcaption>The lattice <e>N5</e>.</figcaption> </figure> If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := ChainDigraph(5);</span>
<immutable chain digraph with 5 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphReflexiveTransitiveClosure(D);</span>
<immutable preorder digraph with 5 vertices, 15 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsModularLatticeDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">N5 := Digraph([[2, 3], [4], [4], []]);</span>
<immutable digraph with 4 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphReflexiveTransitiveClosure(N5);</span>
<immutable preorder digraph with 4 vertices, 9 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsModularLatticeDigraph(N5);</span>
false
</pre></div>

<p><a id="X7AAF896982EC22FA" name="X7AAF896982EC22FA"></a></p>

<h4>6.5 <span class="Heading">Regularity</span></h4>

<p><a id="X7A3F78B37E31D9E1" name="X7A3F78B37E31D9E1"></a></p>

<h5>6.5-1 IsInRegularDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsInRegularDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if there is an integer <code class="code">n</codesuch that for every vertex <code class="code">v</code> of digraph <var class="Arg">digraph</var> there are exactly <code class="code">n</code> edges terminating in <code class="code">v</code>. See also <code class="func">IsOutRegularDigraph</code> (<a href="chap6_mj.html#X7F0A806E7BCB413C"><span class="RefLink">6.5-2</span></a>) and <code class="func">IsRegularDigraph</code> (<a href="chap6_mj.html#X7AF9DB1E7DB12306"><span class="RefLink">6.5-3</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsInRegularDigraph(CompleteDigraph(4));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsInRegularDigraph(ChainDigraph(4));</span>
false
</pre></div>

<p><a id="X7F0A806E7BCB413C" name="X7F0A806E7BCB413C"></a></p>

<h5>6.5-2 IsOutRegularDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsOutRegularDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if there is an integer <code class="code">n</codesuch that for every vertex <code class="code">v</code> of digraph <var class="Arg">digraph</var> there are exactly <code class="code">n</code> edges starting at <code class="code">v</code>.</p>

<p>See also <code class="func">IsInRegularDigraph</code> (<a href="chap6_mj.html#X7A3F78B37E31D9E1"><span class="RefLink">6.5-1</span></a>) and <code class="func">IsRegularDigraph</code> (<a href="chap6_mj.html#X7AF9DB1E7DB12306"><span class="RefLink">6.5-3</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOutRegularDigraph(CompleteDigraph(4));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOutRegularDigraph(ChainDigraph(4));</span>
false
</pre></div>

<p><a id="X7AF9DB1E7DB12306" name="X7AF9DB1E7DB12306"></a></p>

<h5>6.5-3 IsRegularDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsRegularDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if there is an integer <code class="code">n</codesuch that for every vertex <code class="code">v</code> of digraph <var class="Arg">digraph</var> there are exactly <code class="code">n</code> edges starting and terminating at <code class="code">v</code>. In other words, the property is <code class="keyw">true</code> if <var class="Arg">digraph</var> is both in-regular and and out-regular. See also <code class="func">IsInRegularDigraph</code> (<a href="chap6_mj.html#X7A3F78B37E31D9E1"><span class="RefLink">6.5-1</span></a>) and <code class="func">IsOutRegularDigraph</code> (<a href="chap6_mj.html#X7F0A806E7BCB413C"><span class="RefLink">6.5-2</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsRegularDigraph(CompleteDigraph(4));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsRegularDigraph(ChainDigraph(4));</span>
false
</pre></div>

<p><a id="X7E2082AC7CAE59CD" name="X7E2082AC7CAE59CD"></a></p>

<h5>6.5-4 IsDistanceRegularDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsDistanceRegularDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>If <var class="Arg">digraph</var> is a connected symmetric graph, this property returns <code class="keyw">true</code> if for any two vertices <code class="code">u</code> and <code class="code">v</code> of <var class="Arg">digraph</var> and any two integers <code class="code">i</code> and <code class="code">j</code> between <code class="code">0</code> and the diameter of <var class="Arg">digraph</var>, the number of vertices at distance <code class="code">i</code> from <code class="code">u</codeand distance <code class="code">j</code> from <code class="code">v</code> depends only on <code class="code">i</code>, <code class="code">j</code>, and the distance between vertices <code class="code">u</code> and <code class="code">v</code>.</p>

<p>Alternatively, a distance regular graph is a graph for which there exist integers <code class="code">b_i</code>, <code class="code">c_i</code>, and <code class="code">i</code> such that for any two vertices <code class="code">u</code>, <code class="code">v</code> in <var class="Arg">digraph</varwhich are distance <code class="code">i</code> apart, there are exactly <code class="code">b_i</code> neighbors of <code class="code">v</code> which are at distance <code class="code">i - 1</code> away from <code class="code">u</code>, and <code class="code">c_i</code> neighbors of <code class="code">v</code> which are at distance <code class="code">i + 1</code> away from <code class="code">u</code>. This definition is used to check whether <var class="Arg">digraph</var> is distance regular.</p>

<p>In the case where <var class="Arg">digraph</var> is not symmetric or not connected, the property is <code class="keyw">false</code>.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphSymmetricClosure(ChainDigraph(5));;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDistanceRegularDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 3, 4], [1, 3, 4], [1, 2, 4], [1, 2, 3]]);</span>
<immutable digraph with 4 vertices, 12 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDistanceRegularDigraph(D);</span>
true
</pre></div>

<p><a id="X780DAEB37C5E07FD" name="X780DAEB37C5E07FD"></a></p>

<h4>6.6 <span class="Heading">Connectivity and cycles</span></h4>

<p><a id="X7BD08D4478218F77" name="X7BD08D4478218F77"></a></p>

<h5>6.6-1 IsAcyclicDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsAcyclicDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is acyclic, and <code class="keyw">false</code> if it is not. A digraph is <em>acyclic</em> if every directed cycle on the digraph is trivial. See Section <a href="chap1_mj.html#X84541F61810C741D"><span class="RefLink">1.1-1</span></a> for the definition of a directed cycle, and of a trivial directed cycle.</p>

<p>The method used in this operation has complexity <span class="SimpleMath">\(O(m+n)\)</span> where <span class="SimpleMath">\(m\)</span> is the number of edges (counting multiple edges as one) and <span class="SimpleMath">\(n\)</span> is the number of vertices in the digraph.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">Petersen := Graph(SymmetricGroup(5), [[1, 2]], OnSets,</span>
<span class="GAPprompt">></span> <span class="GAPinput">function(x, y)</span>
<span class="GAPprompt">></span> <span class="GAPinput">  return IsEmpty(Intersection(x, y));</span>
<span class="GAPprompt">></span> <span class="GAPinput">end);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph(Petersen);</span>
<immutable digraph with 10 vertices, 30 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAcyclicDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphFromDiSparse6String(</span>
<span class="GAPprompt">></span> <span class="GAPinput">".b_OGCIDBaPGkULEbQHCeRIdrHcuZMfRyDAbPhTi|zF");</span>
<immutable digraph with 35 vertices, 34 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAcyclicDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAcyclicDigraph(ChainDigraph(10));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteDigraph(IsMutableDigraph, 4);</span>
<mutable digraph with 4 vertices, 12 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAcyclicDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAcyclicDigraph(CycleDigraph(10));</span>
false</pre></div>

<p><a id="X79563B297C220FB5" name="X79563B297C220FB5"></a></p>

<h5>6.6-2 IsChainDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsChainDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p><code class="code">IsChainDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is isomorphic to the chain digraph with the same number of vertices as <var class="Arg">digraph</var>, and <code class="keyw">false</code> if it is not; see <code class="func">ChainDigraph</code> (<a href="chap3_mj.html#X870594FC866AC88E"><span class="RefLink">3.5-11</span></a>).</p>

<p>A digraph is a <em>chain</em> if and only if it is a directed tree, in which every vertex has out degree at most one; see <code class="func">IsDirectedTree</code> (<a href="chap6_mj.html#X7B46EA6C7B2DF2FB"><span class="RefLink">6.6-8</span></a>) and <code class="func">OutDegrees</code> (<a href="chap5_mj.html#X7F5ACE807D1BC2E2"><span class="RefLink">5.2-8</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 3], [2, 3], [3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsChainDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := ChainDigraph(5);</span>
<immutable chain digraph with 5 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsChainDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphReverse(D);</span>
<immutable digraph with 5 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsChainDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := ChainDigraph(IsMutableDigraph, 5);</span>
<mutable digraph with 5 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsChainDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphReverse(D);</span>
<mutable digraph with 5 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsChainDigraph(D);</span>
true</pre></div>

<p><a id="X83C08C0B7EC1A91F" name="X83C08C0B7EC1A91F"></a></p>

<h5>6.6-3 IsConnectedDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsConnectedDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is weakly connected and <code class="keyw">false</code> if it is not. A digraph <var class="Arg">digraph</var> is <em>weakly connected</em> if it is possible to travel from any vertex to any other vertex by traversing edges in either direction (possibly against the orientation of some of them).</p>

<p>The method used in this function has complexity <span class="SimpleMath">\(O(m)\)</span> if the digraph's <code class="func">DigraphSource</code> (<a href="chap5_mj.html#X7FDEBF3279759961"><span class="RefLink">5.2-5</span></a>) attribute is set, otherwise it has complexity <span class="SimpleMath">\(O(m+n)\)</span> (where <span class="SimpleMath">\(m\)</span> is the number of edges and <span class="SimpleMath">\(n\)</span> is the number of vertices of the digraph).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], [3], []]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsConnectedDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 3], [4], [3], []]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsConnectedDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph(IsMutableDigraph, [[2], [3], []]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsConnectedDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph(IsMutableDigraph, [[1, 3], [4], [3], []]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsConnectedDigraph(D);</span>
false</pre></div>

<p><a id="X838FAF2D825977BE" name="X838FAF2D825977BE"></a></p>

<h5>6.6-4 IsBiconnectedDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsBiconnectedDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>A connected digraph is <em>biconnected</em> if it is still connected (in the sense of <code class="func">IsConnectedDigraph</code> (<a href="chap6_mj.html#X83C08C0B7EC1A91F"><span class="RefLink">6.6-3</span></a>)) when any vertex is removed. If <var class="Arg">D</var> has at least 3 vertices, then <code class="code">IsBiconnectedDigraph</code> implies <code class="func">IsBridgelessDigraph</code> (<a href="chap6_mj.html#X7D2A6572820B7F24"><span class="RefLink">6.6-5</span></a>); see <code class="func">ArticulationPoints</code> (<a href="chap5_mj.html#X7DDE06E47E605DD7"><span class="RefLink">5.4-14</span></a>) or <code class="func">Bridges</code> (<a href="chap5_mj.html#X84D5A125848BD800"><span class="RefLink">5.4-16</span></a>) for a more detailed explanation.</p>

<p><code class="code">IsBiconnectedDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is biconnected, and <code class="keyw">false</code> if it is not. In particular, <code class="code">IsBiconnectedDigraph</code> returns <code class="keyw">false</code> if <var class="Arg">digraph</var> is not connected.</p>

<p>Multiple edges are ignored by this method.</p>

<p>The method used in this operation has complexity <span class="SimpleMath">\(O(m+n)\)</span> where <span class="SimpleMath">\(m\)</span> is the number of edges and <span class="SimpleMath">\(n\)</span> is the number of vertices in the digraph.</p>

<p>See also <code class="func">Bridges</code> (<a href="chap5_mj.html#X84D5A125848BD800"><span class="RefLink">5.4-16</span></a>), <code class="func">ArticulationPoints</code> (<a href="chap5_mj.html#X7DDE06E47E605DD7"><span class="RefLink">5.4-14</span></a>), and <code class="func">IsBridgelessDigraph</code> (<a href="chap6_mj.html#X7D2A6572820B7F24"><span class="RefLink">6.6-5</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBiconnectedDigraph(Digraph([[1, 3], [2, 3], [3]]));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBiconnectedDigraph(CycleDigraph(5));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBiconnectedDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4);</span>
<mutable digraph with 9 vertices, 40 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBiconnectedDigraph(D);</span>
true</pre></div>

<p><a id="X7D2A6572820B7F24" name="X7D2A6572820B7F24"></a></p>

<h5>6.6-5 IsBridgelessDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsBridgelessDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>A connected digraph is <em>bridgeless</em> if it is still connected (in the sense of <code class="func">IsConnectedDigraph</code> (<a href="chap6_mj.html#X83C08C0B7EC1A91F"><span class="RefLink">6.6-3</span></a>)) when any edge is removed. If <var class="Arg">digraph</var> has at least 3 vertices, then <code class="func">IsBiconnectedDigraph</code> (<a href="chap6_mj.html#X838FAF2D825977BE"><span class="RefLink">6.6-4</span></a>) implies <code class="code">IsBridgelessDigraph</code>; see <code class="func">ArticulationPoints</code> (<a href="chap5_mj.html#X7DDE06E47E605DD7"><span class="RefLink">5.4-14</span></a>) or <code class="func">Bridges</code> (<a href="chap5_mj.html#X84D5A125848BD800"><span class="RefLink">5.4-16</span></a>) for a more detailed explanation.</p>

<p><code class="code">IsBridgelessDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is bridgeless, and <code class="keyw">false</code> if it is not. In particular, <code class="code">IsBridgelessDigraph</code> returns <code class="keyw">false</code> if <var class="Arg">digraph</var> is not connected.</p>

<p>Multiple edges are ignored by this method.</p>

<p>The method used in this operation has complexity <span class="SimpleMath">\(O(m+n)\)</span> where <span class="SimpleMath">\(m\)</span> is the number of edges and <span class="SimpleMath">\(n\)</span> is the number of vertices in the digraph.</p>

<p>See also <code class="func">Bridges</code> (<a href="chap5_mj.html#X84D5A125848BD800"><span class="RefLink">5.4-16</span></a>), <code class="func">ArticulationPoints</code> (<a href="chap5_mj.html#X7DDE06E47E605DD7"><span class="RefLink">5.4-14</span></a>), and <code class="func">IsBiconnectedDigraph</code> (<a href="chap6_mj.html#X838FAF2D825977BE"><span class="RefLink">6.6-4</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBridgelessDigraph(Digraph([[1, 3], [2, 3], [3]]));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBridgelessDigraph(CycleDigraph(5));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 1], [1, 1, 2], [3], [3, 3, 4, 4]]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBridgelessDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteBipartiteDigraph(IsMutableDigraph, 5, 4);</span>
<mutable digraph with 9 vertices, 40 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBridgelessDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 5], [1, 3, 4, 5], [2, 4], [2, 3], [1, 2]]);</span>
<immutable digraph with 5 vertices, 12 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBridgelessDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBiconnectedDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], [3], [4], [2]]);</span>
<immutable digraph with 4 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBridgelessDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBiconnectedDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBridgelessDigraph(ChainDigraph(2));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsBiconnectedDigraph(ChainDigraph(2));</span>
true
</pre></div>

<p><a id="X7B37B9467C68C208" name="X7B37B9467C68C208"></a></p>

<h5>6.6-6 IsStronglyConnectedDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsStronglyConnectedDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is strongly connected and <code class="keyw">false</code> if it is not.</p>

<p>A digraph <var class="Arg">digraph</var> is <em>strongly connected</em> if there is a directed path from every vertex to every other vertex. See Section <a href="chap1_mj.html#X84541F61810C741D"><span class="RefLink">1.1-1</span></a> for the definition of a directed path.</p>

<p>The method used in this operation is based on Gabow's Algorithm <a href="chapBib_mj.html#biBGab00">[Gab00]</a> and has complexity <span class="SimpleMath">\(O(m+n)\)</span>, where <span class="SimpleMath">\(m\)</span> is the number of edges (counting multiple edges as one) and <span class="SimpleMath">\(n\)</span> is the number of vertices in the digraph.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(250000);</span>
<immutable cycle digraph with 250000 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsStronglyConnectedDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphRemoveEdges(D, [[250000, 1]]);</span>
<immutable digraph with 250000 vertices, 249999 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsStronglyConnectedDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(IsMutableDigraph, 250000);</span>
<mutable digraph with 250000 vertices, 250000 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsStronglyConnectedDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphRemoveEdge(D, [250000, 1]);</span>
<mutable digraph with 250000 vertices, 249999 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsStronglyConnectedDigraph(D);</span>
false
</pre></div>

<p><a id="X80E883967EBE839E" name="X80E883967EBE839E"></a></p>

<h5>6.6-7 IsAperiodicDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsAperiodicDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property is <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is aperiodic, i.e. if its <code class="func">DigraphPeriod</code> (<a href="chap5_mj.html#X853D0B0981A33433"><span class="RefLink">5.4-18</span></a>) is equal to 1. Otherwise, the property is <code class="keyw">false</code>.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[6], [1], [2], [3], [4, 4], [5]]);</span>
<immutable multidigraph with 6 vertices, 7 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAperiodicDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], [3, 5], [4], [5], [1, 2]]);</span>
<immutable digraph with 5 vertices, 7 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAperiodicDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph(IsMutableDigraph, [[2], [3, 5], [4], [5], [1, 2]]);</span>
<mutable digraph with 5 vertices, 7 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsAperiodicDigraph(D);</span>
true</pre></div>

<p><a id="X7B46EA6C7B2DF2FB" name="X7B46EA6C7B2DF2FB"></a></p>

<h5>6.6-8 IsDirectedTree</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsDirectedTree</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsDirectedForest</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>The property <code class="func">IsDirectedTree</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is a directed tree, and the property <code class="func">IsDirectedForest</code> returns <code class="keyw">true</code> if <var class="Arg">digraph</varis a directed forest; otherwise these properties return <code class="keyw">false</code>.</p>

<p>A <em>directed tree</em> is an acyclic digraph with precisely one source, without multiple edges, and such that no two vertices share an out-neighbour. See and <code class="func">IsAcyclicDigraph</code> (<a href="chap6_mj.html#X7BD08D4478218F77"><span class="RefLink">6.6-1</span></a>) and <code class="func">DigraphSources</code> (<a href="chap5_mj.html#X7F5C6268839BE98C"><span class="RefLink">5.1-9</span></a>) for more information about these terms.</p>

<p>A <em>directed forest</em> is a digraph with at least one vertex, each of whose connected components is a directed tree. In other words, a directed forest is isomorphic to a disjoint union of directed trees. In particular, every directed tree is a directed forest. See <code class="func">DigraphConnectedComponents</code> (<a href="chap5_mj.html#X842FAD6A7B835977"><span class="RefLink">5.4-9</span></a>) and <code class="func">DigraphDisjointUnion</code> (<a href="chap3_mj.html#X814F1DFC83DB273F"><span class="RefLink">3.3-29</span></a>).</p>

<p>Please note that the empty digraph with zero vertices is not considered to be a directed tree or directed forest, because it has no source.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[3], [3], []]);</span>
<immutable digraph with 3 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDirectedTree(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], [3], []]);</span>
<immutable digraph with 3 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDirectedTree(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDirectedForest(DigraphDisjointUnion(D, D));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2, 3], [6], [4, 5], [], [], []]);</span>
<immutable digraph with 6 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDirectedTree(D);</span>
true
</pre></div>

<p><a id="X80FC20FA7AC4BC2A" name="X80FC20FA7AC4BC2A"></a></p>

<h5>6.6-9 IsUndirectedTree</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsUndirectedTree</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsUndirectedForest</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>The property <code class="func">IsUndirectedTree</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is an undirected tree, and the property <code class="func">IsUndirectedForest</code> returns <code class="keyw">true</code> if <var class="Arg">digraph</var> is an undirected forest; otherwise, these properties return <code class="keyw">false</code>.</p>

<p>An <em>undirected tree</em> is a symmetric digraph without loops, in which for any pair of distinct vertices <code class="code">u</code> and <code class="code">v</code>, there is exactly one directed path from <code class="code">u</code> to <code class="code">v</code>. See <code class="func">IsSymmetricDigraph</code> (<a href="chap6_mj.html#X81B3EA7887219860"><span class="RefLink">6.2-14</span></a>) and <code class="func">DigraphHasLoops</code> (<a href="chap6_mj.html#X7D92935C7D535187"><span class="RefLink">6.2-1</span></a>), and see Section <a href="chap1_mj.html#X84541F61810C741D"><span class="RefLink">1.1-1</span></a> for the definition of directed path. This definition implies that an undirected tree has no multiple edges.</p>

<p>An <em>undirected forest</em> is a digraph, each of whose connected components is an undirected tree. In other words, an undirected forest is isomorphic to a disjoint union of undirected trees. See <code class="func">DigraphConnectedComponents</code> (<a href="chap5_mj.html#X842FAD6A7B835977"><span class="RefLink">5.4-9</span></a>) and <code class="func">DigraphDisjointUnion</code> (<a href="chap3_mj.html#X814F1DFC83DB273F"><span class="RefLink">3.3-29</span></a>). In particular, every undirected tree is an undirected forest.</p>

<p>Please note that the digraph with zero vertices is considered to be neither an undirected tree nor an undirected forest.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[3], [3], [1, 2]]);</span>
<immutable digraph with 3 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsUndirectedTree(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsSymmetricDigraph(D) and not DigraphHasLoops(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[3], [5], [1, 4], [3], [2]]);</span>
<immutable digraph with 5 vertices, 6 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsConnectedDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsUndirectedTree(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsUndirectedForest(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 2], [1], [2]]);</span>
<immutable digraph with 3 vertices, 4 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsUndirectedTree(D) or IsUndirectedForest(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsSymmetricDigraph(D) or not DigraphHasLoops(D);</span>
false</pre></div>

<p><a id="X79DFBB198525544E" name="X79DFBB198525544E"></a></p>

<h5>6.6-10 IsEulerianDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsEulerianDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property returns true if the digraph <var class="Arg">digraph</var> is Eulerian.</p>

<p>A connected digraph is called <em>Eulerian</em> if there exists a directed circuit on the digraph which includes every edge exactly once. See Section <a href="chap1_mj.html#X84541F61810C741D"><span class="RefLink">1.1-1</span></a> for the definition of a directed circuit. Note that the empty digraph with at most one vertex is considered to be Eulerian.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[]]);</span>
<immutable empty digraph with 1 vertex>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEulerianDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], []]);</span>
<immutable digraph with 2 vertices, 1 edge>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEulerianDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[3], [], [2]]);</span>
<immutable digraph with 3 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEulerianDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[2], [3], [1]]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEulerianDigraph(D);</span>
true
</pre></div>

<p><a id="X79EFEBC37C2D262D" name="X79EFEBC37C2D262D"></a></p>

<h5>6.6-11 IsHamiltonianDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsHamiltonianDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>If <var class="Arg">digraph</var> is Hamiltonian, then this property returns <code class="keyw">true</code>, and <code class="keyw">false</code> if it is not.</p>

<p>A digraph with <code class="code">n</code> vertices is <em>Hamiltonian</em> if it has a directed cycle of length <code class="code">n</code>. See Section <a href="chap1_mj.html#X84541F61810C741D"><span class="RefLink">1.1-1</span></a> for the definition of a directed cycle. Note the empty digraphs on 0 and 1 vertices are considered to be Hamiltonian.</p>

<p>The method used in this operation has the worst case complexity as <code class="func">DigraphMonomorphism</code> (<a href="chap7_mj.html#X82D0FCD87D47ACA8"><span class="RefLink">7.3-4</span></a>).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">g := Digraph([[]]);</span>
<immutable empty digraph with 1 vertex>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsHamiltonianDigraph(g);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">g := Digraph([[2], [1]]);</span>
<immutable digraph with 2 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsHamiltonianDigraph(g);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">g := Digraph([[3], [], [2]]);</span>
<immutable digraph with 3 vertices, 2 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsHamiltonianDigraph(g);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">g := Digraph([[2], [3], [1]]);</span>
<immutable digraph with 3 vertices, 3 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsHamiltonianDigraph(g);</span>
true
</pre></div>

<p><a id="X7E91320B8028F5D8" name="X7E91320B8028F5D8"></a></p>

<h5>6.6-12 IsCycleDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsCycleDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p><code class="code">IsCycleDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is isomorphic to the cycle digraph with the same number of vertices as <var class="Arg">digraph</var>, and <code class="keyw">false</code> if it is not; see <code class="func">CycleDigraph</code> (<a href="chap3_mj.html#X80C29DDE876FFBEB"><span class="RefLink">3.5-16</span></a>).</p>

<p>A digraph is a <em>cycle</em> if and only if it is strongly connected and has the same number of edges as vertices.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := Digraph([[1, 3], [2, 3], [3]]);</span>
<immutable digraph with 3 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCycleDigraph(D);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CycleDigraph(5);</span>
<immutable cycle digraph with 5 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCycleDigraph(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := OnDigraphs(D, (1, 2, 3));</span>
<immutable digraph with 5 vertices, 5 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">D = CycleDigraph(5);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCycleDigraph(D);</span>
true</pre></div>

<p><a id="X7E2305528492DDC0" name="X7E2305528492DDC0"></a></p>

<h4>6.7 <span class="Heading">Planarity</span></h4>

<p><a id="X8606D415858C40AA" name="X8606D415858C40AA"></a></p>

<h5>6.7-1 IsPlanarDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsPlanarDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>A <em>planar</em> digraph is a digraph that can be embedded in the plane in such a way that its edges do not intersect. A digraph is planar if and only if it does not have a subdigraph that is homeomorphic to either the complete graph on <code class="code">5</code> vertices or the complete bipartite graph with vertex sets of sizes <code class="code">3</code> and <code class="code">3</code>.</p>

<p><code class="code">IsPlanarDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is planar and <code class="keyw">false</code> if it is not. The directions and multiplicities of any edges in <var class="Arg">digraph</var> are ignored by <code class="code">IsPlanarDigraph</code>.</p>

<p>See also <code class="func">IsOuterPlanarDigraph</code> (<a href="chap6_mj.html#X8251E8B187E7F059"><span class="RefLink">6.7-2</span></a>).</p>

<p>This method uses the reference implementation in <span class="URL"><a href="https://github.com/graph-algorithms/edge-addition-planarity-suite">edge-addition-planarity-suite</a></span> by John Boyer of the algorithms described in <a href="chapBib_mj.html#biBBM06">[BM06]</a>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteDigraph(4));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteDigraph(5));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteBipartiteDigraph(2, 3));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteBipartiteDigraph(3, 3));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteDigraph(IsMutableDigraph, 4));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteDigraph(IsMutableDigraph, 5));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteBipartiteDigraph(IsMutableDigraph, 2, 3));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsPlanarDigraph(CompleteBipartiteDigraph(IsMutableDigraph, 3, 3));</span>
false
</pre></div>

<p><a id="X8251E8B187E7F059" name="X8251E8B187E7F059"></a></p>

<h5>6.7-2 IsOuterPlanarDigraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsOuterPlanarDigraph</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>An <em>outer planar</em> digraph is a digraph that can be embedded in the plane in such a way that its edges do not intersect, and all vertices belong to the unbounded face of the embedding. A digraph is outer planar if and only if it does not have a subdigraph that is homeomorphic to either the complete graph on <code class="code">4</code> vertices or the complete bipartite graph with vertex sets of sizes <code class="code">2</code> and <code class="code">3</code>.</p>

<p><code class="code">IsOuterPlanarDigraph</code> returns <code class="keyw">true</code> if the digraph <var class="Arg">digraph</var> is outer planar and <code class="keyw">false</code> if it is not. The directions and multiplicities of any edges in <var class="Arg">digraph</var> are ignored by <code class="code">IsPlanarDigraph</code>.</p>

<p>See also <code class="func">IsPlanarDigraph</code> (<a href="chap6_mj.html#X8606D415858C40AA"><span class="RefLink">6.7-1</span></a>). This method uses the reference implementation in <span class="URL"><a href="https://github.com/graph-algorithms/edge-addition-planarity-suite">edge-addition-planarity-suite</a></span> by John Boyer of the algorithms described in <a href="chapBib_mj.html#biBBM06">[BM06]</a>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteDigraph(4));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteDigraph(5));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteBipartiteDigraph(2, 3));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteBipartiteDigraph(3, 3));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CycleDigraph(10));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteDigraph(IsMutableDigraph, 4));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteDigraph(IsMutableDigraph, 5));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteBipartiteDigraph(IsMutableDigraph,</span>
<span class="GAPprompt">></span> <span class="GAPinput">                                                 2, 3));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CompleteBipartiteDigraph(IsMutableDigraph,</span>
<span class="GAPprompt">></span> <span class="GAPinput">                                                 3, 3));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsOuterPlanarDigraph(CycleDigraph(IsMutableDigraph, 10));</span>
true

</pre></div>

<p><a id="X83DC8AD283C41326" name="X83DC8AD283C41326"></a></p>

<h4>6.8 <span class="Heading">Homomorphisms and transformations</span></h4>

<p><a id="X78C0B2637985648B" name="X78C0B2637985648B"></a></p>

<h5>6.8-1 IsDigraphCore</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsDigraphCore</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>This property returns <code class="keyw">true</code> if <var class="Arg">digraph</var> is a core, and <code class="keyw">false</code> if it is not.</p>

<p>A digraph <code class="code">D</code> is a <em>core</em> if and only if it has no proper subdigraphs <code class="code">A</code> such that there exists a homomorphism from <code class="code">D</code> to <code class="code">A</code>. In other words, a digraph <code class="code">D</code> is a core if and only if every endomorphism on <code class="code">D</code> is an automorphism on <code class="code">D</code>.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">D := CompleteDigraph(6);</span>
<immutable complete digraph with 6 vertices>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDigraphCore(D);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">D := DigraphSymmetricClosure(CycleDigraph(6));</span>
<immutable symmetric digraph with 6 vertices, 12 edges>
<span class="GAPprompt">gap></span> <span class="GAPinput">DigraphHomomorphism(D, CompleteDigraph(2));</span>
Transformation( [ 1, 2, 1, 2, 1, 2 ] )
<span class="GAPprompt">gap></span> <span class="GAPinput">IsDigraphCore(D);</span>
false
</pre></div>

<p><a id="X8361CA6E8401FF26" name="X8361CA6E8401FF26"></a></p>

<h5>6.8-2 IsEdgeTransitive</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsEdgeTransitive</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>If <var class="Arg">digraph</var> is a digraph without multiple edges, then <code class="code">IsEdgeTransitive</code> returns <code class="keyw">true</code> if <var class="Arg">digraph</var> is edge transitive, and <code class="keyw">false</code> otherwise. A digraph is <em>edge transitive</em> if its automorphism group acts transitively on its edges (via the action <code class="func">OnPairs</code> (<a href="/home/runner/gap/doc/ref/chap41_mj.html#X80DAA1D2855B1456"><span class="RefLink">Reference: OnPairs</span></a>)).</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEdgeTransitive(CompleteDigraph(2));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEdgeTransitive(ChainDigraph(3));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsEdgeTransitive(Digraph([[2], [3, 3, 3], []]));</span>
Error, the argument <D> must be a digraph with no multiple edges,
</pre></div>

<p><a id="X7B26E4447A1611E9" name="X7B26E4447A1611E9"></a></p>

<h5>6.8-3 IsVertexTransitive</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsVertexTransitive</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>If <var class="Arg">digraph</var> is a digraph, then <code class="code">IsVertexTransitive</code> returns <code class="keyw">true</code> if <var class="Arg">digraph</var> is vertex transitive, and <code class="keyw">false</code> otherwise. A digraph is <em>vertex transitive</em> if its automorphism group acts transitively on its vertices.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsVertexTransitive(CompleteDigraph(2));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsVertexTransitive(ChainDigraph(3));</span>
false
</pre></div>

<p><a id="X7FB8789A7BF847E6" name="X7FB8789A7BF847E6"></a></p>

<h5>6.8-4 Is2EdgeTransitive</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Is2EdgeTransitive</code>( <var class="Arg">digraph</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p>If <var class="Arg">digraph</var> is a digraph without multiple edges, then <code class="code">Is2EdgeTransitive</code> returns <code class="keyw">true</code> if <var class="Arg">digraph</var> is 2-edge transitive, and <code class="keyw">false</code> otherwise. If <var class="Arg">digraph</var> has multiple edges, then <code class="code">Is2EdgeTransitive</code> returns an error. A digraph is <em>2-edge transitive</em> if its automorphism group acts transitively on 2-edges via the action <code class="func">OnTuples</code> (<a href="/home/runner/gap/doc/ref/chap41_mj.html#X832CC5F87EEA4A7E"><span class="RefLink">Reference: OnTuples</span></a>). A <em>2-edge</em> in a digraph is a triple (u, v, w) of distinct vertices such that (u, v) and (v, w) are edges.</p>

<p>If the argument <var class="Arg">digraph</var> is mutable, then the return value of this property is recomputed every time it is called.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">Is2EdgeTransitive(CompleteDigraph(4));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">Is2EdgeTransitive(DigraphByEdges([[1, 2], [2, 3], [3, 4]]));</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">Is2EdgeTransitive(CycleDigraph(5));</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">Is2EdgeTransitive(Digraph([[2], [3, 3, 3], []]));</span>
Error, the argument <D> must be a digraph with no multiple edges,
</pre></div>


<div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a>   <a href="chap0_mj.html#contents">[Contents]</a>    <a href="chap5_mj.html">[Previous Chapter]</a>    <a href="chap7_mj.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chap3_mj.html">3</a>  <a href="chap4_mj.html">4</a>  <a href="chap5_mj.html">5</a>  <a href="chap6_mj.html">6</a>  <a href="chap7_mj.html">7</a>  <a href="chap8_mj.html">8</a>  <a href="chap9_mj.html">9</a>  <a href="chapA_mj.html">A</a>  <a href="chapB_mj.html">B</a>  <a href="chapBib_mj.html">Bib</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.268Bemerkung:  (vorverarbeitet am  2026-05-06) ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge