Skip to main content

Planarity

The planarity repository provides the source code for the planarity Python package. The planarity package was originally developed to provide Python and NetworkX developers with a Python API to access planar graph testing, embedding, drawing, and forbidden subgraph isolation algorithms from the Edge Addition Planarity Suite (EAPS).

The planarity repository has now been transferred to the Github Graph Algorithms Organization. The planarity repository and Python package have been updated with the full set of planarity-related algorithms from EAPS as well as all public methods from its generalized graph library to enable development of a wide range of high-performance graph algorithms and applications.

Example

In [1]: # Example of the complete graph of 5 nodes, K5

In [2]: # K5 is not planar

In [3]: import planarity

In [4]: edgelist = [('a', 'b'), ('a', 'c'), ('a', 'd'), ('a', 'e'),
   ...:             ('b', 'c'),('b', 'd'),('b', 'e'),
   ...:             ('c', 'd'), ('c', 'e'),
   ...:             ('d', 'e')]

In [5]: print(planarity.is_planar(edgelist))
False

In [6]: # remove an edge to make the graph planar

In [7]: edgelist.remove(('a','b'))

In [8]: print(planarity.is_planar(edgelist))
True

In [9]: # make an ascii text drawing

In [10]: print(planarity.ascii(edgelist))
----1----
| | |   |
| | -3--|
| |  ||||
| -2--|||
|  |  |||
---4---||
 |     ||
 ---5----
In [11]: # Shows correspondence between vertex labels and indices

In [12]: print(planarity.mapping(edgelist))
{1: 'd', 2: 'c', 3: 'e', 4: 'a', 5: 'b'}

See here for more examples.

For further details on development setup and installation, please see this wiki page on the planarity repository.

License

Planarity (the 'planarity' Python package; the software) is released under this BSD-3-Clause license.

Copyright (c) 2016-2026, Planarity Developers
John M. Boyer john.boyer.phd@gmail.com
Wanda B. K. Boyer wbkboyer@gmail.com
Aric Hagberg aric.hagberg@gmail.com
All rights reserved.

Planarity includes the Edge Addition Planarity Suite, which is
Copyright (c) 1997-2026, John M. Boyer.
The BSD-3-Clause license for the Edge Additional Planarity Suite included in Planarity appears here.

Metadata

Release files for planarity 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for planarity 1.0.0
File Size Uploaded Provenance Actions
planarity-1.0.0.tar.gz 682.5 kB Without provenance Details for planarity-1.0.0.tar.gz

Release files / planarity-1.0.0.tar.gz

Download URL planarity-1.0.0.tar.gz
Size 682.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9129d2429fc54c70a976cdf59b21a9c6a542466cf49747c1bbce1f27d59f4f3e
BLAKE2b-256 checksum
How to use checksums
9b042321173a19ac665382b7165f89d1da3c162ae4f8802f6d9efbea7237d544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for planarity 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page