Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/digraphs/tst/standard/   (GAP Algebra Version 4.15.1©)  Datei vom 27.8.2025 mit Größe 10 kB image not shown  

Quelle  planar.tst   Sprache: unbekannt

 
Spracherkennung für: .tst vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

#############################################################################
##
#W  standard/planar.tst
#Y  Copyright (C) 2018                                   James D. Mitchell
##                       
##  Licensing information can be found in the README file of this package.
##
#############################################################################
##

#@local D, dualD
gap> START_TEST("Digraphs package: standard/planar.tst");
gap> LoadPackage("digraphs", false);;

#
gap> DIGRAPHS_StartTest();

# IsPlanarDigraph
gap> D := NullDigraph(0);
<immutable empty digraph with 0 vertices>
gap> IsPlanarDigraph(D);
true
gap> D := DigraphCopy(CompleteDigraph(4));;
gap> IsPlanarDigraph(D);
true
gap> D := DigraphCopy(CompleteDigraph(5));;
gap> IsPlanarDigraph(D);
false
gap> D := Digraph([[247910], [1346910], [610], 
> [2589], [123467910], [3457910], 
> [3456910], [34579], [235678], [35]]);
<immutable digraph with 10 vertices, 50 edges>
gap> ChromaticNumber(D);
5
gap> IsPlanarDigraph(D);
false
gap> D := CompleteBipartiteDigraph(33);
<immutable complete bipartite digraph with bicomponents of size 3>
gap> D := DigraphDisjointUnion(D, D);
<immutable digraph with 12 vertices, 36 edges>
gap> IsPlanarDigraph(D);
false
gap> D := DigraphCopy(CycleDigraph(6));;
gap> IsPlanarDigraph(D);
true
gap> D;
<immutable planar digraph with 6 vertices, 6 edges>
gap> D := DigraphSymmetricClosure(D);;
gap> IsPlanarDigraph(D);
true
gap> D;
<immutable planar symmetric digraph with 6 vertices, 12 edges>

# IsOuterPlanarDigraph
gap> D := Digraph([[247910], [1346910], [610], 
> [2589], [123467910], [3457910], 
> [3456910], [34579], [235678], [35]]);
<immutable digraph with 10 vertices, 50 edges>
gap> ChromaticNumber(D);
5
gap> IsPlanarDigraph(D);
false
gap> IsOuterPlanarDigraph(D);
false
gap> D := NullDigraph(0);
<immutable empty digraph with 0 vertices>
gap> IsOuterPlanarDigraph(D);
true
gap> D := CompleteDigraph(4);
<immutable complete digraph with 4 vertices>
gap> IsOuterPlanarDigraph(D);
false
gap> D := CompleteDigraph(4);
<immutable complete digraph with 4 vertices>
gap> ChromaticNumber(D);
4
gap> IsOuterPlanarDigraph(D);
false
gap> D := Digraph([[3510], [8910], [14], [36], [1711], [47],
> [68], [27], [211], [12], [59]]);
<immutable digraph with 11 vertices, 25 edges>
gap> IsOuterPlanarDigraph(D);
false
gap> IsPlanarDigraph(D);
true

# PlanarEmbedding
gap> D := Digraph([[3510], [8910], [14], [36], [1711], [47],
> [68], [27], [211], [12], [59]]);
<immutable digraph with 11 vertices, 25 edges>
gap> PlanarEmbedding(D);
[ [ 3105 ], [ 1089 ], [ 41 ], [ 63 ], [ 1117 ], [ 74 ], 
  [ 86 ], [ 72 ], [ 211 ], [ 12 ], [ 95 ] ]
