diff --git a/.codecov.yml b/.codecov.yml index 50934c736..5413b763e 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -12,4 +12,10 @@ comment: behavior: default ignore: - - "extern" # Do not check coverage on the extern directory + - "extern/" + - "gap/utils.gi" + - "PackageInfo.g" + - "init.g" + - "makedoc.g" + - "read.g" + - "tst/testall.g" diff --git a/.gitignore b/.gitignore index e3efea524..2cbdd5998 100644 --- a/.gitignore +++ b/.gitignore @@ -53,9 +53,9 @@ planarity src/.deps/* src/.libs/* src/_pkgconfig.h -extern/edge-addition-planarity-suite-Version_3.0.0.5/.libs -extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.deps -extern/edge-addition-planarity-suite-Version_3.0.0.5/m4 +extern/edge-addition-planarity-suite-Version_*/.libs +extern/edge-addition-planarity-suite-Version_*/c/.deps +extern/edge-addition-planarity-suite-Version_*/m4 src/stamp-h1 tags tst/out/* @@ -74,3 +74,4 @@ coverage .ipynb_checkpoints bliss *.a +*.dylib diff --git a/configure.ac b/configure.ac index a75682363..7a2253978 100644 --- a/configure.ac +++ b/configure.ac @@ -114,8 +114,8 @@ AS_IF([test "x$enable_compile_warnings" != "xno"], AX_CHECK_PLANARITY() if test "x$with_external_planarity" = xno ; then - AC_CONFIG_SUBDIRS([extern/edge-addition-planarity-suite-Version_3.0.0.5]) - PLANARITY_SUITE_DIR=extern/edge-addition-planarity-suite-Version_3.0.0.5 + AC_CONFIG_SUBDIRS([extern/edge-addition-planarity-suite-Version_3.0.1.0]) + PLANARITY_SUITE_DIR=extern/edge-addition-planarity-suite-Version_3.0.1.0 AC_SUBST(PLANARITY_SUITE_DIR) fi diff --git a/doc/digraphs.bib b/doc/digraphs.bib index 54ba84476..e7b8bc7d5 100644 --- a/doc/digraphs.bib +++ b/doc/digraphs.bib @@ -1,7 +1,40 @@ % Cite keys match the cite keys that are used in the compiled GAPDoc manual +@article{B12, + author = {John M. Boyer}, + title = {Subgraph Homeomorphism via the Edge Addition Planarity Algorithm}, + journal = {Journal of Graph Algorithms and Applications}, + year = {2012}, + volume = {16}, + number = {2}, + pages = {381--410}, + doi = {10.7155/jgaa.00268} +} + +@article{BM04, + author = {John M. Boyer and Wendy J. Myrvold}, + title = {On the Cutting Edge: Simplified O(n) Planarity by Edge Addition}, + journal = {Journal of Graph Algorithms and Applications}, + year = {2004}, + volume = {8}, + number = {3}, + pages = {241--273}, + doi = {10.7155/jgaa.00091} +} + +@inproceedings{B06, + address = {Berlin, Heidelberg}, + author = {John M. Boyer}, + booktitle = {Graph Drawing}, + editor = {Healy, Patrick and Nikolov, Nikola S.}, + isbn = {978-3-540-31667-1}, + pages = {508--511}, + publisher = {Springer Berlin Heidelberg}, + title = {A New Method for Efficiently Generating Planar Graph Visibility Representations}, + year = {2006}} + @incollection{BM06, - Author = {John M. Boyer and Wendy J. Myrvold}, + author = {John M. Boyer and Wendy J. Myrvold}, Booktitle = {Graph Algorithms and Applications 5}, Doi = {10.1142/9789812773289_0014}, Month = {Jun}, diff --git a/doc/z-chap0.xml b/doc/z-chap0.xml index 15811819b..ac8e3ea2d 100644 --- a/doc/z-chap0.xml +++ b/doc/z-chap0.xml @@ -50,6 +50,14 @@ for more details.

+ The &edge-addition-planarity-suite; is also included in &Digraphs;; see + , , , and . The &edge-addition-planarity-suite; is an open-source + implementation of the edge addition planar graph embedding algorithm and + related algorithms by John M. Boyer. See Section for + more details. +

+ From version 1.0.0 of this package, digraphs can be either mutable or immutable. Mutable digraphs can be changed in-place by many of the methods in the package, which avoids unnecessary copying. Immutable digraphs cannot be diff --git a/doc/z-chap5.xml b/doc/z-chap5.xml index 3db928f5a..5c93a9911 100644 --- a/doc/z-chap5.xml +++ b/doc/z-chap5.xml @@ -42,7 +42,7 @@ <#Include Label="IsCycleDigraph"> -

