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
-
A New Method for Efficiently Generating Planar Graph Visibility Representations
-
On the Cutting Edge: Simplified O(n) Planarity by Edge Addition
A 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.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
On several (Debian-based) distributions of Linux, you may be able to get the planarity executable with sudo apt install planarity, or you may already have access to its key functionality if you have SageMath or MATLAB. For non-developer users on an operating system Platform supported by the release, a pre-compiled executable version of the planarity executable can be obtained by downloading from the release tag and then decompressing the planarity-N.N.N.N.PlatformExe.zip file.
If you run the planarity executable program, it will offer an interactive, menu-driven mode that lets a user manually select algorithms to run and, where appropriate, files containing graphs on which to run the algorithms.
The planarity executable program 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. Run planarity 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. Essentially, all functionality available in the interactive, menu-driven mode is also available via the command-line parameters.
Please refer to the 2. Dev Setup wiki page for instructions on how to install development dependencies on various supported platforms, as well as how to get started working with the project in Visual Studio Code.
Once one has set up the development environment and is able to work with the code in the development environment, it is possible to make the distribution with the following additional steps:
- Ensure that the
autotools,configure, andmakeare available on the command-line (e.g. addC:\msys64\usr\binto the systemPATHbefore Windows Program Files to ensure that thefindprogram is the one fromMSYS2rather than the one from Windows (e.g. adjust thePATHvariable as needed)). - Open
bash(e.g., on Windows, open the start menu and start typing "MSYS2 UCRT64" to open the correct terminal app), then withinbashnavigate to the root of theedge-addition-planarity-suiterepository (i.e., the directory containingconfigure.acand thecsubdirectory) - Enter the following commands:
autoreconf -fi./configuremake distmake distcheck
The result is a validated planarity-N.N.N.N.tar.gz distribution, where N.N.N.N is the version number expressed in the AC_INIT line of the configure.ac file.
If you have done the steps to set up the development environment and work with the code, then you can make and run the software using the development environment, so you don't necessarily need to make or run the software using the process below.
You also don't necessarily need to make and make install the planarity software on Linux if you are able to get it using sudo apt planarity (e.g., using a Debian-based Linux distribution, which uses apt for package management).
However, you may have only downloaded the distribution (i.e., planarity-N.N.N.N.tar.gz) from a Release tag of this project. Once you have decompressed the distribution into a directory, you can make it by getting into bash (e.g., on Windows, open the start menu and start typing "MSYS2 UCRT64" to open the correct terminal app) and then entering the following commands:
./configuremake
At this point, the planarity executable can be run from within the distribution directory. For example, on Windows, use the command-line to run planarity -test ./c/samples (this calls the real planarity.exe in the .libs/ subdirectory).
On Linux, the planarity program can also be installed by entering sudo make install on the command-line. Note that the libplanarity shared object and symlinks will be installed to /usr/local/lib so it will be necessary to set LD_LIBRARY_PATH accordingly. For one session, this can be done with export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib. To make it more permanent, you could use:
- Create a new file
/etc/ld.so.conf.d/planarity.confcontaining/usr/local/lib - Run
sudo ldconfig
The overall project and the APIs for the graph library and the planarity-related algorithm implementations are versioned using the methods documented in configure.ac and graphLib.h. The overall project version adheres to a Major.Minor.Maintenance.Tweak numbering system, and the libPlanarity shared library, which contains the graph library and planarity-related algorithm implementations, is versioned using the current:revision:age system from LibTool.
The planarity.exe application, which provides command-line and menu-driven interfaces for the graph library and planarity-related algorithms, is versioned using the overall project version defined in graphLib.h (see planarityHelp.c).
This project is licensed under a 3-clause BSD License appearing in LICENSE.TXT.
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.