gap> D := Digraph([[247910], [1346910], [610], 
> [2589], [123467910], [3457910], 
> [3456910], [34579], [235678], [35]]);
<immutable digraph with 10 vertices, 50 edges>
gap> IsPlanarDigraph(D);
false
gap> PlanarEmbedding(D);
fail
gap> D := NullDigraph(0);
<immutable empty digraph with 0 vertices>
gap> PlanarEmbedding(D);
[  ]
gap> D := List(["D??", "D?_", "D?o", "D?w", "D?{", "DCO", "DCW", "DCc", "DCo",
> "DCs", "DCw", "DC{", "DEk", "DEo", "DEs", "DEw", "DE{", "DFw", "DF{", "DQg",
> "DQo", "DQw", "DQ{", "DTk", "DTw", "DT{", "DUW", "DUw", "DU{", "DV{", "D]w",
> "D]{", "D^{", "D~{"], DigraphFromGraph6String);;
gap> List(D, PlanarEmbedding);
[ [ [  ], [  ], [  ], [  ], [  ] ], [ [ 5 ], [  ], [  ], [  ], [ 1 ] ], 
  [ [ 5 ], [ 5 ], [  ], [  ], [ 12 ] ], 
  [ [ 5 ], [ 5 ], [ 5 ], [  ], [ 123 ] ], 
  [ [ 5 ], [ 5 ], [ 5 ], [ 5 ], [ 1234 ] ], 
  [ [ 4 ], [ 5 ], [  ], [ 1 ], [ 2 ] ], 
  [ [ 4 ], [ 5 ], [ 5 ], [ 1 ], [ 23 ] ], 
  [ [ 45 ], [  ], [  ], [ 51 ], [ 14 ] ], 
  [ [ 45 ], [ 5 ], [  ], [ 1 ], [ 12 ] ], 
  [ [ 45 ], [ 5 ], [  ], [ 51 ], [ 142 ] ], 
  [ [ 45 ], [ 5 ], [ 5 ], [ 1 ], [ 123 ] ], 
  [ [ 45 ], [ 5 ], [ 5 ], [ 51 ], [ 1423 ] ], 
  [ [ 45 ], [ 4 ], [ 5 ], [ 512 ], [ 143 ] ], 
  [ [ 45 ], [ 54 ], [  ], [ 21 ], [ 12 ] ], 
  [ [ 45 ], [ 54 ], [  ], [ 251 ], [ 142 ] ], 
  [ [ 45 ], [ 54 ], [ 5 ], [ 21 ], [ 123 ] ], 
  [ [ 45 ], [ 54 ], [ 5 ], [ 251 ], [ 1423 ] ], 
  [ [ 45 ], [ 54 ], [ 45 ], [ 231 ], [ 132 ] ], 
  [ [ 45 ], [ 54 ], [ 45 ], [ 2531 ], [ 1342 ] ], 
  [ [ 35 ], [ 4 ], [ 51 ], [ 2 ], [ 13 ] ], 
  [ [ 35 ], [ 54 ], [ 1 ], [ 2 ], [ 12 ] ], 
  [ [ 35 ], [ 54 ], [ 51 ], [ 2 ], [ 132 ] ], 
  [ [ 35 ], [ 45 ], [ 51 ], [ 52 ], [ 1324 ] ], 
  [ [ 453 ], [  ], [ 154 ], [ 351 ], [ 143 ] ], 
  [ [ 435 ], [ 5 ], [ 514 ], [ 31 ], [ 132 ] ], 
  [ [ 453 ], [ 5 ], [ 154 ], [ 351 ], [ 1432 ] ], 
  [ [ 43 ], [ 54 ], [ 15 ], [ 21 ], [ 32 ] ], 
  [ [ 453 ], [ 54 ], [ 15 ], [ 21 ], [ 312 ] ], 
  [ [ 453 ], [ 54 ], [ 15 ], [ 251 ], [ 3142 ] ], 
  [ [ 435 ], [ 54 ], [ 145 ], [ 2531 ], [ 1342 ] ], 
  [ [ 453 ], [ 354 ], [ 152 ], [ 21 ], [ 123 ] ], 
  [ [ 453 ], [ 354 ], [ 152 ], [ 251 ], [ 1423 ] ], 
  [ [ 453 ], [ 354 ], [ 1524 ], [ 3251 ], [ 1423 ] ]
    , fail ]

# OuterPlanarEmbedding
gap> D := Digraph([[3510], [8910], [14], [36], [1711], [47],
> [68], [27], [211], [12], [59]]);
<immutable digraph with 11 vertices, 25 edges>
gap> OuterPlanarEmbedding(D);
fail
gap> D := Digraph([[247910], [1346910], [610], 
> [2589], [123467910], [3457910], 
> [3456910], [34579], [235678], [35]]);
<immutable digraph with 10 vertices, 50 edges>
gap> IsOuterPlanarDigraph(D);
false
gap> OuterPlanarEmbedding(D);
fail
gap> D := NullDigraph(0);
<immutable empty digraph with 0 vertices>
gap> OuterPlanarEmbedding(D);
[  ]
gap> D := CompleteDigraph(3);
<immutable complete digraph with 3 vertices>
gap> OuterPlanarEmbedding(D);
[ [ 23 ], [ 31 ], [ 12 ] ]

# SubdigraphHomeomorphicToK23/33/4
gap> D := Digraph([[3510], [8910], [14], [36], [1711], [47],
> [68], [27], [211], [12], [59]]);
<immutable digraph with 11 vertices, 25 edges>
gap> SubdigraphHomeomorphicToK4(D);
[ [ 3510 ], [ 9810 ], [ 41 ], [ 63 ], [ 1711 ], [ 74 ], 
  [ 86 ], [ 27 ], [ 112 ], [ 21 ], [ 59 ] ]
gap> SubdigraphHomeomorphicToK23(D);
[ [ 3510 ], [ 9810 ], [ 41 ], [ 63 ], [ 111 ], [ 74 ], 
  [ 86 ], [ 27 ], [ 112 ], [ 21 ], [ 59 ] ]