Planarity +
Planarity <#Include Label="IsPlanarDigraph"> <#Include Label="IsOuterPlanarDigraph">
diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/.gitignore b/extern/edge-addition-planarity-suite-Version_3.0.0.5/.gitignore deleted file mode 100644 index cd5c1db01..000000000 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# Object files -*.o -*.ko -*.obj -*.elf - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/LICENSE.TXT b/extern/edge-addition-planarity-suite-Version_3.0.0.5/LICENSE.TXT deleted file mode 100644 index 63caf56d3..000000000 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/LICENSE.TXT +++ /dev/null @@ -1,46 +0,0 @@ -The Edge Addition Planarity Suite -Copyright (c) 1997-2015, John M. Boyer -All rights reserved. Includes a reference implementation of the following: - -* John M. Boyer. "Subgraph Homeomorphism via the Edge Addition Planarity Algorithm". - Journal of Graph Algorithms and Applications, Vol. 16, no. 2, pp. 381-410, 2012. - http://www.jgaa.info/16/268.html - -* John M. Boyer. "A New Method for Efficiently Generating Planar Graph - Visibility Representations". In P. Eades and P. Healy, editors, - Proceedings of the 13th International Conference on Graph Drawing 2005, - Lecture Notes Comput. Sci., Volume 3843, pp. 508-511, Springer-Verlag, 2006. - -* John M. Boyer and Wendy J. Myrvold. "On the Cutting Edge: Simplified O(n) - Planarity by Edge Addition". Journal of Graph Algorithms and Applications, - Vol. 8, No. 3, pp. 241-273, 2004. - http://www.jgaa.info/08/91.html - -* John M. Boyer. "Simplified O(n) Algorithms for Planar Graph Embedding, - Kuratowski Subgraph Isolation, and Related Problems". Ph.D. Dissertation, - University of Victoria, 2001. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of The Edge Addition Planarity Suite nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.cproject b/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.cproject deleted file mode 100644 index f3e4a15c1..000000000 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.cproject +++ /dev/null @@ -1,358 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.settings/org.eclipse.cdt.managedbuilder.core.prefs deleted file mode 100644 index 8c1145fdb..000000000 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ /dev/null @@ -1,22 +0,0 @@ -#Sat Sep 25 07:24:51 PDT 2010 -eclipse.preferences.version=1 -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/CPATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/CPATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/C_INCLUDE_PATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/C_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/append=true -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/appendContributed=true -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/CPATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/CPATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/C_INCLUDE_PATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/C_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/append=true -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/appendContributed=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/LIBRARY_PATH/delimiter=; -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/LIBRARY_PATH/operation=remove -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/append=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.44566100/appendContributed=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/LIBRARY_PATH/delimiter=; -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/LIBRARY_PATH/operation=remove -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/append=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.1847537064/appendContributed=true diff --git a/extern/edge-addition-planarity-suite-Version_3.0.1.0/.gitignore b/extern/edge-addition-planarity-suite-Version_3.0.1.0/.gitignore new file mode 100644 index 000000000..47a190c69 --- /dev/null +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/.gitignore @@ -0,0 +1,65 @@ +# Directories +/c/Release/ +/c/Debug/ +/c/.settings/ +/c/error/ + +/c/random/ +/c/embedded/ +/c/adjlist/ +/c/obstructed/ + +/c/Release/random/ +/c/Release/embedded/ +/c/Release/adjlist/ +/c/Release/obstructed/ +/c/Release/error/ + +/c/Debug/random/ +/c/Debug/embedded/ +/c/Debug/adjlist/ +/c/Debug/obstructed/ +/c/Debug/error/ + +# Object files +*.o +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ + +# Java +*.class +*.log +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/.project b/extern/edge-addition-planarity-suite-Version_3.0.1.0/.project similarity index 100% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/.project rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/.project diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/Makefile.am b/extern/edge-addition-planarity-suite-Version_3.0.1.0/Makefile.am similarity index 98% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/Makefile.am rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/Makefile.am index 738b4dc7e..51093cfa6 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/Makefile.am +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/Makefile.am @@ -1,4 +1,3 @@ -ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libplanarity.la libplanarity_la_SOURCES = \ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.1.0/README.md b/extern/edge-addition-planarity-suite-Version_3.0.1.0/README.md new file mode 100644 index 000000000..f31760bf4 --- /dev/null +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/README.md @@ -0,0 +1,89 @@ +# Edge Addition Planarity Suite + +The primary purpose of this repository is to provide implementations of the edge addition planar graph embedding algorithm and related algorithms, including a planar graph drawing method, an isolator for a minimal subgraph obstructing planarity in non-planar graphs, outerplanar graph embedder and obstruction isolator algorithms, and tester/isolator algorithms for subgraphs homeomorphic to _K2,3_, _K4_, and _K3,3_. The C implementations in this repository are the reference implementations of algorithms appearing in the following papers: + +* [Subgraph Homeomorphism via the Edge Addition Planarity Algorithm](http://dx.doi.org/10.7155/jgaa.00268) + +* [A New Method for Efficiently Generating Planar Graph Visibility Representations](http://dx.doi.org/10.1007/11618058_47) + +* [On the Cutting Edge: Simplified O(n) Planarity by Edge Addition](http://dx.doi.org/10.7155/jgaa.00091) + +* [Simplified O(n) Algorithms for Planar Graph Embedding, Kuratowski Subgraph Isolation, and Related Problems](https://dspace.library.uvic.ca/handle/1828/9918) + +As secondary purpose of this repository is to provide a generalized graph API that enables implementation of a very wide range of in-memory graph algorithms including basic methods for reading, writing, depth first search, and lowpoint as well as advanced methods for solving planarity, outerplanarity, drawing, and selected subgraph homeomorphism problems. An extension mechanism is also provided to enable implementation of planarity-related algorithms by overriding and augmenting data structures and methods of the core planarity algorithm. + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. + +### Pre-compiled Executable Releases for Non-Developers + +This repository includes releases of already compiled versions of an application for non-developers to use the algorithm implementations. Download and decompress planarity._Platform_.zip. If you execute the _planarity.exe_ program with a "-test" parameter, the algorithms will be performed on the graphs in the files in the _samples_ directory, and a success result will be reported. + +The application includes a menu driven mode that lets a user manually select algorithms to run and, where appropriate, files containing graphs on which to run the algorithms. To access the menu mode, execute _planarity.exe_ without any command line parameters. + +The application also supports an extensive list of command-line parameters that make it possible to automate the execution of any of the algorithms included in the application. Execute _planarity.exe_ with the "-h" command-line parameter to get more information about the command line options, and use "-h -menu" for more extensive information about command-line mode. + +### Setting up a Development Environment + +A development environment for the C reference implementations can be set up based on Eclipse. + +1. Install a recent version of the Java JDK (such as Java version 14 or higher) +2. Ensure that you set the JAVA_HOME system environment variable (e.g. to c:\Program Files\Java\jdk-14.0.1) +3. Ensure that you add %JAVA_HOME%\bin to your system PATH +4. Install Eclipse, such as the "Eclipse IDE for Enterprise Java Developers" +5. Install gcc, gdb, and msys (e.g. download and run mingw-get-setup.exe from [here](https://osdn.net/projects/mingw/releases/) and then use the package installer to install C and C++, GDB, MSYS, and any other packages you may want.) +6. Ensure your gcc is accessible from the command line (e.g. add C:\MinGW\bin to the system PATH) +7. In Eclipse, and install the C Development Tools (CDT) + 1. In Eclipse, choose the menu option Help > Install New Software + 2. Choose to work with the main repository (e.g. 2020 - 06 - http://download.eclipse.org/releases) + 3. Under Programming Languages, choose C/C++ Autotools, C/C++ Development Tools, C/C++ Development Tools SDK, C/C++ Library API Documentation Hover Help, and C/C++ Unit Testing Support + +### Working with the Code in the Development Environment + +In this repository, the "Code" button provides the [HTTPS clone](https://github.com/graph-algorithms/edge-addition-planarity-suite.git) link to use to get the code. + +1. In Eclipse, use the Open Perspectives button (or Window | Perspective | Open Perspective | Git) +2. In the web browser, go to the "Code" button, HTTPS clone, and get the URL into the copy/paste clipboard. +3. Go to the Eclipse Git Repositories panel, and clic "Clone a Git repository" +4. The URI, Host, and Repository are pre-filled correctly from the copy/paste clipboard. +5. Leave the User/Password blank, and hit Next +6. The master branch is selected by default, so just hit Next again +7. Change the destination directory to a subdirectory where you want to store the project code (e.g. c:\Users\_you_\Documents\eclipse\workspaces-cpp\graph-algorithms\edge-addition-planarity-suite) +8. Hit Finish + +Once you have the code, you will be able to import the project, build the _planarity.exe_ application and use the run and debug features of Eclipse. + +1. Use the Open Perspectives button (or Windows | Perspective | Open Perspective | Other…) +2. Select C/C++ +3. In the Project Explorer window, click Import projects... +4. Choose General | Existing Projects into Workspace and hit Next > +5. For "Select root directory:" choose "Browse..." +6. Navigate to .../edge-addition-planarity-suite/c (This autofills and selects Planarity-C in Projects list) +7. Hit Finish (do not select "Copy projects into workspace") +8. Right-click Planarity-C project, Build Configurations, Build All +9. Right-click Planarity-C project, Build Configurations, Set Active, Release +10. Right-click Planarity-C project, Run As, Local Application, planarity.exe (release) + +## Contributing + +Subject to your acceptance of the license agreement, contributions can be made via a pull request. Before submitting a pull request, please ensure that you have set your github user name and email within your development environment. For Eclipse, you can use the following steps: + +1. Window > Preferences > Team > Git > Configuration +2. Add Entry... user.name (set the value to your github identity) +3. Add Entry... user.email (set the value to the primary email of your github identity) +4. Hit Apply and Close + +## Versioning + +The APIs for the graph library and the planarity algorithm implementations are versioned using the method documented in [configure.ac](configure.ac). + +The _planarity.exe_ application, which provides command-line and menu-driven interfaces for the graph library and planarity algorithms, is versioned according to the _Major.Minor.Maintenance.Tweak_ numbering system documented in the comments in [planarity.c](c/planarity.c). + +## License + +This project is licensed under a 3-clause BSD License appearing in [LICENSE.TXT](LICENSE.TXT). + +## Related Works and Further Documentation + +There have been successful technology transfers of the implementation code and/or algorithms of this project into other projects. To see a list of the related projects and for further documentation about this project, please see the [project wiki](https://github.com/graph-algorithms/edge-addition-planarity-suite/wiki). diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/autogen.sh b/extern/edge-addition-planarity-suite-Version_3.0.1.0/autogen.sh similarity index 100% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/autogen.sh rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/autogen.sh diff --git a/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.cproject b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.cproject new file mode 100644 index 000000000..4007aa3a2 --- /dev/null +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.cproject @@ -0,0 +1,716 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.gdbinit b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.gdbinit new file mode 100644 index 000000000..f84981e19 --- /dev/null +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.gdbinit @@ -0,0 +1 @@ +set new-console on diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.project b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.project similarity index 100% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/.project rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/.project diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/appconst.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/appconst.h similarity index 89% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/appconst.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/appconst.h index 3c4292ddf..4e44ee9b7 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/appconst.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/appconst.h @@ -2,11 +2,27 @@ #define APPCONST_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ +#ifdef WIN32 +#define WINDOWS +#endif + +/* Defines fopen strings for reading and writing text files on PC and UNIX */ + +#ifdef WINDOWS +#define READTEXT "rt" +#define WRITETEXT "wt" +#define FILE_DELIMITER '\\' +#else +#define READTEXT "r" +#define WRITETEXT "w" +#define FILE_DELIMITER '/' +#endif + // When PROFILE is defined, prints out run-time stats on a number of subordinate // routines in the embedder @@ -63,16 +79,6 @@ extern int debugNOTOK(); //#define NIL -1 //#define NIL_CHAR 0xFF -/* Defines fopen strings for reading and writing text files on PC and UNIX */ - -#ifdef WINDOWS -#define READTEXT "rt" -#define WRITETEXT "wt" -#else -#define READTEXT "r" -#define WRITETEXT "w" -#endif - /******************************************************************** A few simple integer selection macros ********************************************************************/ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graph.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graph.h similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graph.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graph.h index e80ea4e0b..d765c6874 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graph.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graph.h @@ -2,7 +2,7 @@ #define GRAPH_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDFSUtils.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDFSUtils.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDFSUtils.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDFSUtils.c index 3273e299e..9a8741db8 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDFSUtils.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDFSUtils.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -29,7 +29,7 @@ extern void _ClearVertexVisitedFlags(graphP theGraph, int); int gp_CreateDFSTree(graphP theGraph) { stackP theStack; -int N, DFI, v, uparent, u, e; +int DFI, v, uparent, u, e; #ifdef PROFILE platform_time start, end; @@ -41,7 +41,6 @@ platform_GetTime(start); gp_LogLine("\ngraphDFSUtils.c/gp_CreateDFSTree() start"); - N = theGraph->N; theStack = theGraph->theStack; /* There are 2M edge records (arcs) and for each we can push 2 integers, diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.c similarity index 97% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.c index 89215ed3a..0625b039b 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -344,8 +344,9 @@ int e, eTwin, eCur, v, vpos, epos, eIndex; // Sort the vertices by vertical position (in linear time) - if ((vertexOrder = (int *) malloc(theEmbedding->N * sizeof(int))) == NULL) - return NOTOK; + if ((vertexOrder = (int *) malloc(theEmbedding->N * sizeof(int))) == NULL) { + return NOTOK; + } for (v = gp_GetFirstVertex(theEmbedding); gp_VertexInRange(theEmbedding, v); v++) vertexOrder[context->VI[v].pos] = v; @@ -832,7 +833,7 @@ char *_RenderToString(graphP theEmbedding) sprintf(numBuffer, "%d", v - zeroBasedVertexOffset); if ((unsigned)(context->VI[v].end - context->VI[v].start + 1) >= strlen(numBuffer)) { - strncpy(visRep + (2*Pos) * (M+1) + Mid, numBuffer, strlen(numBuffer)); + memcpy((char *) visRep + (2*Pos) * (M+1) + Mid, (char *) numBuffer, strlen(numBuffer)); } // If the vertex width is less than the label width, then fail gracefully else diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.h similarity index 86% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.h index 9d578707b..23f6d914a 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.h @@ -2,7 +2,7 @@ #define GRAPH_DRAWPLANAR_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.private.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.private.h similarity index 95% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.private.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.private.h index bc1b554fa..2034c6782 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar.private.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar.private.h @@ -2,7 +2,7 @@ #define GRAPH_DRAWPLANAR_PRIVATE_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar_Extensions.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar_Extensions.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar_Extensions.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar_Extensions.c index 14ebbb0c2..aba5fecfe 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphDrawPlanar_Extensions.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphDrawPlanar_Extensions.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -300,8 +300,9 @@ int _DrawPlanar_InitGraph(graphP theGraph, int N) DrawPlanarContext *context = NULL; gp_FindExtension(theGraph, DRAWPLANAR_ID, (void *)&context); - if (context == NULL) - return NOTOK; + if (context == NULL) { + return NOTOK; + } theGraph->N = N; theGraph->NV = N; diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphEmbed.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphEmbed.c similarity index 97% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphEmbed.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphEmbed.c index dbb75574d..35404328b 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphEmbed.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphEmbed.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.c similarity index 97% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.c index 79363fa47..1d46eba11 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.h similarity index 91% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.h index 15f65a852..7eb5be533 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.h @@ -2,7 +2,7 @@ #define GRAPH_EXTENSIONS_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.private.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.private.h similarity index 87% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.private.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.private.h index c51a5f1ae..03d708d93 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphExtensions.private.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphExtensions.private.h @@ -2,7 +2,7 @@ #define GRAPH_EXTENSIONS_PRIVATE_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphFunctionTable.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphFunctionTable.h similarity index 94% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphFunctionTable.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphFunctionTable.h index 7f6862108..ea7019870 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphFunctionTable.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphFunctionTable.h @@ -2,7 +2,7 @@ #define GRAPHFUNCTIONTABLE_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphIO.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphIO.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphIO.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphIO.c index 48b37b7ae..6241bd0a6 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphIO.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphIO.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -445,7 +445,7 @@ char *Row = NULL; { for (K = gp_GetFirstVertex(theGraph); K <= v; K++) Row[K - gp_GetFirstVertex(theGraph)] = ' '; - for (K = v+1; gp_VertexInRange(theGraph, v); K++) + for (K = v+1; gp_VertexInRange(theGraph, K); K++) Row[K - gp_GetFirstVertex(theGraph)] = '0'; e = gp_GetFirstArc(theGraph, v); diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphIsolator.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphIsolator.c similarity index 97% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphIsolator.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphIsolator.c index f59f3cb08..b807c6bb3 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphIsolator.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphIsolator.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.c index 431246fc7..96e80cfc9 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.h similarity index 84% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.h index e7f368f21..d742299b9 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.h @@ -2,7 +2,7 @@ #define GRAPH_K23SEARCH_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.private.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.private.h similarity index 84% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.private.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.private.h index 8141e749c..695997827 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search.private.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search.private.h @@ -2,7 +2,7 @@ #define GRAPH_K23SEARCH_PRIVATE_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search_Extensions.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search_Extensions.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search_Extensions.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search_Extensions.c index 24b8a9f11..ee254ab9a 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK23Search_Extensions.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK23Search_Extensions.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.c similarity index 97% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.c index 8c657ba14..5693de35f 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -730,7 +730,7 @@ int child, e; int _SearchForMergeBlocker(graphP theGraph, K33SearchContext *context, int v, int *pMergeBlocker) { stackP tempStack; -int R, Rout, Z, ZPrevLink; +int Z; /* Set return result to 'not found' then return if there is no stack to inspect */ @@ -749,8 +749,8 @@ int R, Rout, Z, ZPrevLink; while (!sp_IsEmpty(tempStack)) { - sp_Pop2(tempStack, R, Rout); - sp_Pop2(tempStack, Z, ZPrevLink); + sp_Pop2_Discard(tempStack); /* Move (R, Rout) out of the way */ + sp_Pop2_Discard1(tempStack, Z); /* Get Z, discard ZPrevLink */ if (gp_IsVertex(context->VI[Z].mergeBlocker) && context->VI[Z].mergeBlocker < v) @@ -775,7 +775,7 @@ int R, Rout, Z, ZPrevLink; int _FindK33WithMergeBlocker(graphP theGraph, K33SearchContext *context, int v, int mergeBlocker) { -int R, RPrevLink, u_max, u, e, W; +int R, RPrevLink, u_max, u, e; isolatorContextP IC = &theGraph->IC; /* First, we orient the vertices so we can successfully restore all of the @@ -823,7 +823,6 @@ isolatorContextP IC = &theGraph->IC; e = gp_GetVertexFwdArcList(theGraph, IC->v); while (gp_IsArc(e)) { - W = gp_GetNeighbor(theGraph, e); theGraph->functions.fpWalkUp(theGraph, IC->v, e); e = gp_GetNextArc(theGraph, e); @@ -1257,7 +1256,7 @@ int p, c, d, excludedChild, e; int _ReduceBicomp(graphP theGraph, K33SearchContext *context, int R) { isolatorContextP IC = &theGraph->IC; -int min, mid, max, A, A_edge, B, B_edge; +int min, max, A, A_edge, B, B_edge; int rxType, xwType, wyType, yrType, xyType; /* The vertices in the bicomp need to be oriented so that functions @@ -1278,7 +1277,7 @@ int rxType, xwType, wyType, yrType, xyType; min = MIN3(IC->x, IC->y, IC->w); max = MAX3(IC->x, IC->y, IC->w); - mid = MAX3(MIN(IC->x, IC->y), MIN(IC->x, IC->w), MIN(IC->y, IC->w)); + // int mid = MAX3(MIN(IC->x, IC->y), MIN(IC->x, IC->w), MIN(IC->y, IC->w)); /* If the order of descendendancy from V goes first to X, then it can proceed either to W then Y or to Y then W */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.h similarity index 84% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.h index c3e6fdb76..3aa54c82f 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.h @@ -2,7 +2,7 @@ #define GRAPH_K33SEARCH_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.private.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.private.h similarity index 92% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.private.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.private.h index 547669dd1..ad9769478 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search.private.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search.private.h @@ -2,7 +2,7 @@ #define GRAPH_K33SEARCH_PRIVATE_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search_Extensions.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search_Extensions.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search_Extensions.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search_Extensions.c index cf7e0a7d5..e565f4de4 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK33Search_Extensions.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK33Search_Extensions.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -249,8 +249,9 @@ int _K33Search_InitGraph(graphP theGraph, int N) K33SearchContext *context = NULL; gp_FindExtension(theGraph, K33SEARCH_ID, (void *)&context); - if (context == NULL) - return NOTOK; + if (context == NULL) { + return NOTOK; + } theGraph->N = N; theGraph->NV = N; diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.c index b2f44f21e..72ca0d80c 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -198,8 +198,9 @@ isolatorContextP IC = &theGraph->IC; // Set up to isolate K4 homeomorph _ClearVisitedFlags(theGraph); - if (_FindUnembeddedEdgeToCurVertex(theGraph, IC->w, &IC->dw) != TRUE) - return NOTOK; + if (_FindUnembeddedEdgeToCurVertex(theGraph, IC->w, &IC->dw) != TRUE) { + return NOTOK; + } // Isolate the K4 homeomorph if (_MarkHighestXYPath(theGraph) != TRUE || @@ -638,8 +639,9 @@ int _K4_FindSeparatingInternalEdge(graphP theGraph, int R, int prevLink, int A, } // If we found the separator edge, then we don't need to go on - if (gp_IsVertex(*pX)) + if (gp_IsVertex(*pX)) { break; + } // Go to the next vertex Z = _GetNeighborOnExtFace(theGraph, Z, &ZPrevLink); @@ -720,8 +722,9 @@ int _K4_IsolateMinorA1(graphP theGraph) if (_IsolateOuterplanarityObstructionA(theGraph) != OK) return NOTOK; - if (_AddAndMarkEdge(theGraph, IC->uz, IC->dz) != OK) - return NOTOK; + if (_AddAndMarkEdge(theGraph, IC->uz, IC->dz) != OK) { + return NOTOK; + } return OK; } @@ -793,8 +796,9 @@ int _K4_IsolateMinorB1(graphP theGraph) if (_AddAndMarkEdge(theGraph, IC->ux, IC->dx) != OK) return NOTOK; - if (_AddAndMarkEdge(theGraph, IC->uy, IC->dy) != OK) - return NOTOK; + if (_AddAndMarkEdge(theGraph, IC->uy, IC->dy) != OK) { + return NOTOK; + } return OK; } @@ -952,8 +956,9 @@ int _K4_ReducePathComponent(graphP theGraph, K4SearchContext *context, int R, i Z = gp_GetNeighbor(theGraph, e_R); gp_SetEdgeVisited(theGraph, e_R); gp_SetEdgeVisited(theGraph, gp_GetTwinArc(theGraph, e_R)); - if (theGraph->functions.fpMarkDFSPath(theGraph, A, Z) != OK) - return NOTOK; + if (theGraph->functions.fpMarkDFSPath(theGraph, A, Z) != OK) { + return NOTOK; + } edgeType = EDGE_TYPE_BACK; } @@ -1194,8 +1199,9 @@ int _K4_DeleteUnmarkedEdgesInPathComponent(graphP theGraph, int R, int prevLink K4SearchContext *context = NULL; gp_FindExtension(theGraph, K4SEARCH_ID, (void *)&context); - if (context == NULL) + if (context == NULL) { return NOTOK; + } // We need to use the stack to store up the edges we're going to delete. // We want to make sure there is enough stack capacity to handle it, diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.h similarity index 84% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.h index 99382f00b..d9af8c6c5 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.h @@ -2,7 +2,7 @@ #define GRAPH_K4SEARCH_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.private.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.private.h similarity index 93% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.private.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.private.h index 84a750e22..66240820a 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search.private.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search.private.h @@ -2,7 +2,7 @@ #define GRAPH_K4SEARCH_PRIVATE_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search_Extensions.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search_Extensions.c similarity index 95% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search_Extensions.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search_Extensions.c index f4482eba8..a9241ef01 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphK4Search_Extensions.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphK4Search_Extensions.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -343,8 +343,9 @@ int _K4Search_HandleBlockedBicomp(graphP theGraph, int v, int RootVertex, int R { // If the Walkdown will be told it is OK to continue, then we have to take the descendant // bicomp root back off the stack so the Walkdown can try to descend to it again. - int dummy; - sp_Pop2(theGraph->theStack, R, dummy); + // The top of stack has the pair R and 0/1 direction Walkdown traversal proceeds from R + // Need only R, so pop and discard the direction, then pop R + sp_Pop2_Discard1(theGraph->theStack, R); // And we have to clear the indicator of the minor A that was reduced, since it was eliminated. theGraph->IC.minorType = 0; diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphNonplanar.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphNonplanar.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphNonplanar.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphNonplanar.c index b15c17b94..ca8b659cb 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphNonplanar.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphNonplanar.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -41,7 +41,7 @@ int _FindFuturePertinenceBelowXYPath(graphP theGraph); int _ChooseTypeOfNonplanarityMinor(graphP theGraph, int v, int R) { -int X, Y, W, Px, Py, Z; +int W, Px, Py, Z; /* Create the initial non-planarity minor state in the isolator context */ @@ -49,8 +49,6 @@ int X, Y, W, Px, Py, Z; return NOTOK; R = theGraph->IC.r; - X = theGraph->IC.x; - Y = theGraph->IC.y; W = theGraph->IC.w; /* If the root copy is not a root copy of the current vertex v, @@ -157,16 +155,18 @@ int _InitializeNonplanarityContext(graphP theGraph, int v, int R) // of the stack, so R must be changed to that value. if (sp_NonEmpty(theGraph->theStack)) { - int dummy; - sp_Pop2(theGraph->theStack, R, dummy); + // The top of stack has the pair R and 0/1 direction Walkdown traversal proceeds from R + // Need only R, so pop and discard the direction, then pop R + sp_Pop2_Discard1(theGraph->theStack, R); } theGraph->IC.r = R; // A number of subroutines require the main bicomp of the minor to be // consistently oriented and its visited flags clear. - if (_OrientVerticesInBicomp(theGraph, R, 1) != OK) + if (_OrientVerticesInBicomp(theGraph, R, 1) != OK) { return NOTOK; + } if (_ClearVisitedFlagsInBicomp(theGraph, R) != OK) return NOTOK; @@ -311,10 +311,9 @@ int W=theGraph->IC.x, WPrevLink=1; int _SetVertexTypesForMarkingXYPath(graphP theGraph) { - int v, R, X, Y, W, Z, ZPrevLink, ZType; + int R, X, Y, W, Z, ZPrevLink, ZType; // Unpack the context for efficiency of loops - v = theGraph->IC.v; R = theGraph->IC.r; X = theGraph->IC.x; Y = theGraph->IC.y; @@ -466,14 +465,12 @@ int V, e; int _MarkHighestXYPath(graphP theGraph) { int e, Z; -int R, X, Y, W; +int R, W; int stackBottom1, stackBottom2; /* Initialization */ R = theGraph->IC.r; - X = theGraph->IC.x; - Y = theGraph->IC.y; W = theGraph->IC.w; theGraph->IC.px = theGraph->IC.py = NIL; diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphOuterplanarObstruction.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphOuterplanarObstruction.c similarity index 95% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphOuterplanarObstruction.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphOuterplanarObstruction.c index c5ab5d436..43025c310 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphOuterplanarObstruction.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphOuterplanarObstruction.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -47,15 +47,13 @@ int _IsolateOuterplanarityObstructionE(graphP theGraph); int _ChooseTypeOfNonOuterplanarityMinor(graphP theGraph, int v, int R) { -int X, Y, W; +int W; // Create the initial non-outerplanarity obstruction isolator state. if (_InitializeNonplanarityContext(theGraph, v, R) != OK) return NOTOK; R = theGraph->IC.r; - X = theGraph->IC.x; - Y = theGraph->IC.y; W = theGraph->IC.w; // If the root copy is not a root copy of the current vertex v, diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphStructures.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphStructures.h similarity index 97% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphStructures.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphStructures.h index c08ee1664..9b1b51536 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphStructures.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphStructures.h @@ -2,7 +2,7 @@ #define GRAPHSTRUCTURE_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphTests.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphTests.c similarity index 97% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphTests.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphTests.c index 5988c0c34..6ff56f398 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphTests.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphTests.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphUtils.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphUtils.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphUtils.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphUtils.c index babb654fe..0d02e91d3 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/graphUtils.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/graphUtils.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -457,8 +457,9 @@ int e, Esize = gp_EdgeIndexBound(theGraph), } // Expand edgeHoles - if ((newStack = sp_New(requiredArcCapacity / 2)) == NULL) + if ((newStack = sp_New(requiredArcCapacity / 2)) == NULL) { return NOTOK; + } sp_CopyContent(newStack, theGraph->edgeHoles); sp_Free(&theGraph->edgeHoles); @@ -1235,7 +1236,7 @@ int N, arc, M, root, v, c, p, last, u, e, EsizeOccupied; else { - arc = 2*theGraph->M - 2; + arc = gp_GetNeighborEdgeRecord(theGraph, u, v); gp_SetEdgeType(theGraph, arc, EDGE_TYPE_RANDOMTREE); gp_SetEdgeType(theGraph, gp_GetTwinArc(theGraph, arc), EDGE_TYPE_RANDOMTREE); gp_ClearEdgeVisited(theGraph, arc); @@ -1247,7 +1248,7 @@ int N, arc, M, root, v, c, p, last, u, e, EsizeOccupied; M = numEdges <= 3*N - 6 ? numEdges : 3*N - 6; - root = 0; + root = gp_GetFirstVertex(theGraph); v = last = _getUnprocessedChild(theGraph, root); while (v != root && theGraph->M < M) diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/listcoll.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/listcoll.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/listcoll.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/listcoll.c index 1c52cd9b4..6bc7ac764 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/listcoll.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/listcoll.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/listcoll.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/listcoll.h similarity index 80% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/listcoll.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/listcoll.h index 6b1eeca0b..de4b0f509 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/listcoll.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/listcoll.h @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -73,14 +73,21 @@ int LCDelete(listCollectionP listColl, int theList, int theNode); : theNode==theList ? NIL : listColl->List[theNode].prev) /* int LCPrepend(listCollectionP listColl, int theList, int theNode); - After an append, theNode is last, which in a circular list is the direct predecessor - of the list head node, so we just back up one. For singletons, this has no effect.*/ + If theList is empty, then theNode becomes its only member and is returned. + Otherwise, theNode is placed before theList head, and theNode is returned as the new head. */ -#define LCPrepend(listColl, theList, theNode) listColl->List[LCAppend(listColl, theList, theNode)].prev +#define LCPrepend(listColl, theList, theNode) \ + (theList==NIL \ + ? (listColl->List[theNode].prev = listColl->List[theNode].next = theNode) \ + : (listColl->List[theNode].next = theList, \ + listColl->List[theNode].prev = listColl->List[theList].prev, \ + listColl->List[listColl->List[theNode].prev].next = theNode, \ + listColl->List[theList].prev = theNode, \ + listColl->List[theList].prev)) /* int LCAppend(listCollectionP listColl, int theList, int theNode); If theList is empty, then theNode becomes its only member and is returned. - Otherwise, theNode is placed before theList head, which is returned. */ + Otherwise, theNode is placed before theList head, and then theList head is returned. */ #define LCAppend(listColl, theList, theNode) \ (theList==NIL \ @@ -89,7 +96,7 @@ int LCDelete(listCollectionP listColl, int theList, int theNode); listColl->List[theNode].prev = listColl->List[theList].prev, \ listColl->List[listColl->List[theNode].prev].next = theNode, \ listColl->List[theList].prev = theNode, \ - theList)) + theList)) /* int LCDelete(listCollectionP listColl, int theList, int theNode); If theList contains only one node, then NIL it out and return NIL meaning empty list diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarity.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarity.c similarity index 81% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarity.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarity.c index 699059ab1..4f3458931 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarity.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarity.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -10,18 +10,18 @@ void ProjectTitle() { // This message is the main location of the version number. // The format is major.minor.maintenance.tweak - // Major is for an overhaul (e.g. many features, data structure change) - // Minor is for feature addition, e.g. a new algorithm implementation added - // Maintenance is for functional revision, e.g. bug fix to algorithm implementation - // Tweak is for a non-functional revision, e.g. change of build scripts or testing code + // Major is for an overhaul (e.g. many features, data structure change, change of backward compatibility) + // Minor is for a feature addition (e.g. a new algorithm implementation added, new interface) + // Maintenance is for functional revision (e.g. bug fix to existing algorithm implementation) + // Tweak is for a non-functional revision (e.g. change of build scripts or testing code, user-facing string changes) // If the version here is increased, also increase it in configure.ac // Furthermore, a change of Major, Minor or Maintenance here should cause a change // of Current, Revision and/or Age as documented in configure.ac Message("\n==================================================" - "\nThe Edge Addition Planarity Suite version 3.0.0.5" - "\nCopyright (c) 1997-2016 by John M. Boyer" + "\nThe Edge Addition Planarity Suite version 3.0.1.0" + "\nCopyright (c) 1997-2020 by John M. Boyer" "\nContact info: jboyer at acm.org" "\n==================================================" "\n"); @@ -74,7 +74,6 @@ int helpMessage(char *param) Message( "'planarity': if no command-line, then menu-driven\n" "'planarity (-h|-help)': this message\n" - "'planarity (-h|-help) -gen': more help with graph generator command line\n" "'planarity (-h|-help) -menu': more help with menu-based command line\n" "'planarity (-i|-info): copyright and license information\n" "'planarity -test [-q] [C]': runs tests (optional quiet mode, single test)\n" @@ -99,8 +98,8 @@ int helpMessage(char *param) else if (strcmp(param, "-i") == 0 || strcmp(param, "-info") == 0) { Message( - "The Edge Addition Planarity Suite\n" - "Copyright (c) 1997-2015, John M. Boyer\n" + "The Edge Addition Planarity Suite version 3.0.1.0\n" + "Copyright (c) 1997-2020, John M. Boyer\n" "All rights reserved. \n" "See the LICENSE.TXT file for licensing information. \n" "\n" @@ -108,21 +107,21 @@ int helpMessage(char *param) "\n" "* John M. Boyer. \"Subgraph Homeomorphism via the Edge Addition Planarity \n" " Algorithm\". Journal of Graph Algorithms and Applications, Vol. 16, \n" - " no. 2, pp. 381-410, 2012. http://www.jgaa.info/16/268.html\n" + " no. 2, pp. 381-410, 2012. http://dx.doi.org/10.7155/jgaa.00268\n" "\n" "* John M. Boyer. \"A New Method for Efficiently Generating Planar Graph\n" " Visibility Representations\". In P. Eades and P. Healy, editors,\n" " Proceedings of the 13th International Conference on Graph Drawing 2005,\n" " Lecture Notes Comput. Sci., Volume 3843, pp. 508-511, Springer-Verlag, 2006.\n" + " http://dx.doi.org/10.1007/11618058_47\n" "\n" "* John M. Boyer and Wendy J. Myrvold. \"On the Cutting Edge: Simplified O(n)\n" " Planarity by Edge Addition\". Journal of Graph Algorithms and Applications,\n" - " Vol. 8, No. 3, pp. 241-273, 2004.\n" - " http://www.jgaa.info/08/91.html\n" + " Vol. 8, No. 3, pp. 241-273, 2004. http://dx.doi.org/10.7155/jgaa.00091\n" "\n" "* John M. Boyer. \"Simplified O(n) Algorithms for Planar Graph Embedding,\n" " Kuratowski Subgraph Isolation, and Related Problems\". Ph.D. Dissertation,\n" - " University of Victoria, 2001.\n" + " University of Victoria, 2001. https://dspace.library.uvic.ca/handle/1828/9918\n" "\n" ); } @@ -207,15 +206,19 @@ char Choice; else if (Choice != 'x') { char *secondOutfile = NULL; - if (Choice == 'p' || Choice == 'o' || Choice == 'd') + if (Choice == 'p' || Choice == 'd' || Choice == 'o') secondOutfile =""; - switch (tolower(Mode)) - { - case 's' : SpecificGraph(Choice, NULL, NULL, secondOutfile); break; - case 'r' : RandomGraphs(Choice, 0, 0); break; - case 'm' : RandomGraph(Choice, 0, 0, NULL, NULL); break; - case 'n' : RandomGraph(Choice, 1, 0, NULL, NULL); break; + if (!strchr("pdo234", Choice)) { + Message("Invalid menu choice, please try again."); + } else { + switch (tolower(Mode)) + { + case 's' : SpecificGraph(Choice, NULL, NULL, secondOutfile); break; + case 'r' : RandomGraphs(Choice, 0, 0); break; + case 'm' : RandomGraph(Choice, 0, 0, NULL, NULL); break; + case 'n' : RandomGraph(Choice, 1, 0, NULL, NULL); break; + } } } diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarity.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarity.h similarity index 94% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarity.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarity.h index 79f4687ae..b8489fdf1 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarity.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarity.h @@ -2,7 +2,7 @@ #define PLANARITY_H /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityCommandLine.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityCommandLine.c similarity index 81% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityCommandLine.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityCommandLine.c index e7149934e..f8e6068fe 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityCommandLine.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityCommandLine.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -108,52 +108,6 @@ int Result; return Result==OK || Result==NONEMBEDDABLE ? 0 : -2; } -/**************************************************************************** - WriteTestFiles() - A one-time-run piece of code that generates batch files which perform the - incremental tests of all 12 vertex graphs. - - The format of the command line is: - planarity -gen -q -a n j j 12 i > TestResult_n_j_j_12_i.txt - - The n is for the number of vertices. - The j j is the number of edges, between 0 and n(n-1)/2. - The mod divides the problem into partitions that can be run on separate threads. - The i is a partition number between 0 and mod-1. Each test batch file receives - a number i, and within it are all the command lines for that partition to test - each number of edges. - The numbers of edges are tested separately because the implementation makes - a smaller data structure for graphs that are of a guaranteed maximum size. - ****************************************************************************/ - -void WriteTestFiles(int n, int mod) -{ - char filename[64]; - FILE *outfile; - int k, e; - int maxe=n*(n-1)/2; - - for (k = 0; k < mod; k++) - { - sprintf(filename, "test_n%02d\\test_n%02d_mod%02d.bat", n, n, k); - outfile = fopen(filename, "wt"); - if (outfile == NULL) - { - printf("Error creating test file %s\nRemember to create directory Test_n%02d\n", filename, n); - return; - } - - for (e = 0; e <= maxe; e++) - { - sprintf(filename, "results\\result_%02d_%02d_%02d_%02d_%02d.txt", n, e, e, mod, k); - fprintf(outfile, "..\\planarity -gen -a %d %d %d %d %d > %s\n", n, e, e, mod, k, filename); - } - fclose(outfile); - } - - printf("Created test files. Remember to create 'results' in test subdirectory\n"); -} - /**************************************************************************** Quick regression test ****************************************************************************/ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityRandomGraphs.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityRandomGraphs.c similarity index 78% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityRandomGraphs.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityRandomGraphs.c index 7d61e17fc..435fc2c54 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityRandomGraphs.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityRandomGraphs.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -31,6 +31,10 @@ graphP theGraph=NULL, origGraph=NULL; platform_time start, end; int embedFlags = GetEmbedFlags(command); int ReuseGraphs = TRUE; +int writeResult; +int writeErrorReported_Random=FALSE, writeErrorReported_Embedded=FALSE, + writeErrorReported_AdjList=FALSE, writeErrorReported_Obstructed=FALSE, + writeErrorReported_Error=FALSE; GetNumberIfZero(&NumGraphs, "Enter number of graphs to generate:", 1, 1000000000); GetNumberIfZero(&SizeOfGraphs, "Enter size of graphs:", 1, 10000); @@ -73,8 +77,14 @@ int ReuseGraphs = TRUE; { if (tolower(OrigOut)=='y') { - sprintf(theFileName, "random\\%d.txt", K%10); - gp_Write(theGraph, theFileName, WRITE_ADJLIST); + sprintf(theFileName, "random%c%d.txt", FILE_DELIMITER, K%10); + writeResult = gp_Write(theGraph, theFileName, WRITE_ADJLIST); + if (writeResult != OK && !writeErrorReported_Random) + { + sprintf(Line, "Failed to write graph %s\nMake the directory if not present\n", theFileName); + ErrorMessage(Line); + writeErrorReported_Random = TRUE; + } } gp_CopyGraph(origGraph, theGraph); @@ -92,14 +102,26 @@ int ReuseGraphs = TRUE; if (tolower(EmbeddableOut) == 'y') { - sprintf(theFileName, "embedded\\%d.txt", K%10); - gp_Write(theGraph, theFileName, WRITE_ADJMATRIX); + sprintf(theFileName, "embedded%c%d.txt", FILE_DELIMITER, K%10); + writeResult = gp_Write(theGraph, theFileName, WRITE_ADJMATRIX); + if (writeResult != OK && !writeErrorReported_Embedded) + { + sprintf(Line, "Failed to write graph %s\nMake the directory if not present\n", theFileName); + ErrorMessage(Line); + writeErrorReported_Embedded = TRUE; + } } if (tolower(AdjListsForEmbeddingsOut) == 'y') { - sprintf(theFileName, "adjlist\\%d.txt", K%10); - gp_Write(theGraph, theFileName, WRITE_ADJLIST); + sprintf(theFileName, "adjlist%c%d.txt", FILE_DELIMITER, K%10); + writeResult = gp_Write(theGraph, theFileName, WRITE_ADJLIST); + if (writeResult != OK && !writeErrorReported_AdjList) + { + sprintf(Line, "Failed to write graph %s\nMake the directory if not present\n", theFileName); + ErrorMessage(Line); + writeErrorReported_AdjList = TRUE; + } } } else if (Result == NONEMBEDDABLE) @@ -128,8 +150,14 @@ int ReuseGraphs = TRUE; if (tolower(ObstructedOut) == 'y') { - sprintf(theFileName, "obstructed\\%d.txt", K%10); - gp_Write(theGraph, theFileName, WRITE_ADJMATRIX); + sprintf(theFileName, "obstructed%c%d.txt", FILE_DELIMITER, K%10); + writeResult = gp_Write(theGraph, theFileName, WRITE_ADJMATRIX); + if (writeResult != OK && !writeErrorReported_Obstructed) + { + sprintf(Line, "Failed to write graph %s\nMake the directory if not present\n", theFileName); + ErrorMessage(Line); + writeErrorReported_Obstructed = TRUE; + } } } } @@ -138,8 +166,14 @@ int ReuseGraphs = TRUE; // If there is an error in processing, then write the file for debugging if (Result != OK && Result != NONEMBEDDABLE) { - sprintf(theFileName, "error\\%d.txt", K%10); - gp_Write(origGraph, theFileName, WRITE_ADJLIST); + sprintf(theFileName, "error%c%d.txt", FILE_DELIMITER, K%10); + writeResult = gp_Write(origGraph, theFileName, WRITE_ADJLIST); + if (writeResult != OK && !writeErrorReported_Error) + { + sprintf(Line, "Failed to write graph %s\nMake the directory if not present\n", theFileName); + ErrorMessage(Line); + writeErrorReported_Error = TRUE; + } } } @@ -389,13 +423,17 @@ char saveEdgeListFormat; scanf(" %c", &saveEdgeListFormat); if (tolower(saveEdgeListFormat) == 'y') { - char *fileName = "maxPlanarEdgeList.txt"; + char theFileName[256]; + if (extraEdges > 0) - fileName = "nonPlanarEdgeList.txt"; + sprintf(theFileName, "random%cnonPlanarEdgeList.txt", FILE_DELIMITER); + else + sprintf(theFileName, "random%cmaxPlanarEdgeList.txt", FILE_DELIMITER); - SaveAsciiGraph(theGraph, fileName); - sprintf(Line, "Edge list format saved to '%s'\n", fileName); + sprintf(Line, "Saving edge list format to '%s'\n", theFileName); Message(Line); + + SaveAsciiGraph(theGraph, theFileName); } } else ErrorMessage("Failure occurred"); diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planaritySpecificGraph.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planaritySpecificGraph.c similarity index 96% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planaritySpecificGraph.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planaritySpecificGraph.c index 3701e4515..1e817ef97 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planaritySpecificGraph.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planaritySpecificGraph.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityUtils.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityUtils.c similarity index 86% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityUtils.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityUtils.c index 079b067b7..f5b469b88 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/planarityUtils.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/planarityUtils.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -64,11 +64,7 @@ void Message(char *message) if (quietMode == 'n') { fprintf(stdout, "%s", message); - -#ifdef DEBUG -// fprintf(stdout, "\n"); fflush(stdout); -#endif } } @@ -77,20 +73,12 @@ void ErrorMessage(char *message) if (quietMode == 'n') { fprintf(stderr, "%s", message); - -#ifdef DEBUG - fprintf(stderr, "\n"); fflush(stderr); -#endif } } void FlushConsole(FILE *f) { -#ifdef DEBUG - // Certain debuggers only flush completed lines of output to the console - fprintf(f, "\n"); -#endif fflush(f); } @@ -105,20 +93,43 @@ void Prompt(char *message) void SaveAsciiGraph(graphP theGraph, char *filename) { - int e, EsizeOccupied; - FILE *outfile = fopen(filename, "wt"); + int e, EsizeOccupied, vertexLabelFix; + FILE *outfile = fopen(filename, WRITETEXT); + + // The filename may specify a directory that doesn't exist + if (outfile == NULL) + { + sprintf(Line, "Failed to write to %s\nMake the directory if not present\n", filename); + ErrorMessage(Line); + return; + } + + // If filename includes path elements, remove them before writing the file's name to the file + if (strrchr(filename, FILE_DELIMITER)) + filename = strrchr(filename, FILE_DELIMITER)+1; + fprintf(outfile, "%s\n", filename); + // This edge list file format uses 1-based vertex numbering, and the current code + // internally uses 1-based indexing by default, so this vertex label 'fix' adds zero + // But earlier code used 0-based indexing and added one on output, so we replicate + // that behavior in case the current code has been compiled with zero-based indexing. + vertexLabelFix = 1 - gp_GetFirstVertex(theGraph); + + // Iterate over the edges of the graph EsizeOccupied = gp_EdgeInUseIndexBound(theGraph); for (e = gp_GetFirstEdge(theGraph); e < EsizeOccupied; e+=2) { - // Skip the edge holes + // Only output edges that haven't been deleted (i.e. skip the edge holes) if (gp_EdgeInUse(theGraph, e)) { - fprintf(outfile, "%d %d\n", gp_GetNeighbor(theGraph, e)+1, gp_GetNeighbor(theGraph, e+1)+1); + fprintf(outfile, "%d %d\n", + gp_GetNeighbor(theGraph, e) + vertexLabelFix, + gp_GetNeighbor(theGraph, e+1) + vertexLabelFix); } } + // Since vertex numbers are at least 1, this indicates the end of the edge list fprintf(outfile, "0 0\n"); fclose(outfile); diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/platformTime.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/platformTime.h similarity index 94% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/platformTime.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/platformTime.h index 355d1c155..14453f4fd 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/platformTime.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/platformTime.h @@ -2,7 +2,7 @@ #define PLATFORM_TIME /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/stack.c b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/stack.c similarity index 79% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/stack.c rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/stack.c index afccfbdc5..ce1c04e7b 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/stack.c +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/stack.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -154,6 +154,15 @@ int sp__Pop(stackP theStack, int *pA) return OK; } +int sp__Pop_Discard(stackP theStack) +{ + if (theStack->size <= 0) + return NOTOK; + + --theStack->size; + return OK; +} + int sp__Pop2(stackP theStack, int *pA, int *pB) { if (theStack->size <= 1) @@ -165,6 +174,31 @@ int sp__Pop2(stackP theStack, int *pA, int *pB) return OK; } +int sp__Pop2_Discard1(stackP theStack, int *pA) +{ + if (theStack->size <= 1) + return NOTOK; + + // When a pair of the form (main, secondary) are pushed in order, + // it is sometimes necessary to pop the secondary and discard, + // then pop and store the main datum. + --theStack->size; + *pA = theStack->S[--theStack->size]; + + return OK; +} + +int sp__Pop2_Discard(stackP theStack) +{ + if (theStack->size <= 1) + return NOTOK; + + --theStack->size; + --theStack->size; + + return OK; +} + int sp_Top(stackP theStack) { return theStack->size ? theStack->S[theStack->size-1] : NIL; diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/stack.h b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/stack.h similarity index 73% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/c/stack.h rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/c/stack.h index 34b2f5931..e6e87f910 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/c/stack.h +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/c/stack.h @@ -1,5 +1,5 @@ /* -Copyright (c) 1997-2015, John M. Boyer +Copyright (c) 1997-2020, John M. Boyer All rights reserved. See the LICENSE.TXT file for licensing information. */ @@ -48,10 +48,18 @@ int sp__Push(stackP, int); int sp__Push2(stackP, int, int); #define sp_Pop(theStack, a) { if (sp__Pop(theStack, &(a)) != OK) return NOTOK; } +#define sp_Pop_Discard(theStack) { if (sp__Pop_Discard(theStack) != OK) return NOTOK; } + #define sp_Pop2(theStack, a, b) { if (sp__Pop2(theStack, &(a), &(b)) != OK) return NOTOK; } +#define sp_Pop2_Discard1(theStack, a) { if (sp__Pop2_Discard1(theStack, &(a)) != OK) return NOTOK; } +#define sp_Pop2_Discard(theStack) { if (sp__Pop2_Discard(theStack) != OK) return NOTOK; } int sp__Pop(stackP, int *); +int sp__Pop_Discard(stackP theStack); + int sp__Pop2(stackP, int *, int *); +int sp__Pop2_Discard1(stackP theStack, int *pA); +int sp__Pop2_Discard(stackP theStack); int sp_Top(stackP); int sp_Get(stackP, int); @@ -70,7 +78,11 @@ int sp_Set(stackP, int, int); #define sp_Push2(theStack, a, b) {sp_Push(theStack, a); sp_Push(theStack, b);} #define sp_Pop(theStack, a) a=theStack->S[--theStack->size] +#define sp_Pop_Discard(theStack) --theStack->size + #define sp_Pop2(theStack, a, b) {sp_Pop(theStack, b);sp_Pop(theStack, a);} +#define sp_Pop2_Discard1(theStack, a) {sp_Pop_Discard(theStack);sp_Pop(theStack, a);} +#define sp_Pop2_Discard(theStack) {sp_Pop_Discard(theStack);sp_Pop_Discard(theStack);} #define sp_Top(theStack) (theStack->size ? theStack->S[theStack->size-1] : NIL) #define sp_Get(theStack, pos) (theStack->S[pos]) diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/configure.ac b/extern/edge-addition-planarity-suite-Version_3.0.1.0/configure.ac similarity index 90% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/configure.ac rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/configure.ac index f167b774e..46f52432f 100644 --- a/extern/edge-addition-planarity-suite-Version_3.0.0.5/configure.ac +++ b/extern/edge-addition-planarity-suite-Version_3.0.1.0/configure.ac @@ -1,7 +1,6 @@ -AC_INIT(planarity, 3.0.0.5, jboyer@acm.org) +AC_INIT(planarity, 3.0.1.0, jboyer@acm.org) AM_INIT_AUTOMAKE([subdir-objects] [foreign]) AC_CONFIG_SRCDIR([c/]) -AC_CONFIG_MACRO_DIR([m4]) # The version of the libtool library is of the form current:revision:age # @@ -15,7 +14,7 @@ AC_CONFIG_MACRO_DIR([m4]) # 3. If interfaces were removed (breaks backward compatibility): increment # current, and set both revision and age to zero. LT_CURRENT=0 -LT_REVISION=0 +LT_REVISION=1 LT_AGE=0 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) diff --git a/extern/edge-addition-planarity-suite-Version_3.0.0.5/planarity.1 b/extern/edge-addition-planarity-suite-Version_3.0.1.0/planarity.1 similarity index 100% rename from extern/edge-addition-planarity-suite-Version_3.0.0.5/planarity.1 rename to extern/edge-addition-planarity-suite-Version_3.0.1.0/planarity.1 diff --git a/gap/attr.gd b/gap/attr.gd index 913544ca9..7f57ba5d2 100644 --- a/gap/attr.gd +++ b/gap/attr.gd @@ -18,8 +18,7 @@ DeclareAttribute("DigraphNrLoops", IsDigraph); DeclareAttribute("DigraphRange", IsDigraph); DeclareAttribute("DigraphSource", IsDigraph); -DeclareAttribute("OutNeighbours", IsDigraph); -DeclareSynonymAttr("OutNeighbors", OutNeighbours); +DeclareGlobalFunction("OutNeighbors"); DeclareAttribute("InNeighbours", IsDigraph); DeclareSynonymAttr("InNeighbors", InNeighbours); DeclareAttribute("DigraphAdjacencyFunction", IsDigraph); diff --git a/gap/attr.gi b/gap/attr.gi index 25928c5cc..3b56892da 100644 --- a/gap/attr.gi +++ b/gap/attr.gi @@ -11,8 +11,7 @@ InstallMethod(DigraphNrVertices, "for a digraph by out-neighbours", [IsDigraphByOutNeighboursRep], DIGRAPH_NR_VERTICES); -InstallMethod(OutNeighbours, "for a digraph by out-neighbours", -[IsDigraphByOutNeighboursRep], DIGRAPH_OUT_NEIGHBOURS); +InstallGlobalFunction(OutNeighbors, OutNeighbours); # The next method is (yet another) DFS which simultaneously computes: # 1. *articulation points* as described in @@ -992,7 +991,7 @@ function(digraph) fi; oddgirth := infinity; for comp in comps do - if comps > 1 then + if Length(comps) > 1 then # i.e. if not IsStronglyConnectedDigraph(digraph) gr := InducedSubdigraph(digraph, comp); else gr := digraph; @@ -1465,18 +1464,6 @@ end); InstallMethod(CharacteristicPolynomial, "for a digraph", [IsDigraph], D -> CharacteristicPolynomial(AdjacencyMatrix(D))); -InstallMethod(IsVertexTransitive, "for a digraph", [IsDigraph], -D -> IsTransitive(AutomorphismGroup(D), DigraphVertices(D))); - -InstallMethod(IsEdgeTransitive, "for a digraph", [IsDigraph], -function(D) - if IsMultiDigraph(D) then - ErrorNoReturn("the argument must be a digraph with no multiple", - " edges,"); - fi; - return IsTransitive(AutomorphismGroup(D), DigraphEdges(D), OnPairs); -end); - # Things that are attributes for immutable digraphs, but operations for mutable. # Don't use InstallMethodThatReturnsDigraph since we can do better in this case. diff --git a/src/digraphs.c b/src/digraphs.c index abce1268d..5653d9678 100644 --- a/src/digraphs.c +++ b/src/digraphs.c @@ -86,7 +86,9 @@ Obj FuncOutNeighbours(Obj self, Obj D) { if (!RNamOutNeighbours) { RNamOutNeighbours = RNamName("OutNeighbours"); } - if (IsbPRec(D, RNamOutNeighbours)) { + if (!CALL_1ARGS(IsDigraph, D)) { + ErrorQuit("expected a digraph, not a %s", (Int) TNAM_OBJ(D), 0L); + } else if (IsbPRec(D, RNamOutNeighbours)) { return ElmPRec(D, RNamOutNeighbours); } else { ErrorQuit( @@ -2127,7 +2129,7 @@ static StructGVarFunc GVarFuncs[] = { FuncDIGRAPH_SOURCE_RANGE, "src/digraphs.c:FuncDIGRAPH_SOURCE_RANGE"}, - {"DIGRAPH_OUT_NEIGHBOURS", + {"OutNeighbours", 1, "D", FuncOutNeighbours, diff --git a/tst/standard/attr.tst b/tst/standard/attr.tst index 786d426a5..735e63c8e 100644 --- a/tst/standard/attr.tst +++ b/tst/standard/attr.tst @@ -96,7 +96,9 @@ gap> gr := Digraph([[], []]); gap> DigraphDual(gr); -gap> gr := Digraph(rec(DigraphNrVertices := 2, DigraphSource := [], DigraphRange := [])); +gap> gr := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [], +> DigraphRange := [])); gap> DigraphDual(gr); @@ -170,7 +172,9 @@ gap> adj2 := AdjacencyMatrix(gr); [ 0, 0, 0, 0, 2, 0, 0 ] ] gap> adj1 = adj2; true -gap> r := rec(DigraphNrVertices := 1, DigraphSource := [1, 1], DigraphRange := [1, 1]);; +gap> r := rec(DigraphNrVertices := 1, +> DigraphSource := [1, 1], +> DigraphRange := [1, 1]);; gap> gr := Digraph(r); gap> adj1 := AdjacencyMatrix(gr); @@ -183,12 +187,15 @@ gap> adj1 = adj2; true gap> AdjacencyMatrix(Digraph([])); [ ] -gap> AdjacencyMatrix( -> Digraph(rec(DigraphNrVertices := 0, DigraphSource := [], DigraphRange := []))); +gap> AdjacencyMatrix(Digraph(rec(DigraphNrVertices := 0, +> DigraphSource := [], +> DigraphRange := []))); [ ] # DigraphTopologicalSort -gap> r := rec(DigraphNrVertices := 20000, DigraphSource := [], DigraphRange := []);; +gap> r := rec(DigraphNrVertices := 20000, +> DigraphSource := [], +> DigraphRange := []);; gap> for i in [1 .. 9999] do > Add(r.DigraphSource, i); > Add(r.DigraphRange, i + 1); @@ -214,7 +221,9 @@ gap> gr := Digraph([[2], [1]]); gap> DigraphTopologicalSort(gr); fail -gap> r := rec(DigraphNrVertices := 2, DigraphSource := [1, 1], DigraphRange := [2, 2]);; +gap> r := rec(DigraphNrVertices := 2, +> DigraphSource := [1, 1], +> DigraphRange := [2, 2]);; gap> multiple := Digraph(r);; gap> DigraphTopologicalSort(multiple); [ 2, 1 ] @@ -364,12 +373,14 @@ rec( comps := [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] ], id := [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ) gap> gr := Digraph(rec( > DigraphNrVertices := 100, -> DigraphSource := [8, 9, 11, 11, 12, 13, 14, 14, 18, 19, 22, 27, 31, 32, 32, 34, -> 37, 40, 45, 48, 50, 52, 58, 58, 58, 59, 60, 60, 65, 66, 73, -> 75, 79, 81, 81, 83, 84, 86, 86, 89, 96, 100, 100, 100], -> DigraphRange := [54, 62, 28, 55, 70, 37, 20, 32, 53, 16, 42, 66, 63, 13, 73, 89, -> 36, 5, 4, 58, 26, 48, 36, 56, 65, 78, 95, 96, 97, 60, 11, 66, -> 66, 19, 79, 21, 13, 29, 78, 98, 100, 44, 53, 69])); +> DigraphSource := [8, 9, 11, 11, 12, 13, 14, 14, 18, 19, 22, 27, 31, 32, +> 32, 34, 37, 40, 45, 48, 50, 52, 58, 58, 58, 59, 60, 60, +> 65, 66, 73, 75, 79, 81, 81, 83, 84, 86, 86, 89, 96, 100, +> 100, 100], +> DigraphRange := [54, 62, 28, 55, 70, 37, 20, 32, 53, 16, 42, 66, 63, 13, +> 73, 89, 36, 5, 4, 58, 26, 48, 36, 56, 65, 78, 95, 96, +> 97, 60, 11, 66, 66, 19, 79, 21, 13, 29, 78, 98, 100, 44, +> 53, 69])); gap> OutNeighbours(gr); [ [ ], [ ], [ ], [ ], [ ], [ ], [ ], [ 54 ], [ 62 ], [ ], [ 28, 55 ], @@ -423,7 +434,9 @@ gap> DigraphShortestDistances(Digraph([])); [ ] gap> mat := DigraphShortestDistances(Digraph([[], []])); [ [ 0, fail ], [ fail, 0 ] ] -gap> r := rec(DigraphVertices := [1 .. 15], DigraphSource := [], DigraphRange := []);; +gap> r := rec(DigraphVertices := [1 .. 15], +> DigraphSource := [], +> DigraphRange := []);; gap> for i in [1 .. 15] do > for j in [1 .. 15] do > Add(r.DigraphSource, i); @@ -448,8 +461,9 @@ gap> Display(DigraphShortestDistances(complete15)); [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ] ] -gap> r := rec(DigraphNrVertices := 7, DigraphRange := [3, 5, 5, 4, 6, 2, 5, 3, 3, 7, 2], -> DigraphSource := [1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 7]);; +gap> r := rec(DigraphNrVertices := 7, +> DigraphRange := [3, 5, 5, 4, 6, 2, 5, 3, 3, 7, 2], +> DigraphSource := [1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 7]);; gap> gr := Digraph(r); gap> Display(DigraphShortestDistances(gr)); @@ -473,8 +487,9 @@ gap> DigraphShortestDistances(gr); [ [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 0 ] ] # OutNeighbours and InNeighbours -gap> gr := Digraph(rec(DigraphNrVertices := 10, DigraphSource := [1, 1, 5, 5, 7, 10], -> DigraphRange := [3, 3, 1, 10, 7, 1])); +gap> gr := Digraph(rec(DigraphNrVertices := 10, +> DigraphSource := [1, 1, 5, 5, 7, 10], +> DigraphRange := [3, 3, 1, 10, 7, 1])); gap> InNeighbours(gr); [ [ 5, 10 ], [ ], [ 1, 1 ], [ ], [ ], [ ], [ 7 ], [ ], [ ], [ 5 ] ] @@ -542,10 +557,10 @@ gap> InDegrees(gr2); gap> InDegreeSequence(gr2); [ 5, 5, 5, 5, 4, 3, 1, 0 ] gap> r := rec(DigraphNrVertices := 8, -> DigraphSource := [1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 7, 7, -> 7, 7, 7, 7, 8, 8], -> DigraphRange := [6, 7, 1, 1, 3, 3, 6, 5, 1, 4, 4, 4, 8, 1, 3, 4, 6, 7, 7, 7, 1, 4, -> 5, 6, 5, 7, 5, 6]);; +> DigraphSource := [1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, +> 7, 7, 7, 7, 7, 7, 8, 8], +> DigraphRange := [6, 7, 1, 1, 3, 3, 6, 5, 1, 4, 4, 4, 8, 1, 3, 4, 6, 7, 7, 7, +> 1, 4, 5, 6, 5, 7, 5, 6]);; gap> gr3 := Digraph(r); gap> OutDegrees(gr3); @@ -1202,6 +1217,12 @@ gap> for i in [1 .. 10] do > od; gap> DigraphOddGirth(D); 7 +gap> D := DigraphFromDigraph6String("&IWsC_A?_PG_GDKC?cO"); + +gap> DigraphGirth(D); +2 +gap> DigraphOddGirth(D); +3 # DigraphMycielskian gap> D1 := DigraphSymmetricClosure(CycleDigraph(2)); @@ -1353,6 +1374,13 @@ gap> gr := MaximalSymmetricSubdigraphWithoutLoops(gr); gap> OutNeighbours(gr); [ [ 2, 3 ], [ 1 ], [ 1 ] ] +gap> D := Digraph(IsImmutableDigraph, [[2, 2], [1]]); + +gap> DigraphRemoveAllMultipleEdges(D);; +gap> HasDigraphRemoveAllMultipleEdgesAttr(D); +true +gap> IsCompleteDigraph(MaximalSymmetricSubdigraph(D)); +true # RepresentativeOutNeighbours gap> gr := CycleDigraph(5); @@ -1560,6 +1588,8 @@ gap> forest := UndirectedSpanningForest(gr); fail gap> UndirectedSpanningForest(EmptyDigraph(IsMutableDigraph, 0)); fail +gap> UndirectedSpanningTree(ChainDigraph(IsMutableDigraph, 4)); +fail gap> gr := EmptyDigraph(1); gap> tree := UndirectedSpanningTree(gr); @@ -1964,8 +1994,8 @@ gap> DigraphCore(D); [ 8 .. 29 ] gap> IsDigraphCore(InducedSubdigraph(D, DigraphCore(D))); true -gap> str := ".qb`hOAW@fAiG]g??aGD[TXAbjgWl^?fkG{~cA@p`e~EIRlHSxBFHx\\RJ@ERCYhVSoIDvIE?c?x_\ -> YBJg?IWmoN_djWMyKnckGkdMqBsQMBWsBaK?\\BBFWOvY[vcHp]N";; +gap> str := ".qb`hOAW@fAiG]g??aGD[TXAbjgWl^?fkG{~cA@p`e~EIRlHSxBFHx\\RJ@ERCYhV\ +> SoIDvIE?c?x_YBJg?IWmoN_djWMyKnckGkdMqBsQMBWsBaK?\\BBFWOvY[vcHp]N";; gap> D := DigraphFromDiSparse6String(str); gap> DigraphCore(D); @@ -2032,6 +2062,13 @@ gap> MaximalAntiSymmetricSubdigraph(D); gap> MaximalAntiSymmetricSubdigraph(D); +gap> D := Digraph(IsImmutableDigraph, [[2, 2], [1]]); + +gap> DigraphRemoveAllMultipleEdges(D);; +gap> HasDigraphRemoveAllMultipleEdgesAttr(D); +true +gap> IsChainDigraph(MaximalAntiSymmetricSubdigraph(D)); +true # CharacteristicPolynomial gap> gr := Digraph([ @@ -2141,6 +2178,11 @@ gap> DigraphTransitiveReduction(gr); Error, not yet implemented for non-topologically sortable digraphs, gap> DigraphReflexiveTransitiveReduction(gr); Error, not yet implemented for non-topologically sortable digraphs, +gap> D := Digraph(IsImmutableDigraph, [[1, 2, 3], [3], [3]]);; +gap> DigraphRemoveLoops(D);; HasDigraphRemoveLoopsAttr(D); +true +gap> DigraphReflexiveTransitiveReduction(D) = ChainDigraph(3); +true # Working examples gap> gr1 := ChainDigraph(6); @@ -2206,7 +2248,8 @@ gap> gr := Digraph([[2], [1]]); gap> SetIsSymmetricDigraph(gr, true); gap> gr = DigraphReverse(gr); true -gap> DigraphReverse(Digraph(IsMutableDigraph, [[2], [1]])) = CompleteDigraph(2); +gap> DigraphReverse(Digraph(IsMutableDigraph, [[2], [1]])) +> = CompleteDigraph(2); true # DigraphCartesianProductProjections @@ -2246,7 +2289,8 @@ gap> IsIdempotent(proj[2]); true gap> RankOfTransformation(proj[3]); 2 -gap> P := DigraphRemoveAllMultipleEdges(ReducedDigraph(OnDigraphs(D, proj[2])));; +gap> P := DigraphRemoveAllMultipleEdges( +> ReducedDigraph(OnDigraphs(D, proj[2])));; gap> IsIsomorphicDigraph(CycleDigraph(4), P); true gap> G := RandomDigraph(12);; @@ -2257,7 +2301,8 @@ gap> IsIdempotent(proj[1]); true gap> RankOfTransformation(proj[2]); 50 -gap> P := DigraphRemoveAllMultipleEdges(ReducedDigraph(OnDigraphs(D, proj[2])));; +gap> P := DigraphRemoveAllMultipleEdges( +> ReducedDigraph(OnDigraphs(D, proj[2])));; gap> IsIsomorphicDigraph(H, P); true @@ -2267,8 +2312,8 @@ gap> D := DigraphFromDigraph6String("&Sq_MN|bDCLy~Xj}u}GxOLlGfqJtnSQ|l\ gap> M := DigraphMaximalMatching(D);; IsMaximalMatching(D, M); true -gap> D := DigraphFromDigraph6String(IsMutable, "&Sq_MN|bDCLy~Xj}u}GxOLlGfqJtnSQ|l\ -> Q?lYvjbqN~XNNAQYDJE[UHOhyGOqtsjCWJy["); +gap> D := DigraphFromDigraph6String(IsMutable, +> "&Sq_MN|bDCLy~Xj}u}GxOLlGfqJtnSQ|lQ?lYvjbqN~XNNAQYDJE[UHOhyGOqtsjCWJy["); gap> M := DigraphMaximalMatching(D);; IsMaximalMatching(D, M); true @@ -2281,7 +2326,8 @@ gap> D; # DigraphMaximumMatching -gap> D := DigraphFromDiSparse6String(".]cBn@kqAlt?EpclQp|M}bAgFjHkoDsIuACyCM_Hj"); +gap> D := DigraphFromDiSparse6String( +> ".]cBn@kqAlt?EpclQp|M}bAgFjHkoDsIuACyCM_Hj"); gap> M := DigraphMaximumMatching(D);; IsMaximalMatching(D, M); true @@ -2498,7 +2544,8 @@ gap> D := Digraph([[1, 4, 4], [2, 2, 4], [4], [3, 5], [5]]); gap> DigraphNrLoops(D); 4 -gap> D := Digraph(IsMutableDigraph, [[1, 2], [2, 3], [3, 4], [1, 4, 5], [2, 5]]); +gap> D := Digraph(IsMutableDigraph, +> [[1, 2], [2, 3], [3, 4], [1, 4, 5], [2, 5]]); gap> DigraphNrLoops(D); 5 @@ -2511,6 +2558,14 @@ gap> D := DigraphByAdjacencyMatrix([ gap> DigraphNrLoops(D); 3 +gap> D := CompleteDigraph(IsImmutableDigraph, 3); + +gap> DigraphHasLoops(D); +false +gap> HasDigraphHasLoops(D) and not DigraphHasLoops(D); +true +gap> DigraphNrLoops(D) = 0; +true # DIGRAPHS_UnbindVariables gap> Unbind(adj); diff --git a/tst/standard/cliques.tst b/tst/standard/cliques.tst index 510cbbcf0..199f721a2 100644 --- a/tst/standard/cliques.tst +++ b/tst/standard/cliques.tst @@ -507,7 +507,8 @@ gap> IsMutable(cliques) or ForAny(cliques, IsMutable); false # Test CliquesFinder on graphs with more than 512 vertices -gap> CliquesFinder(NullDigraph(513), fail, [], infinity, [], [], true, fail, true); +gap> CliquesFinder( +> NullDigraph(513), fail, [], infinity, [], [], true, fail, true); [ [ 1 ] ] gap> gr := DigraphSymmetricClosure(ChainDigraph(513)); @@ -601,15 +602,20 @@ ll automorphism if is not given, gap> DigraphsCliquesFinder(NullDigraph(2), fail, [], 4, [], [1], true, fail); Error, the 6th argument must be invaraint under , or the fu\ ll automorphism if is not given, -gap> DigraphsCliquesFinder(CompleteDigraph(2), fail, [], 4, [1, 2], [], true, fail); +gap> DigraphsCliquesFinder( +> CompleteDigraph(2), fail, [], 4, [1, 2], [], true, fail); [ [ 1, 2 ] ] -gap> DigraphsCliquesFinder(CompleteDigraph(2), fail, [], 4, [], [1, 2], true, fail); +gap> DigraphsCliquesFinder( +> CompleteDigraph(2), fail, [], 4, [], [1, 2], true, fail); [ ] -gap> DigraphsCliquesFinder(CompleteDigraph(2), fail, [], 4, [], [], true, 3); +gap> DigraphsCliquesFinder( +> CompleteDigraph(2), fail, [], 4, [], [], true, 3); [ ] -gap> DigraphsCliquesFinder(NullDigraph(2), fail, [], 4, [1, 2], [], true, fail); +gap> DigraphsCliquesFinder( +> NullDigraph(2), fail, [], 4, [1, 2], [], true, fail); [ ] -gap> DigraphsCliquesFinder(CompleteDigraph(2), fail, [], 4, [1, 2], [], true, 2); +gap> DigraphsCliquesFinder( +> CompleteDigraph(2), fail, [], 4, [1, 2], [], true, 2); [ [ 1, 2 ] ] gap> f := function(a, b) > Add(a, Size(b)); diff --git a/tst/standard/digraph.tst b/tst/standard/digraph.tst index 0f9e1e13e..3025ec891 100644 --- a/tst/standard/digraph.tst +++ b/tst/standard/digraph.tst @@ -40,11 +40,15 @@ gap> Digraph(rec(DigraphNrVertices := n, DigraphRange := r)); Error, the argument must be a record with components 'DigraphSource',\ 'DigraphRange', and either 'DigraphVertices' or 'DigraphNrVertices' (but not \ both), -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := s, DigraphVertices := v)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := s, +> DigraphVertices := v)); Error, the argument must be a record with components 'DigraphSource',\ 'DigraphRange', and either 'DigraphVertices' or 'DigraphNrVertices' (but not \ both), -gap> Digraph(rec(DigraphNrVertices := n, DigraphRange := r, DigraphVertices := v)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphRange := r, +> DigraphVertices := v)); Error, the argument must be a record with components 'DigraphSource',\ 'DigraphRange', and either 'DigraphVertices' or 'DigraphNrVertices' (but not \ both), @@ -52,41 +56,69 @@ gap> Digraph(rec(DigraphSource := s, DigraphRange := r)); Error, the argument must be a record with components 'DigraphSource',\ 'DigraphRange', and either 'DigraphVertices' or 'DigraphNrVertices' (but not \ both), -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := s, DigraphRange := 4)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := s, +> DigraphRange := 4)); Error, the record components 'DigraphSource' and 'DigraphRange' must be lists, -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := 1, DigraphRange := r)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := 1, +> DigraphRange := r)); Error, the record components 'DigraphSource' and 'DigraphRange' must be lists, -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := [1, 2], DigraphRange := r)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := [1, 2], +> DigraphRange := r)); Error, the record components 'DigraphSource' and 'DigraphRange' must have equa\ l length, -gap> Digraph(rec(DigraphNrVertices := "a", DigraphSource := s, DigraphRange := r)); +gap> Digraph(rec(DigraphNrVertices := "a", +> DigraphSource := s, +> DigraphRange := r)); Error, the record component 'DigraphNrVertices' must be a non-negative integer\ , -gap> Digraph(rec(DigraphNrVertices := -3, DigraphSource := s, DigraphRange := r)); +gap> Digraph(rec(DigraphNrVertices := -3, +> DigraphSource := s, +> DigraphRange := r)); Error, the record component 'DigraphNrVertices' must be a non-negative integer\ , -gap> Digraph( -> rec(DigraphNrVertices := 2, DigraphVertices := [1 .. 3], DigraphSource := [2], DigraphRange := [2])); +gap> Digraph(rec(DigraphNrVertices := 2, DigraphVertices := [1 .. 3], +> DigraphSource := [2], +> DigraphRange := [2])); Error, the record must only have one of the components 'DigraphVertices' and '\ DigraphNrVertices', not both, -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := [0 .. 2], DigraphRange := r)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := [0 .. 2], +> DigraphRange := r)); Error, the record component 'DigraphSource' is invalid, -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := [2 .. 4], DigraphRange := r)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := [2 .. 4], +> DigraphRange := r)); Error, the record component 'DigraphSource' is invalid, -gap> Digraph(rec(DigraphVertices := 2, DigraphSource := s, DigraphRange := r)); +gap> Digraph(rec(DigraphVertices := 2, +> DigraphSource := s, +> DigraphRange := r)); Error, the record component 'DigraphVertices' must be a list, -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := [1, 2, 4], DigraphRange := r)); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := [1, 2, 4], +> DigraphRange := r)); Error, the record component 'DigraphSource' is invalid, -gap> Digraph(rec(DigraphVertices := v, DigraphSource := [1, 2, 4], DigraphRange := r)); +gap> Digraph(rec(DigraphVertices := v, +> DigraphSource := [1, 2, 4], +> DigraphRange := r)); Error, the record component 'DigraphSource' is invalid, -gap> Digraph(rec(DigraphNrVertices := n, DigraphSource := s, DigraphRange := [1, 4, 2])); +gap> Digraph(rec(DigraphNrVertices := n, +> DigraphSource := s, +> DigraphRange := [1, 4, 2])); Error, the record component 'DigraphRange' is invalid, -gap> Digraph(rec(DigraphVertices := v, DigraphSource := s, DigraphRange := [1, 4, 2])); +gap> Digraph(rec(DigraphVertices := v, +> DigraphSource := s, +> DigraphRange := [1, 4, 2])); Error, the record component 'DigraphRange' is invalid, -gap> Digraph(rec(DigraphVertices := "abc", DigraphSource := "acbab", DigraphRange := "cbabb")); +gap> Digraph(rec(DigraphVertices := "abc", +> DigraphSource := "acbab", +> DigraphRange := "cbabb")); -gap> Digraph(rec( -> DigraphVertices := [1, 1, 2], DigraphSource := [1, 2], DigraphRange := [1, 2])); +gap> Digraph(rec(DigraphVertices := [1, 1, 2], +> DigraphSource := [1, 2], +> DigraphRange := [1, 2])); Error, the record component 'DigraphVertices' must be duplicate-free, # Digraph (by nrvertices, source, and range) @@ -340,8 +372,9 @@ gap> OutNeighbours(gr); [ 2, 4, 5, 5, 7, 10, 10, 10 ], [ 9 ], [ 1, 4, 6, 7, 9 ], [ 2, 3, 6, 6, 6, 6, 6, 7, 10 ], [ 3, 4, 4, 5, 8, 9 ], [ 3, 4, 8, 8, 9, 10 ], [ 1, 2, 2, 3, 3, 3, 5, 6, 9, 10 ], [ 2, 3, 3, 3, 4, 4, 4, 4, 5, 6, 9 ] ] -gap> r := rec(DigraphNrVertices := 10, DigraphSource := ShallowCopy(DigraphSource(gr)), -> DigraphRange := ShallowCopy(DigraphRange(gr)));; +gap> r := rec(DigraphNrVertices := 10, +> DigraphSource := ShallowCopy(DigraphSource(gr)), +> DigraphRange := ShallowCopy(DigraphRange(gr)));; gap> gr2 := Digraph(r); gap> HasAdjacencyMatrix(gr2); @@ -547,29 +580,38 @@ gap> RandomLattice(-1); Error, no method found! For debugging hints type ?Recovery from NoMethodFound Error, no 1st choice method found for `RandomLattice' on 1 arguments -# The list of random lattice Digraph6Strings D was generated by running the following command +# The list of random lattice Digraph6Strings D was generated by running: # D := List([1 .. 100], x -> Digraph6String(RandomLattice(7))); gap> D := [ -> "&F~grwcIB?_", "&G~tSrCO{D?oC", "&F~kqG{IB?_", "&J~}jSpw`O~_t?a?{?g?o?_", "&H~zzIWxAGH?wB?G", -> "&G~t[~DosD?oC", "&F~kqG{IB?_", "&H~z~IgrAGN?gB?G", "&I~|TR~DSKoP?{@OB?C", "&G~s[jFOcD?oC", -> "&G~sc~EocF?oC", "&G~tSrCO{D?oC", "&F~kqG{IB?_", "&F~kqG{IB?_", "&I~|nqTFKKoP?{@OB?C", -> "&I~|OrPCCNoP?{@OB?C", "&F~kqG{IB?_", "&G~tSrCO{D?oC", "&H~ynMWbAWN?gB?G", "&G~tSrCO{D?oC", -> "&I~|Sr~DKLOP?{@OB?C", "&F~hrgcIB?_", "&G~s[rCOsD?oC", "&G~tCtCO{D?oC", "&F~lQG{IB?_", -> "&F~hrgcIB?_", "&I~|DRrDKGOP?{@OB?C", "&F~jRWcIB?_", "&G~tSpCO{D?oC", "&F~mrGcMB?_", -> "&F~iRwcMB?_", "&F~lQG{IB?_", "&F~lQG{IB?_", "&H~yhKw`BwH?wB?G", "&I~|zqdEKGO^?{@OB?C", -> "&G~tSrCO{D?oC", "&G~tSrCO{D?oC", "&G~tSrCO{D?oC", "&F~kqG{IB?_", "&F~lQG{IB?_", "&G~skxCOcF?oC", -> "&J~}dCggoo__~?a?{?g?o?_", "&F~lQG{IB?_", "&G~usdEocD?oC", "&G~tSrCO{D?oC", "&H~ybLG`BWH?wB?G", -> "&F~irgcIB?_", "&I~|TRBCCNoT?{@OB?C", "&F~iqwcMB?_", "&H~yTHgxAGH?gB?G", "&F~nqg{IB?_", -> "&I~|PRRCCNoR?{@OB?C", "&F~lqWcMB?_", "&J~}lKhgoo__~?e?s?g?o?_", "&F~nqW{IB?_", "&G~tSrCO{D?oC", -> "&F~jrWkMB?_", "&G~vKpCO{D?oC", "&F~irgcIB?_", "&H~y~LwnAWN?gB?G", "&F~kqG{IB?_", -> "&I~|zqdEKGO^?{@OB?C", "&G~t{`EocF?oC", "&H~zNGW~AGN?wB?G", "&H~zNGW~AgN?gB?G", "&F~nQgsIB?_", -> "&F~hrwkMB?_", "&G~vkbEocF?oC", "&G~s{zCOkF?oC", "&F~grwkMB?_", "&G~tKtCO{D?oC", "&F~nqwsIB?_", -> "&J~}jKpw_o~_r?a?{?g?o?_", "&F~nqg{IB?_", "&G~s{~DO{D?oC", "&G~tSrCO{D?oC", -> "&K~~\\tGdCTBr@p?`?P?N?D?B?@", "&G~tSrCO{D?oC", "&H~zjKW`BwJ?gB?G", "&K~~PrG^FnAd@b?`?R?N?D?B?@", -> "&H~ydKW`AWN?gB?G", "&F~lQG{IB?_", "&G~tSrCO{D?oC", "&H~zNGg~AGN?gB?G", "&G~u[bFocF?oC", -> "&H~yrMwrAGN?wB?G", "&G~t{zEocF?oC", "&H~yhJw`BWH?wB?G", "&G~uk`FokF?oC", "&F~lqGcMB?_", -> "&F~kqG{IB?_", "&G~sC~EocF?oC", "&F~lQG{IB?_", "&G~s[~EocF?oC", "&G~tKpCO{D?oC", "&F~jrGcMB?_", -> "&I~|SrNCKNoR?{@OB?C", "&F~lQG{IB?_", "&F~irgcIB?_", "&F~kqG{IB?_"];; +> "&F~grwcIB?_", "&G~tSrCO{D?oC", "&F~kqG{IB?_", +> "&J~}jSpw`O~_t?a?{?g?o?_", "&H~zzIWxAGH?wB?G", "&G~t[~DosD?oC", +> "&F~kqG{IB?_", "&H~z~IgrAGN?gB?G", "&I~|TR~DSKoP?{@OB?C", +> "&G~s[jFOcD?oC", "&G~sc~EocF?oC", "&G~tSrCO{D?oC", "&F~kqG{IB?_", +> "&F~kqG{IB?_", "&I~|nqTFKKoP?{@OB?C", "&I~|OrPCCNoP?{@OB?C", +> "&F~kqG{IB?_", "&G~tSrCO{D?oC", "&H~ynMWbAWN?gB?G", "&G~tSrCO{D?oC", +> "&I~|Sr~DKLOP?{@OB?C", "&F~hrgcIB?_", "&G~s[rCOsD?oC", "&G~tCtCO{D?oC", +> "&F~lQG{IB?_", "&F~hrgcIB?_", "&I~|DRrDKGOP?{@OB?C", "&F~jRWcIB?_", +> "&G~tSpCO{D?oC", "&F~mrGcMB?_", "&F~iRwcMB?_", "&F~lQG{IB?_", +> "&F~lQG{IB?_", "&H~yhKw`BwH?wB?G", "&I~|zqdEKGO^?{@OB?C", +> "&G~tSrCO{D?oC", "&G~tSrCO{D?oC", "&G~tSrCO{D?oC", "&F~kqG{IB?_", +> "&F~lQG{IB?_", "&G~skxCOcF?oC", "&J~}dCggoo__~?a?{?g?o?_", +> "&F~lQG{IB?_", "&G~usdEocD?oC", "&G~tSrCO{D?oC", "&H~ybLG`BWH?wB?G", +> "&F~irgcIB?_", "&I~|TRBCCNoT?{@OB?C", "&F~iqwcMB?_", "&H~yTHgxAGH?gB?G", +> "&F~nqg{IB?_", "&I~|PRRCCNoR?{@OB?C", "&F~lqWcMB?_", +> "&J~}lKhgoo__~?e?s?g?o?_", "&F~nqW{IB?_", "&G~tSrCO{D?oC", +> "&F~jrWkMB?_", "&G~vKpCO{D?oC", "&F~irgcIB?_", "&H~y~LwnAWN?gB?G", +> "&F~kqG{IB?_", "&I~|zqdEKGO^?{@OB?C", "&G~t{`EocF?oC", +> "&H~zNGW~AGN?wB?G", "&H~zNGW~AgN?gB?G", "&F~nQgsIB?_", "&F~hrwkMB?_", +> "&G~vkbEocF?oC", "&G~s{zCOkF?oC", "&F~grwkMB?_", "&G~tKtCO{D?oC", +> "&F~nqwsIB?_", "&J~}jKpw_o~_r?a?{?g?o?_", "&F~nqg{IB?_", +> "&G~s{~DO{D?oC", "&G~tSrCO{D?oC", "&K~~\\tGdCTBr@p?`?P?N?D?B?@", +> "&G~tSrCO{D?oC", "&H~zjKW`BwJ?gB?G", "&K~~PrG^FnAd@b?`?R?N?D?B?@", +> "&H~ydKW`AWN?gB?G", "&F~lQG{IB?_", "&G~tSrCO{D?oC", "&H~zNGg~AGN?gB?G", +> "&G~u[bFocF?oC", "&H~yrMwrAGN?wB?G", "&G~t{zEocF?oC", +> "&H~yhJw`BWH?wB?G", "&G~uk`FokF?oC", "&F~lqGcMB?_", "&F~kqG{IB?_", +> "&G~sC~EocF?oC", "&F~lQG{IB?_", "&G~s[~EocF?oC", "&G~tKpCO{D?oC", +> "&F~jrGcMB?_", "&I~|SrNCKNoR?{@OB?C", "&F~lQG{IB?_", "&F~irgcIB?_", +> "&F~kqG{IB?_"];; gap> D := List(D, x -> DigraphFromDigraph6String(x));; gap> iso := [];; gap> iso_distr := [];; @@ -603,15 +645,16 @@ gap> for i in [1 .. Length(D)] do > od; # The total number of nonisomorphic digraphs generated, out of 100. -# It is known that there are 53 distinct lattices on 7 points according to OEIS A006966 +# There are 53 distinct lattices on 7 points according to OEIS A006966 gap> Length(iso); 41 -# The distribution of nonisomorhpic generated lattices. -# To the left is the number of times a particular lattice occurs among the randomly generated ones. -# To the right is how many distinct lattices have -# this number of occurences. -# So entry [3, 5] means that there were five distinct lattices each of which was generated 3 times. +# The distribution of nonisomorhpic generated lattices. +# To the left is the number of times a particular lattice occurs among the +# randomly generated ones. +# To the right is how many distinct lattices have # this number of occurrences. +# So entry [3, 5] means that there were five distinct lattices each of which was +# generated 3 times. gap> Display(Collected(iso_distr)); [ [ 1, 26 ], [ 2, 7 ], @@ -633,8 +676,12 @@ gap> Display(Collected(eq_distr)); [ 12, 1 ] ] # Equals (\=) for two digraphs -gap> r1 := rec(DigraphNrVertices := 2, DigraphSource := [1, 1, 2], DigraphRange := [1, 2, 2]);; -gap> r2 := rec(DigraphNrVertices := 2, DigraphSource := [1, 1, 2], DigraphRange := [2, 1, 2]);; +gap> r1 := rec(DigraphNrVertices := 2, +> DigraphSource := [1, 1, 2], +> DigraphRange := [1, 2, 2]);; +gap> r2 := rec(DigraphNrVertices := 2, +> DigraphSource := [1, 1, 2], +> DigraphRange := [2, 1, 2]);; gap> gr1 := Digraph(r1); gap> gr2 := Digraph(r2); @@ -659,7 +706,9 @@ gap> gr1 = gr2; false gap> gr1 := Digraph([[], [], []]); -gap> gr2 := Digraph(rec(DigraphNrVertices := 3, DigraphSource := [], DigraphRange := [])); +gap> gr2 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [], +> DigraphRange := [])); gap> gr1 = gr2; true @@ -705,8 +754,9 @@ gap> gr1 = gr5; true gap> graph1 := Digraph([[2], [1], []]); -gap> graph2 := Digraph(rec( -> DigraphNrVertices := 3, DigraphSource := [1, 2], DigraphRange := [2, 1])); +gap> graph2 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 2], +> DigraphRange := [2, 1])); gap> graph1 = graph2; true @@ -727,35 +777,43 @@ true gap> gr1 = gr1; true gap> gr1 := Digraph([[2], []]);; -gap> gr2 := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [], DigraphRange := []));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [], +> DigraphRange := []));; gap> gr1 = gr2; # Different number of vertices false -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 2, DigraphSource := [1, 2], DigraphRange := [1, 2]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1, 2], +> DigraphRange := [1, 2]));; gap> gr1 = gr2; # Different number of edges false -gap> EmptyDigraph(2) = -> Digraph(rec(DigraphNrVertices := 2, DigraphSource := [], DigraphRange := [])); # Both empty +gap> EmptyDigraph(2) = Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [], +> DigraphRange := [])); # Both empty true gap> gr1 := Digraph([[], [1, 2]]);; gap> gr1 = gr2; # |out1[1]| = 0, |out2[1]| <> = false gap> gr1 := Digraph([[1, 1], [2, 2]]);; -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 2, DigraphSource := [1, 2, 2, 2], DigraphRange := [1, 2, 2, 2]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1, 2, 2, 2], +> DigraphRange := [1, 2, 2, 2]));; gap> gr1 = gr2; # |out1[1]| = 2, |out2[1]| = 1 false -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 2, DigraphSource := [1, 1, 1, 2], DigraphRange := [1, 1, 1, 2]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1, 1, 1, 2], +> DigraphRange := [1, 1, 1, 2]));; gap> gr1 = gr2; # |out1[1]| = 2, |out2[1]| = 3 false gap> gr1 := Digraph([[1, 2], [2, 1]]);; -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 2, DigraphSource := [1, 1, 2, 2], DigraphRange := [1, 2, 2, 2]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1, 1, 2, 2], +> DigraphRange := [1, 2, 2, 2]));; gap> gr1 = gr2; # Different contents of out[2] false -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 2, DigraphSource := [1, 1, 2, 2], DigraphRange := [1, 2, 1, 2]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1, 1, 2, 2], +> DigraphRange := [1, 2, 1, 2]));; gap> gr1 = gr2; # out[2] sorted differently true gap> gr1 := Digraph( @@ -774,7 +832,9 @@ gap> r2 := > 10, 3, 9, 7, 6, 10, 9, 3, 5, 8, 4, 7, 1, 7, 4, 3, 8, 5, 10, 6, 9, 2, > 4, 8, 5, 9, 7, 1, 10, 6, 3, 2, 5, 8, 7, 10, 4, 9, 1, 5, 8, 3, 2, 1, 6, > 7, 10, 4, 4, 1, 5, 8, 3, 9, 7, 2, 6, 9, 6, 5, 7, 8, 10, 2, 3, 4];; -gap> gr2 := Digraph(rec(DigraphNrVertices := 10, DigraphSource := s, DigraphRange := r2));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 10, +> DigraphSource := s, +> DigraphRange := r2));; gap> gr1 = gr2; true gap> gr1 := Digraph([[2], []]);; @@ -786,8 +846,9 @@ gap> gr1 = gr2; # Different number of edges false gap> EmptyDigraph(2) = Digraph([[], []]); # Both empty digraphs true -gap> gr1 := Digraph(rec( -> DigraphNrVertices := 2, DigraphSource := [1, 2], DigraphRange := [1, 2]));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1, 2], +> DigraphRange := [1, 2]));; gap> OutNeighbours(gr1);; gap> gr1 = gr2; # Equal outneighbours true @@ -828,34 +889,48 @@ gap> gr1 := RandomDigraph(10, 0.264);; gap> gr2 := Digraph(List(ShallowCopy(OutNeighbours(gr1)), Reversed));; gap> gr1 = gr2; true -gap> gr1 := Digraph(rec(DigraphNrVertices := 0, DigraphSource := [], DigraphRange := []));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 0, +> DigraphSource := [], +> DigraphRange := []));; gap> gr1 = gr1; # IsIdenticalObj true -gap> gr2 := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [], DigraphRange := []));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [], +> DigraphRange := []));; gap> gr1 = gr2; # Different number of vertices false -gap> gr1 := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [1], DigraphRange := [1]));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [1], +> DigraphRange := [1]));; gap> gr1 = gr2; # Different sources false -gap> gr2 := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [1], DigraphRange := [1]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [1], +> DigraphRange := [1]));; gap> gr1 = gr2; # Equal range true -gap> gr1 := Digraph(rec( -> DigraphNrVertices := 3, DigraphSource := [1, 2, 2, 3, 3], DigraphRange := [1, 1, 2, 2, 3]));; -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 3, DigraphSource := [1, 2, 2, 3, 3], DigraphRange := [1, 2, 2, 3, 2]));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 2, 2, 3, 3], +> DigraphRange := [1, 1, 2, 2, 3]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 2, 2, 3, 3], +> DigraphRange := [1, 2, 2, 3, 2]));; gap> gr1 = gr2; # Different contents of out[2] false -gap> gr1 := Digraph(rec( -> DigraphNrVertices := 3, DigraphSource := [1, 2, 2, 3, 3], DigraphRange := [1, 1, 2, 2, 3]));; -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 3, DigraphSource := [1, 2, 2, 3, 3], DigraphRange := [1, 2, 1, 3, 3]));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 2, 2, 3, 3], +> DigraphRange := [1, 1, 2, 2, 3]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 2, 2, 3, 3], +> DigraphRange := [1, 2, 1, 3, 3]));; gap> gr1 = gr2; # Different contents of out[3] false -gap> gr1 := Digraph(rec( -> DigraphNrVertices := 3, DigraphSource := [1, 2, 2, 3, 3], DigraphRange := [1, 1, 2, 2, 3]));; -gap> gr2 := Digraph(rec( -> DigraphNrVertices := 3, DigraphSource := [1, 2, 2, 3, 3], DigraphRange := [1, 2, 1, 3, 2]));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 2, 2, 3, 3], +> DigraphRange := [1, 1, 2, 2, 3]));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 2, 2, 3, 3], +> DigraphRange := [1, 2, 1, 3, 2]));; gap> gr1 = gr2; # out[2] and out[3] sorted differently true gap> s := @@ -873,8 +948,12 @@ gap> r2 := > 10, 3, 9, 7, 6, 10, 9, 3, 5, 8, 4, 7, 1, 7, 4, 3, 8, 5, 10, 6, 9, 2, > 4, 8, 5, 9, 7, 1, 10, 6, 3, 2, 5, 8, 7, 10, 4, 9, 1, 5, 8, 3, 2, 1, 6, > 7, 10, 4, 4, 1, 5, 8, 3, 9, 7, 2, 6, 9, 6, 5, 7, 8, 10, 2, 3, 4];; -gap> gr1 := Digraph(rec(DigraphNrVertices := 10, DigraphSource := s, DigraphRange := r1));; -gap> gr2 := Digraph(rec(DigraphNrVertices := 10, DigraphSource := s, DigraphRange := r2));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 10, +> DigraphSource := s, +> DigraphRange := r1));; +gap> gr2 := Digraph(rec(DigraphNrVertices := 10, +> DigraphSource := s, +> DigraphRange := r2));; gap> gr1 = gr2; true @@ -1057,7 +1136,8 @@ gap> SetDigraphVertexLabel(gr, 1, "w"); gap> DigraphVertexLabels(DigraphCopy(gr))[1]; "w" gap> gr := Digraph(rec(DigraphVertices := ["a", Group((1, 2))], -> DigraphSource := [Group((1, 2))], DigraphRange := ["a"])); +> DigraphSource := [Group((1, 2))], +> DigraphRange := ["a"])); gap> DigraphVertexLabels(gr); [ "a", Group([ (1,2) ]) ] @@ -1154,6 +1234,12 @@ gap> gr2 := DigraphAddAllLoops(gr); gap> OutNeighbours(gr2); [ [ 1, 2, 3 ], [ 2, 2, 2, 2 ], [ 5, 1, 3 ], [ 1, 2, 3, 4 ], [ 5 ] ] +gap> D := Digraph(IsImmutableDigraph, +> [[1, 3], [2, 1, 5], [3, 4], [2, 3, 4], [5, 1]]);; +gap> IsReflexiveDigraph(D); +true +gap> IsIdenticalObj(D, DigraphAddAllLoops(D)); +true # ConvertToImmutableDigraphNC gap> record := rec(OutNeighbours := [[1, 2], []]); @@ -1490,14 +1576,22 @@ e number of edges in the reflexive transitive reduction of the second argument\ , where [i, j] is an edge in the reflex transitive reduction and hom is a grou\ p homomorphism from group i to group j, gap> T := AsSemigroup(IsPartialPermSemigroup, gr4, [G1, G2, G3, G4, G5], -> [[-2, 1, hom21], [3, 1, hom31], [4, 1, hom41], [5, 2, hom52], [5, 3, hom53]]);; +> [[-2, 1, hom21], +> [3, 1, hom31], +> [4, 1, hom41], +> [5, 2, hom52], +> [5, 3, hom53]]);; Error, Digraphs: AsSemigroup usage, the third argument must be a list of triples [i, j, hom] of length equal to th\ e number of edges in the reflexive transitive reduction of the second argument\ , where [i, j] is an edge in the reflex transitive reduction and hom is a grou\ p homomorphism from group i to group j, gap> T := AsSemigroup(IsPartialPermSemigroup, gr4, [G1, G2, G3, G4, G5], -> [[2, -1, hom21], [3, 1, hom31], [4, 1, hom41], [5, 2, hom52], [5, 3, hom53]]);; +> [[2, -1, hom21], +> [3, 1, hom31], +> [4, 1, hom41], +> [5, 2, hom52], +> [5, 3, hom53]]);; Error, Digraphs: AsSemigroup usage, the third argument must be a list of triples [i, j, hom] of length equal to th\ e number of edges in the reflexive transitive reduction of the second argument\ diff --git a/tst/standard/display.tst b/tst/standard/display.tst index 3a8b6063c..1418e67e0 100644 --- a/tst/standard/display.tst +++ b/tst/standard/display.tst @@ -55,8 +55,10 @@ gap> dot{[1 .. 50]}; gap> dot{[51 .. 75]}; "1\n1 -> 2\n1 -> 2\n1 -> 3\n}\n" gap> r := rec(DigraphVertices := [1 .. 8], -> DigraphSource := [1, 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 8, 8], -> DigraphRange := [6, 7, 1, 6, 5, 1, 4, 8, 1, 3, 6, 6, 7, 7, 1, 4, 4, 5, 7, 5, 6]);; +> DigraphSource := [1, 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 8, +> 8], +> DigraphRange := [6, 7, 1, 6, 5, 1, 4, 8, 1, 3, 6, 6, 7, 7, 1, 4, 4, 5, 7, 5, +> 6]);; gap> gr1 := Digraph(r); gap> DotDigraph(gr1){[50 .. 109]}; @@ -518,7 +520,9 @@ gap> Print(DotPreorderDigraph(gr){[1 .. 94]}, "\n"); digraph graphname { node [shape=Mrecord, height=0.5, fixedsize=true]ranksep=1; 1 [label= -gap> gr := DigraphDisjointUnion(CompleteDigraph(10), CompleteDigraph(5), CycleDigraph(2));; +gap> gr := DigraphDisjointUnion(CompleteDigraph(10), +> CompleteDigraph(5), +> CycleDigraph(2));; gap> gr := DigraphReflexiveTransitiveClosure(DigraphAddEdge(gr, [10, 11]));; gap> IsPreorderDigraph(gr); true diff --git a/tst/standard/grahom.tst b/tst/standard/grahom.tst index 589c63ad2..d4df58083 100644 --- a/tst/standard/grahom.tst +++ b/tst/standard/grahom.tst @@ -1099,21 +1099,22 @@ fail gap> DigraphEmbedding(gr1, gr1); IdentityTransformation gap> D := NullDigraph(2);; -gap> DD := DigraphFromDiSparse6String( -> ".~?C?_W@GN?e??@`W?wJ`cAG^?EG_@AEH?CacDWj@M??ga{Igq?WG_gbO?_J?}L_I_IFG~@?G_u_A\ -> AhBAiPOD`IB_QCEOxAck@HNB}KpK_KMhSBQ?`Hd[L?z`CIxY?}VOU`OGGteCVxHbcNXBd}JxO_uYo|\ -> bwVxmBiXxqEy\\ODf[SwOfwL`tgCOpncU`p~`e[WcA_JxYgsD@dg{Bpu`[bYRAc]hoHAd_BDIe@`hg\ -> Boed{ZwiaGOxFCs]HyeQ]XAbYL`}fmhogCSaYhEyTaR_?JAIdOYaTiwD@EEm@hFFObiqBSiYs@CQPK\ -> EaQWHBAMW]`Whw\\IIC?hAgPIKJQ[qjaciiTeYSP\\IWiXk_s[@pf?^BBa?SpkfiUwBAGRH[ck_zL@\ -> oJZNKq?PCGknHi_wciolS@O\\IuaGJLANx]LQD_]bW]J\\@_QPxK?uG@m?I_tCcnrDLMD@XKQLQ[b[\ -> cqX_?QA[e{]qlislBXjmGozLyXYTMQUQP_grj?aSkz^f{qrTiiQAtgWsrUhYXb@jsorreWbRCNAA_b\ -> IqSwxL}CQ_I_zru`sK@]GShrQNIziUes^K?`c?gSa?CGEaKDghAYEGkAmL_bbg@WHAyGHB?YPobcg@\ -> gHAuR_TdC?`D_KGhUAONxY@IVOC@IVpUDqVGkeKDW[B?KXf@MJGXdySg[e{YgfEiL`CCwSPUfKVpm`\ -> sH?ef[NgECY^?XfwB@u`SNiAEE[WD@uOiGCOSII@Y`Hk_W[yNDmGIQ?O\\iOeId_\\daCwOCgWGW@w\ -> Sp_hobyOb_]y_A{OpLhIJaO`wTydAOdhugQiPaikN@GIa\\HBGmJaIj?Xw@A?ZhC`ElOHj[@HsjgRA\ -> THqG@AF}PpJHyoQtkKM`bGenigk[oWNIokHH_{LaugGlbG_sJGZEkhWMA[gGPFusOcKEsoyEqtP~aG\ -> MPll_T`iKuBOWgIArIdAG@C`{PGGb]^Zb?ehwnKewWiLWwhPmUBjemsgGvIu{@RLIDrB`i{IQM]bBq\ -> cKyWLFcnzxKICIyKyEgI@g{XDeGbN");; +gap> DD := DigraphFromDiSparse6String(Concatenation( +> ".~?C?_W@GN?e??@`W?wJ`cAG^?EG_@AEH?CacDWj@M??ga{Igq?WG_gbO?_J?}L_I_IFG~@?", +> "G_u_AAhBAiPOD`IB_QCEOxAck@HNB}KpK_KMhSBQ?`Hd[L?z`CIxY?}VOU`OGGteCVxHbcNXB", +> "d}JxO_uYo|bwVxmBiXxqEy\\ODf[SwOfwL`tgCOpncU`p~`e[WcA_JxYgsD@dg{Bpu`[bYRAc", +> "]hoHAd_BDIe@`hgBoed{ZwiaGOxFCs]HyeQ]XAbYL`}fmhogCSaYhEyTaR_?JAIdOYaTiwD@E", +> "Em@hFFObiqBSiYs@CQPKEaQWHBAMW]`Whw\\IIC?hAgPIKJQ[qjaciiTeYSP\\IWiXk_s[@pf", +> "?^BBa?SpkfiUwBAGRH[ck_zL@oJZNKq?PCGknHi_wciolS@O\\IuaGJLANx]LQD_]bW]J\\@_", +> "QPxK?uG@m?I_tCcnrDLMD@XKQLQ[b[cqX_?QA[e{]qlislBXjmGozLyXYTMQUQP_grj?aSkz^", +> "f{qrTiiQAtgWsrUhYXb@jsorreWbRCNAA_bIqSwxL}CQ_I_zru`sK@]GShrQNIziUes^K?`c?", +> "gSa?CGEaKDghAYEGkAmL_bbg@WHAyGHB?YPobcg@gHAuR_TdC?`D_KGhUAONxY@IVOC@IVpUD", +> "qVGkeKDW[B?KXf@MJGXdySg[e{YgfEiL`CCwSPUfKVpm`sH?ef[NgECY^?XfwB@u`SNiAEE[W", +> "D@uOiGCOSII@Y`Hk_W[yNDmGIQ?O\\iOeId_\\daCwOCgWGW@wSp_hobyOb_]y_A{OpLhIJaO", +> "`wTydAOdhugQiPaikN@GIa\\HBGmJaIj?Xw@A?ZhC`ElOHj[@HsjgRATHqG@AF}PpJHyoQtkK", +> "M`bGenigk[oWNIokHH_{LaugGlbG_sJGZEkhWMA[gGPFusOcKEsoyEqtP~aGMPll_T`iKuBOW", +> "gIArIdAG@C`{PGGb]^Zb?ehwnKewWiLWwhPmUBjemsgGvIu{@RLIDrB`i{IQM]bBqcKyWLFcn", +> "zxKICIyKyEgI@g{XDeGbN"));; gap> DigraphEmbedding(D, DD); IdentityTransformation gap> D := DigraphDisjointUnion(CycleDigraph(3), CycleDigraph(5));; @@ -1571,10 +1572,10 @@ gap> EmbeddingsDigraphsRepresentatives(NullDigraph(2), # gap> D1 := NullDigraph(2);; -gap> D2 := DigraphFromDiSparse6String( -> ".~?@c_oAN?xSA_XcBf?q^?YK?iooXja]oBJGlgZ_CLzgQoAn?kWjDIK[?P[c_qpNLM{{KFRMns`Wm\ -> tSNCuT^Z?a[rvOeCCdvGixXG`ZFc__AF?hKMg?IaGH]gGIAm?z?_lpGdmRUzMYQmoASkoKS]prafo[\ -> wws?[R_AcjsseVtaiXLcvXSwg`v@gfKBQ^KJc|n]D\\thb");; +gap> D2 := DigraphFromDiSparse6String(Concatenation( +> ".~?@c_oAN?xSA_XcBf?q^?YK?iooXja]oBJGlgZ_CLzgQoAn?kWjDIK[?P[c_qpNLM{", +> "{KFRMns`WmtSNCuT^Z?a[rvOeCCdvGixXG`ZFc__AF?hKMg?IaGH]gGIAm?z?_lpGdmR", +> "UzMYQmoASkoKS]prafo[wws?[R_AcjsseVtaiXLcvXSwg`v@gfKBQ^KJc|n]D\\thb"));; gap> DigraphMonomorphism(D1, D2); IdentityTransformation gap> D1 := CompleteDigraph(2);; @@ -2287,9 +2288,11 @@ gap> gr1 := ChainDigraph(3); gap> gr2 := ChainDigraph(6); -gap> IsDigraphHomomorphism(gr1, gr2, Transformation([1, 2, 3]), [1 .. 3], [1 .. 6]); +gap> IsDigraphHomomorphism(gr1, gr2, Transformation([1, 2, 3]), +> [1 .. 3], [1 .. 6]); true -gap> IsDigraphHomomorphism(gr1, gr2, Transformation([1, 2, 3]), [1 .. 3], [1, 1, 2, 3, 4, 5]); +gap> IsDigraphHomomorphism(gr1, gr2, Transformation([1, 2, 3]), +> [1 .. 3], [1, 1, 2, 3, 4, 5]); false gap> IsDigraphHomomorphism(gr1, gr2, Transformation([1, 2, 3]), > [2, 2, 1], [2, 2, 1, 3, 4, 5]); @@ -2375,9 +2378,11 @@ gap> src := Digraph([[1], [1, 2], [1, 3]]); gap> ran := Digraph([[1], [1, 2]]); -gap> IsDigraphEpimorphism(src, ran, Transformation([1, 2, 2]), [1, 2, 2], [1, 2]); +gap> IsDigraphEpimorphism(src, ran, Transformation([1, 2, 2]), +> [1, 2, 2], [1, 2]); true -gap> IsDigraphEpimorphism(src, ran, Transformation([1, 2, 2]), [1, 2, 3], [1, 2]); +gap> IsDigraphEpimorphism(src, ran, Transformation([1, 2, 2]), +> [1, 2, 3], [1, 2]); false gap> IsDigraphEpimorphism(src, src, Transformation([1, 2, 3]), > [1, 1, 2], [1, 1, 2]); diff --git a/tst/standard/io.tst b/tst/standard/io.tst index 4f39d59a8..4a5601ef2 100644 --- a/tst/standard/io.tst +++ b/tst/standard/io.tst @@ -106,8 +106,9 @@ gap> str := Sparse6String(gr); ":~?Bf_O?_F" gap> DigraphFromSparse6String(str); -gap> gr := Digraph(rec(DigraphNrVertices := 2 ^ 17, DigraphSource := [1, 1, 3, 4, 10, 100], -> DigraphRange := [3, 4, 1, 1, 100, 10])); +gap> gr := Digraph(rec(DigraphNrVertices := 2 ^ 17, +> DigraphSource := [1, 1, 3, 4, 10, 100], +> DigraphRange := [3, 4, 1, 1, 100, 10])); gap> str := Sparse6String(gr); ":~_??_?A???_??_@b??H" @@ -140,14 +141,16 @@ gap> str := DiSparse6String(gr); ".CgXoHe@J" gap> DigraphFromDiSparse6String(str) = gr; true -gap> gr := Digraph(rec(DigraphNrVertices := 1617, DigraphSource := [1 .. 100], -> DigraphRange := Concatenation([1 .. 50], [1 .. 50] * 0 + 51))); +gap> gr := Digraph(rec(DigraphNrVertices := 1617, +> DigraphSource := [1 .. 100], +> DigraphRange := Concatenation([1 .. 50], [1 .. 50] * 0 + 51))); gap> str := DiSparse6String(gr);; gap> DigraphFromDiSparse6String(str) = gr; true -gap> gr := Digraph(rec(DigraphNrVertices := 2 ^ 17, DigraphSource := [1 .. 100], -> DigraphRange := Concatenation([50 .. 98], [-1050 .. -1000] * -1))); +gap> gr := Digraph(rec(DigraphNrVertices := 2 ^ 17, +> DigraphSource := [1 .. 100], +> DigraphRange := Concatenation([50 .. 98], [-1050 .. -1000] * -1))); gap> str := DiSparse6String(gr);; gap> DigraphFromDiSparse6String(str) = gr; @@ -158,8 +161,9 @@ gap> str := DiSparse6String(gr); ".CgXo?eWCn" gap> gr = DigraphFromDiSparse6String(str); true -gap> gr := Digraph(rec(DigraphNrVertices := 7890, DigraphSource := [1 .. 100] * 0 + 1000, -> DigraphRange := [1 .. 100] * 0 + 2000)); +gap> gr := Digraph(rec(DigraphNrVertices := 7890, +> DigraphSource := [1 .. 100] * 0 + 1000, +> DigraphRange := [1 .. 100] * 0 + 2000)); gap> str := DiSparse6String(gr);; gap> gr = DigraphFromDiSparse6String(str); @@ -186,8 +190,9 @@ gap> ReadDigraphs(filename); , ] gap> gr[1] := Digraph([[5], [1, 2, 5], [1], [2], [4]]);; -gap> gr[2] := Digraph(rec(DigraphNrVertices := 105, DigraphSource := [1 .. 100], -> DigraphRange := [1 .. 100] * 0 + 52));; +gap> gr[2] := Digraph(rec(DigraphNrVertices := 105, +> DigraphSource := [1 .. 100], +> DigraphRange := [1 .. 100] * 0 + 52));; gap> gr[3] := EmptyDigraph(0);; gap> gr[4] := Digraph([[6, 7], [6, 9], [1, 3, 4, 5, 8, 9], > [1, 2, 3, 4, 5, 6, 7, 10], [1, 5, 6, 7, 10], [2, 4, 5, 9, 10], @@ -208,8 +213,9 @@ IO_OK gap> gr[1] := Digraph([[5], [1, 2, 5], [1], [2], [4]]);; gap> DigraphGroup(gr[1]); Group(()) -gap> gr[2] := Digraph(rec(DigraphNrVertices := 105, DigraphSource := [1 .. 100], -> DigraphRange := [1 .. 100] * 0 + 52));; +gap> gr[2] := Digraph(rec(DigraphNrVertices := 105, +> DigraphSource := [1 .. 100], +> DigraphRange := [1 .. 100] * 0 + 52));; gap> gr[3] := EmptyDigraph(0);; gap> gr[4] := Digraph([[6, 7], [6, 9], [1, 3, 4, 5, 8, 9], > [1, 2, 3, 4, 5, 6, 7, 10], [1, 5, 6, 7, 10], [2, 4, 5, 9, 10], diff --git a/tst/standard/oper.tst b/tst/standard/oper.tst index 6f7a4bcfe..2fc952cab 100644 --- a/tst/standard/oper.tst +++ b/tst/standard/oper.tst @@ -335,8 +335,10 @@ Error, the 2nd argument is not a valid partition of the vertices [\ 1 .. 3] of the 1st argument , gap> gr := Digraph(rec( > DigraphNrVertices := 8, -> DigraphSource := [1, 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 8, 8], -> DigraphRange := [6, 7, 1, 6, 5, 1, 4, 8, 1, 3, 4, 6, 7, 7, 1, 4, 5, 6, 7, 5, 6])); +> DigraphSource := [1, 1, 2, 2, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 7, 7, 7, 7, 7, 8, +> 8], +> DigraphRange := [6, 7, 1, 6, 5, 1, 4, 8, 1, 3, 4, 6, 7, 7, 1, 4, 5, 6, 7, 5, +> 6])); gap> qr := QuotientDigraph(gr, [[1], [2, 3, 5, 7], [4, 6, 8]]); @@ -354,8 +356,9 @@ gap> DigraphOutEdges(gr, 5); Error, the 2nd argument is not a vertex of the 1st argument , gap> DigraphInEdges(gr, 1000); Error, the 2nd argument is not a vertex of the 1st argument , -gap> gr := Digraph(rec(DigraphVertices := ["a", "b", "c"], DigraphSource := ["a", "a", "b"], -> DigraphRange := ["b", "b", "c"])); +gap> gr := Digraph(rec(DigraphVertices := ["a", "b", "c"], +> DigraphSource := ["a", "a", "b"], +> DigraphRange := ["b", "b", "c"])); gap> DigraphInEdges(gr, 1); [ ] @@ -427,7 +430,9 @@ gap> IsDigraphEdge(gr, [1000, 1]); true gap> IsDigraphEdge(gr, [1000, 600]); false -gap> gr := Digraph(rec(DigraphNrVertices := 2, DigraphSource := [1], DigraphRange := [2])); +gap> gr := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1], +> DigraphRange := [2])); gap> IsDigraphEdge(gr, [2, 1]); false @@ -593,7 +598,9 @@ gap> gr2 := DigraphAddVertices(gr, [SymmetricGroup(2), Group(())]); gap> DigraphVertexLabels(gr2); [ Alt( [ 1 .. 5 ] ), Sym( [ 1 .. 2 ] ), Group(()) ] -gap> gr := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [1], DigraphRange := [1])); +gap> gr := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [1], +> DigraphRange := [1])); gap> gr2 := DigraphAddVertices(gr, 2); @@ -604,12 +611,16 @@ gap> gr2 := DigraphAddVertices(gr, 2); gap> DigraphVertexLabels(gr2); [ true, 2, 3 ] -gap> gr := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [1], DigraphRange := [1]));; +gap> gr := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [1], +> DigraphRange := [1]));; gap> gr2 := DigraphAddVertices(gr, [SymmetricGroup(2), Group(())]); gap> DigraphVertexLabels(gr2); [ 1, Sym( [ 1 .. 2 ] ), Group(()) ] -gap> gr := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [1], DigraphRange := [1]));; +gap> gr := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [1], +> DigraphRange := [1]));; gap> SetDigraphVertexLabels(gr, [AlternatingGroup(5)]); gap> gr2 := DigraphAddVertices(gr, [SymmetricGroup(2), Group(())]); @@ -1841,7 +1852,8 @@ gap> D; # DigraphAddAllLoops - mutable -gap> D := Digraph(IsMutableDigraph, [[1], [3, 4], [5, 6], [4, 2, 3], [4, 5], [1]]); +gap> D := Digraph(IsMutableDigraph, +> [[1], [3, 4], [5, 6], [4, 2, 3], [4, 5], [1]]); gap> DigraphAddAllLoops(D); @@ -2001,7 +2013,8 @@ gap> DigraphCartesianProduct(D, D, D); gap> D := DigraphMutableCopy(CycleDigraph(3)); -gap> DigraphCartesianProduct(D, CycleDigraph(3), CycleDigraph(3), CycleDigraph(3)); +gap> DigraphCartesianProduct( +> D, CycleDigraph(3), CycleDigraph(3), CycleDigraph(3)); gap> D := DigraphCartesianProduct(ChainDigraph(3), CycleDigraph(3)); diff --git a/tst/standard/prop.tst b/tst/standard/prop.tst index ed32254ee..2acc186d3 100644 --- a/tst/standard/prop.tst +++ b/tst/standard/prop.tst @@ -51,14 +51,18 @@ gap> IsMultiDigraph(gr2); false gap> source := [1 .. 10000];; gap> range := List(source, x -> Random(source));; -gap> r := rec (DigraphVertices := [1 .. 10000], DigraphSource := source, DigraphRange := range);; +gap> r := rec (DigraphVertices := [1 .. 10000], +> DigraphSource := source, +> DigraphRange := range);; gap> gr3 := Digraph(r); gap> IsMultiDigraph(gr3); false gap> Add(source, 10000);; gap> Add(range, range[10000]);; -gap> r := rec(DigraphVertices := [1 .. 10000], DigraphSource := source, DigraphRange := range);; +gap> r := rec(DigraphVertices := [1 .. 10000], +> DigraphSource := source, +> DigraphRange := range);; gap> gr4 := Digraph(r); gap> IsMultiDigraph(gr4); @@ -75,14 +79,18 @@ gap> IsMultiDigraph(loop); false gap> IsAcyclicDigraph(loop); false -gap> r := rec(DigraphVertices := [1, 2], DigraphSource := [1, 1], DigraphRange := [2, 2]);; +gap> r := rec(DigraphVertices := [1, 2], +> DigraphSource := [1, 1], +> DigraphRange := [2, 2]);; gap> multiple := Digraph(r); gap> IsMultiDigraph(multiple); true gap> IsAcyclicDigraph(multiple); true -gap> r := rec(DigraphVertices := [1 .. 100], DigraphSource := [], DigraphRange := []);; +gap> r := rec(DigraphVertices := [1 .. 100], +> DigraphSource := [], +> DigraphRange := []);; gap> for i in [1 .. 100] do > for j in [1 .. 100] do > Add(r.DigraphSource, i); @@ -95,7 +103,9 @@ gap> IsMultiDigraph(complete100); false gap> IsAcyclicDigraph(complete100); false -gap> r := rec(DigraphVertices := [1 .. 20000], DigraphSource := [], DigraphRange := []);; +gap> r := rec(DigraphVertices := [1 .. 20000], +> DigraphSource := [], +> DigraphRange := []);; gap> for i in [1 .. 9999] do > Add(r.DigraphSource, i); > Add(r.DigraphRange, i + 1); @@ -234,8 +244,9 @@ gap> g6 := Digraph([[1, 2, 4], [1, 3], [2, 3, 4], [3, 1]]); gap> IsSymmetricDigraph(g6); true -gap> gr := Digraph(rec(DigraphNrVertices := 3, DigraphSource := [1, 1, 2, 2, 2, 2, 3, 3], -> DigraphRange := [2, 2, 1, 1, 3, 3, 2, 2]));; +gap> gr := Digraph(rec(DigraphNrVertices := 3, +> DigraphSource := [1, 1, 2, 2, 2, 2, 3, 3], +> DigraphRange := [2, 2, 1, 1, 3, 3, 2, 2]));; gap> IsSymmetricDigraph(gr); true gap> D := Digraph([[2], [3], [2]]);; @@ -265,10 +276,12 @@ false # IsAntisymmetricDigraph gap> gr := Digraph(rec(DigraphNrVertices := 10, -> DigraphSource := [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, -> 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10], -> DigraphRange := [2, 4, 6, 10, 3, 5, 7, 4, 7, 1, 9, 10, 4, 6, 9, 8, 4, 3, 7, 1, 6, -> 8, 2, 3, 9, 7, 10, 9, 4, 1, 8, 9, 3, 1, 4, 2, 5, 2, 1, 10, 5, 6, 2, 4, 8])); +> DigraphSource := [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, +> 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, +> 9, 9, 10, 10, 10, 10, 10], +> DigraphRange := [2, 4, 6, 10, 3, 5, 7, 4, 7, 1, 9, 10, 4, 6, 9, 8, 4, 3, 7, +> 1, 6, 8, 2, 3, 9, 7, 10, 9, 4, 1, 8, 9, 3, 1, 4, 2, 5, 2, +> 1, 10, 5, 6, 2, 4, 8])); gap> IsAntisymmetricDigraph(gr); true @@ -298,11 +311,14 @@ gap> IsAntisymmetricDigraph(gr); false # IsEmptyDigraph -gap> gr1 := Digraph(rec(DigraphNrVertices := 5, DigraphSource := [], DigraphRange := []));; +gap> gr1 := Digraph(rec(DigraphNrVertices := 5, +> DigraphSource := [], +> DigraphRange := []));; gap> IsEmptyDigraph(gr1); true -gap> gr2 := -> Digraph(rec(DigraphVertices := [1 .. 6], DigraphSource := [6], DigraphRange := [1]));; +gap> gr2 := Digraph(rec(DigraphVertices := [1 .. 6], +> DigraphSource := [6], +> DigraphRange := [1]));; gap> IsEmptyDigraph(gr2); false gap> gr3 := DigraphNC([[], [], [], []]);; @@ -321,8 +337,9 @@ gap> IsEmptyDigraph(gr6); false # IsTournament -gap> gr := Digraph(rec( -> DigraphNrVertices := 2, DigraphSource := [1, 1], DigraphRange := [2, 2])); +gap> gr := Digraph(rec(DigraphNrVertices := 2, +> DigraphSource := [1, 1], +> DigraphRange := [2, 2])); gap> IsTournament(gr); false @@ -562,15 +579,21 @@ gap> gr := Digraph([[6, 7], [6, 9], [1, 2, 4, 5, 8, 9], gap> DigraphHasLoops(gr); false -gap> gr := Digraph(rec(DigraphNrVertices := 0, DigraphSource := [], DigraphRange := [])); +gap> gr := Digraph(rec(DigraphNrVertices := 0, +> DigraphSource := [], +> DigraphRange := [])); gap> DigraphHasLoops(gr); false -gap> gr := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [], DigraphRange := [])); +gap> gr := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [], +> DigraphRange := [])); gap> DigraphHasLoops(gr); false -gap> gr := Digraph(rec(DigraphNrVertices := 1, DigraphSource := [1], DigraphRange := [1])); +gap> gr := Digraph(rec(DigraphNrVertices := 1, +> DigraphSource := [1], +> DigraphRange := [1])); gap> DigraphHasLoops(gr); true @@ -579,8 +602,8 @@ gap> r := rec(DigraphNrVertices := 10, > [1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, > 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, > 10, 10], -> DigraphRange := [6, 7, 6, 9, 1, 2, 4, 5, 8, 9, 1, 2, 3, 4, 5, 6, 7, 10, 1, 5, 6, -> 7, 10, 2, 4, 5, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 1, 3, 5, 7, 8, 9, 1, 2, 5, +> DigraphRange := [6, 7, 6, 9, 1, 2, 4, 5, 8, 9, 1, 2, 3, 4, 5, 6, 7, 10, 1, 5, +> 6, 7, 10, 2, 4, 5, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 1, 3, 5, 7, 8, 9, 1, 2, 5, > 1, 2, 4, 6, 7, 8]);; gap> gr := Digraph(r); @@ -1196,27 +1219,29 @@ true # Big partial order digraph gap> gr := DigraphFromDiSparse6String(Concatenation( -> ".~?CI_A?WA_M@G@_G@gB?]@?G_SAWA?Y@oJ__BGH?uA_M_IAoO_oCWL@IB_R_{DGB?mB?U_sDwM@", -> "aBoX_KCGP@WEwQ@[FGR@_FWS@cFgT@gFwB@A?oO_KCGZACGwZAGGw[AUFOcAYF_f`{IG_Ae@?U`[", -> "IwWAqEOl`gJgC@mF?jBAFOkBEF_lBIFomBMG?nBQ@?ZAE@?ZAI@?ZAMH?oBWMGdB?LowaWKOya[K", -> "_xBmI?rBqIOsBuI_tBy@?`AMH?uCA@?aaOHOuB[OgCAIHOvCQ@?baOM@?CYMP@C]HOwCYMOyCKPp", -> "HbgPPHbkQw{CgRG|C_RW}CyNpN_SIwkDEJPQawSwnDQ@OobCSPUbGS`VbKSpWbOT@XbSTPY_SK?u", -> "_SK?v_SK?wbcT`[DyM`UDsVgzD[WG{D_Vp`bsUPabwU`bb{Upc_SL`?bcOP[EY@OvCIMOyCKV@\\", -> "Ea@OvCQM`DDsYgDB_PgxC[V`kc_VpfEuM`HDwZHID{W@hEsZxJE?YpncoWPpcsW`oFIR`bEw[xNE", -> "O\\HOES\\WDC?Ph@C[X`vc_Xpw_SOhBEWY@yc_Q`fEc]wDCQH@DE_Y`|cgQphEk^gDCQPPiGAQpj", -> "GE@PEc[Z@vGMQ@lF_`HmFc`XHEo_xIEsZqCG]Z`oFo`QGckZqFf?[P~G_ahpGGahqGq[qJGu\\AH", -> "Gy\\QEG}\\aO_G@gF@?cgGAKcwHCWdGIGKdWA_KCAV`CeGQACeWRAOegSC[ewTGOfG`AGeGBH]Ga", -> "WH}@?bHaH?dC?Oa]IEHQ_IEHaba[gaca_OQdacQAeag`QfcCOqa_OeA^aCO`CI?ihBCSgabIm@A^", -> "cOgAlcSgqm_SPa`c[QPvFggaoc_Q`wFkiQpccgqocgQqkJCkxJI{kxKJURQsJYRaqJ]RpxJaSAEJ", -> "e?qQaGcqzaSdA{ccdQ|g[da}hcigQCGoHBHkoXIHooiGHsoy^i?ialKU@Q`IiH@yFsgqjK]grEK]", -> "hBHa[oRGKiI@zISobJfohrKgciBL_OmxCJorxDJssHJJwsYIJ{sgDIgjZ?LQC`|LU^aZKCth~KKt", -> "yJKOuGDK}_BOLi_RPLm_bQLqbBRLu@gPHKvweJswHKLGwYLLwwgDIuCaVMAHqZH{wRdcsjRBMGxi", -> "MLcwrcM]GP|G?jbELQ_AmMQjRDkWtBcMmxBja_fa_KSxhMI[iqmKWxrjMybrMM_yRiMozRncC]p}", -> "IoqH}GCganMeOamKYOqnK_qRhNMjbEMmO`|MgzBtmgzRti{qRkNUyzkMs|Rxms}XNIcjAnM{{rtN", -> "e_QnMg|YOJg{BpNG|BuN[}ByNk~B|fc^Aqfo^qqJO{XzNG|H~GGlAtNG|H}K_|bwNu^RvNi_atN_", -> "~ZvN_}b|n[}bznmcR}N|?C@OH?sCOT@cFObAiQ@ECgR`QDWaaSOgea]IGhaiOxCcUQPycg]xJcqR", -> "XMc}SH{fsgx}f}_I@gI`yGgeaiJgqbYMg}cIPheeiZhqfYciUhifiajinjMlItjYlywjemj?kEoj", -> "BkQqZIkmrJLkytZUl]uJXmkyjrNI}Rv")); +> ".~?CI_A?WA_M@G@_G@gB?]@?G_SAWA?Y@oJ__BGH?uA_M_IAoO_oCWL@IB_R_{DGB?mB", +> "?U_sDwM@aBoX_KCGP@WEwQ@[FGR@_FWS@cFgT@gFwB@A?oO_KCGZACGwZAGGw[AUFOcAY", +> "F_f`{IG_Ae@?U`[IwWAqEOl`gJgC@mF?jBAFOkBEF_lBIFomBMG?nBQ@?ZAE@?ZAI@?ZA", +> "MH?oBWMGdB?LowaWKOya[K_xBmI?rBqIOsBuI_tBy@?`AMH?uCA@?aaOHOuB[OgCAIHOv", +> "CQ@?baOM@?CYMP@C]HOwCYMOyCKPpHbgPPHbkQw{CgRG|C_RW}CyNpN_SIwkDEJPQawSw", +> "nDQ@OobCSPUbGS`VbKSpWbOT@XbSTPY_SK?u_SK?v_SK?wbcT`[DyM`UDsVgzD[WG{D_V", +> "p`bsUPabwU`bb{Upc_SL`?bcOP[EY@OvCIMOyCKV@\\Ea@OvCQM`DDsYgDB_PgxC[V`kc", +> "_VpfEuM`HDwZHID{W@hEsZxJE?YpncoWPpcsW`oFIR`bEw[xNEO\\HOES\\WDC?Ph@C[X", +> "`vc_Xpw_SOhBEWY@yc_Q`fEc]wDCQH@DE_Y`|cgQphEk^gDCQPPiGAQpjGE@PEc[Z@vGM", +> "Q@lF_`HmFc`XHEo_xIEsZqCG]Z`oFo`QGckZqFf?[P~G_ahpGGahqGq[qJGu\\AHGy\\Q", +> "EG}\\aO_G@gF@?cgGAKcwHCWdGIGKdWA_KCAV`CeGQACeWRAOegSC[ewTGOfG`AGeGBH]", +> "GaWH}@?bHaH?dC?Oa]IEHQ_IEHaba[gaca_OQdacQAeag`QfcCOqa_OeA^aCO`CI?ihBC", +> "SgabIm@A^cOgAlcSgqm_SPa`c[QPvFggaoc_Q`wFkiQpccgqocgQqkJCkxJI{kxKJURQs", +> "JYRaqJ]RpxJaSAEJe?qQaGcqzaSdA{ccdQ|g[da}hcigQCGoHBHkoXIHooiGHsoy^i?ia", +> "lKU@Q`IiH@yFsgqjK]grEK]hBHa[oRGKiI@zISobJfohrKgciBL_OmxCJorxDJssHJJws", +> "YIJ{sgDIgjZ?LQC`|LU^aZKCth~KKtyJKOuGDK}_BOLi_RPLm_bQLqbBRLu@gPHKvweJs", +> "wHKLGwYLLwwgDIuCaVMAHqZH{wRdcsjRBMGxiMLcwrcM]GP|G?jbELQ_AmMQjRDkWtBcM", +> "mxBja_fa_KSxhMI[iqmKWxrjMybrMM_yRiMozRncC]p}IoqH}GCganMeOamKYOqnK_qRh", +> "NMjbEMmO`|MgzBtmgzRti{qRkNUyzkMs|Rxms}XNIcjAnM{{rtNe_QnMg|YOJg{BpNG|B", +> "uN[}ByNk~B|fc^Aqfo^qqJO{XzNG|H~GGlAtNG|H}K_|bwNu^RvNi_atN_~ZvN_}b|n[}", +> "bznmcR}N|?C@OH?sCOT@cFObAiQ@ECgR`QDWaaSOgea]IGhaiOxCcUQPycg]xJcqRXMc}", +> "SH{fsgx}f}_I@gI`yGgeaiJgqbYMg}cIPheeiZhqfYciUhifiajinjMlItjYlywjemj?k", +> "EojBkQqZIkmrJLkytZUl]uJXmkyjrNI}Rv")); gap> gr := DigraphReflexiveTransitiveClosure(gr);