gap> D := Digraph([[3510], [8910], [14], [36], [111], [47],
> [68], [27], [211], [12], [59]]);
<immutable digraph with 11 vertices, 24 edges>
gap> SubdigraphHomeomorphicToK4(D);
fail
gap> SubdigraphHomeomorphicToK23(D);
[ [ 3105 ], [ 1089 ], [ 41 ], [ 63 ], [ 111 ], [ 74 ], 
  [ 86 ], [ 27 ], [ 211 ], [ 12 ], [ 95 ] ]
gap> SubdigraphHomeomorphicToK33(D);
fail
gap> SubdigraphHomeomorphicToK23(NullDigraph(0));
fail
gap> SubdigraphHomeomorphicToK33(CompleteDigraph(5));
fail
gap> SubdigraphHomeomorphicToK33(CompleteBipartiteDigraph(33));
[ [ 465 ], [ 456 ], [ 654 ], [ 123 ], [ 321 ], 
  [ 231 ] ]
gap> SubdigraphHomeomorphicToK4(CompleteDigraph(3));
fail

# KuratowskiPlanarSubdigraph
gap> D := Digraph([[3510], [8910], [14], [36], [1711], [47],
> [68], [27], [211], [12], [59]]);
<immutable digraph with 11 vertices, 25 edges>
gap> KuratowskiPlanarSubdigraph(D);
fail
gap> D := Digraph([[247910], [1346910], [610], 
> [2589], [123467910], [3457910], 
> [3456910], [34579], [235678], [35]]);
<immutable digraph with 10 vertices, 50 edges>
gap> IsPlanarDigraph(D);
false
gap> KuratowskiPlanarSubdigraph(D);
[ [ 297 ], [ 13 ], [ 6 ], [ 59 ], [ 64 ], [ 35 ], [ 4 ], 
  [ 793 ], [ 8 ], [  ] ]
gap> D := NullDigraph(0);
<immutable empty digraph with 0 vertices>
gap> KuratowskiPlanarSubdigraph(D);
fail

# KuratowskiOuterPlanarSubdigraph
gap> D := Digraph([[3510], [8910], [14], [36], [1711], [47],
> [68], [27], [211], [12], [59]]);
<immutable digraph with 11 vertices, 25 edges>
gap> KuratowskiOuterPlanarSubdigraph(D);
[ [ 3510 ], [ 9810 ], [ 41 ], [ 63 ], [ 111 ], [ 74 ], 
  [ 86 ], [ 27 ], [ 112 ], [ 21 ], [ 59 ] ]
gap> D := Digraph([[247910], [1346910], [610], 
> [2589], [123467910], [3457910], 
> [3456910], [34579], [235678], [35]]);
<immutable digraph with 10 vertices, 50 edges>
gap> IsOuterPlanarDigraph(D);
false
gap> KuratowskiOuterPlanarSubdigraph(D);
[ [  ], [  ], [  ], [ 89 ], [  ], [  ], [ 94 ], [ 794 ], [ 87 ], 
  [  ] ]
gap> D := NullDigraph(0);
<immutable empty digraph with 0 vertices>
gap> KuratowskiOuterPlanarSubdigraph(D);
fail
gap> D := CompleteDigraph(3);
<immutable complete digraph with 3 vertices>
gap> KuratowskiOuterPlanarSubdigraph(D);
fail

# DualPlanarGraph
gap> DualPlanarGraph(CompleteDigraph(5));
fail
gap> D := CycleDigraph(4);
<immutable cycle digraph with 4 vertices>
gap> DualPlanarGraph(D);
<immutable multidigraph with 2 vertices, 8 edges>
gap> D := ChainDigraph(4);
<immutable chain digraph with 4 vertices>
gap> DualPlanarGraph(D);
<immutable empty digraph with 0 vertices>
gap> D := Digraph([[234], [135], [124], [135], [246], [579], [6810], [7910], [6810], [789]]);;
gap> dualD := DualPlanarGraph(D);
<immutable multidigraph with 7 vertices, 29 edges>
gap> DigraphHasLoops(dualD);
true
gap> D := CompleteDigraph(3);;
gap> DualPlanarGraph(D);
<immutable multidigraph with 2 vertices, 6 edges>

# Kernel function boyers_planarity_check, errors
gap> IS_PLANAR(2);
Error, Digraphs: boyers_planarity_check (C): the 1st argument must be a digrap\
h, not integer
gap> IS_PLANAR(NullDigraph(0));
true
gap> IS_PLANAR(NullDigraph(70000));
true
gap> IsPlanarDigraph(NullDigraph(70000));
true
gap> IS_PLANAR(CompleteDigraph(2));
true

#
gap> DIGRAPHS_StopTest();
gap> STOP_TEST("Digraphs package: standard/planar.tst", 0);

# DigraphSource and DigraphRange

[Dauer der Verarbeitung: 0.13 Sekunden, vorverarbeitet 2026-06-16]