passagemath-planarity 10.6.41__cp314-cp314t-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_planarity/__init__.py +3 -0
- passagemath_planarity-10.6.41.dist-info/DELVEWHEEL +2 -0
- passagemath_planarity-10.6.41.dist-info/METADATA +115 -0
- passagemath_planarity-10.6.41.dist-info/RECORD +11 -0
- passagemath_planarity-10.6.41.dist-info/WHEEL +5 -0
- passagemath_planarity-10.6.41.dist-info/top_level.txt +3 -0
- passagemath_planarity.libs/libplanarity-2-6d6ffc6ee4acfc5a3368537cfe91fe86.dll +0 -0
- sage/all__sagemath_planarity.py +13 -0
- sage/graphs/all__sagemath_planarity.py +1 -0
- sage/graphs/planarity.cp314t-win_arm64.pyd +0 -0
- sage/graphs/planarity.pyx +191 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Version: 1.11.2
|
|
2
|
+
Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-pxyrz7ob\\cp314t-win_arm64\\build\\venv\\Scripts\\delvewheel', 'repair', '-vv', '--custom-patch', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-pxyrz7ob\\cp314t-win_arm64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-pxyrz7ob\\cp314t-win_arm64\\built_wheel\\passagemath_planarity-10.6.41-cp314-cp314t-win_arm64.whl']
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: passagemath-planarity
|
|
3
|
+
Version: 10.6.41
|
|
4
|
+
Summary: passagemath: Graph planarity with the edge addition planarity suite
|
|
5
|
+
Author-email: The Sage Developers <sage-support@googlegroups.com>
|
|
6
|
+
Maintainer: Matthias Köppe, passagemath contributors
|
|
7
|
+
License-Expression: GPL-2.0-or-later
|
|
8
|
+
Project-URL: release notes, https://github.com/passagemath/passagemath/releases
|
|
9
|
+
Project-URL: repo (upstream), https://github.com/sagemath/sage
|
|
10
|
+
Project-URL: repo, https://github.com/passagemath/passagemath
|
|
11
|
+
Project-URL: documentation, https://passagemath.org/docs/latest
|
|
12
|
+
Project-URL: homepage (upstream), https://www.sagemath.org
|
|
13
|
+
Project-URL: discourse, https://passagemath.discourse.group
|
|
14
|
+
Project-URL: tracker (upstream), https://github.com/sagemath/sage/issues
|
|
15
|
+
Project-URL: tracker, https://github.com/passagemath/passagemath/issues
|
|
16
|
+
Classifier: Development Status :: 6 - Mature
|
|
17
|
+
Classifier: Intended Audience :: Education
|
|
18
|
+
Classifier: Intended Audience :: Science/Research
|
|
19
|
+
Classifier: Operating System :: POSIX
|
|
20
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
22
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
23
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
29
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
30
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
31
|
+
Requires-Python: <3.15,>=3.10
|
|
32
|
+
Description-Content-Type: text/x-rst
|
|
33
|
+
Requires-Dist: passagemath-graphs
|
|
34
|
+
Provides-Extra: test
|
|
35
|
+
Requires-Dist: passagemath-repl; extra == "test"
|
|
36
|
+
|
|
37
|
+
========================================================================
|
|
38
|
+
passagemath: Graph planarity with the edge addition planarity suite
|
|
39
|
+
========================================================================
|
|
40
|
+
|
|
41
|
+
`passagemath <https://github.com/passagemath/passagemath>`__ is open
|
|
42
|
+
source mathematical software in Python, released under the GNU General
|
|
43
|
+
Public Licence GPLv2+.
|
|
44
|
+
|
|
45
|
+
It is a fork of `SageMath <https://www.sagemath.org/>`__, which has been
|
|
46
|
+
developed 2005-2025 under the motto “Creating a Viable Open Source
|
|
47
|
+
Alternative to Magma, Maple, Mathematica, and MATLAB”.
|
|
48
|
+
|
|
49
|
+
The passagemath fork uses the motto "Creating a Free Passage Between the
|
|
50
|
+
Scientific Python Ecosystem and Mathematical Software Communities."
|
|
51
|
+
It was created in October 2024 with the following goals:
|
|
52
|
+
|
|
53
|
+
- providing modularized installation with pip,
|
|
54
|
+
- establishing first-class membership in the scientific Python
|
|
55
|
+
ecosystem,
|
|
56
|
+
- giving `clear attribution of upstream
|
|
57
|
+
projects <https://groups.google.com/g/sage-devel/c/6HO1HEtL1Fs/m/G002rPGpAAAJ>`__,
|
|
58
|
+
- providing independently usable Python interfaces to upstream
|
|
59
|
+
libraries,
|
|
60
|
+
- offering `platform portability and integration testing
|
|
61
|
+
services <https://github.com/passagemath/passagemath/issues/704>`__
|
|
62
|
+
to upstream projects,
|
|
63
|
+
- inviting collaborations with upstream projects,
|
|
64
|
+
- `building a professional, respectful, inclusive
|
|
65
|
+
community <https://groups.google.com/g/sage-devel/c/xBzaINHWwUQ>`__,
|
|
66
|
+
- `empowering Sage users to participate in the scientific Python ecosystem
|
|
67
|
+
<https://github.com/passagemath/passagemath/issues/248>`__ by publishing packages,
|
|
68
|
+
- developing a port to `Pyodide <https://pyodide.org/en/stable/>`__ for
|
|
69
|
+
serverless deployment with Javascript,
|
|
70
|
+
- developing a native Windows port.
|
|
71
|
+
|
|
72
|
+
`Full documentation <https://passagemath.org/docs/latest/html/en/index.html>`__ is
|
|
73
|
+
available online.
|
|
74
|
+
|
|
75
|
+
passagemath attempts to support and provides binary wheels suitable for
|
|
76
|
+
all major Linux distributions and recent versions of macOS.
|
|
77
|
+
|
|
78
|
+
Binary wheels for native Windows (x86_64) are are available for a subset of
|
|
79
|
+
the passagemath distributions. Use of the full functionality of passagemath
|
|
80
|
+
on Windows currently requires the use of Windows Subsystem for Linux (WSL)
|
|
81
|
+
or virtualization.
|
|
82
|
+
|
|
83
|
+
The supported Python versions in the passagemath 10.6.x series are 3.10.x-3.14.x.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
About this pip-installable distribution package
|
|
87
|
+
-----------------------------------------------
|
|
88
|
+
|
|
89
|
+
This pip-installable distribution ``passagemath-planarity`` is a small
|
|
90
|
+
optional distribution for use with ``passagemath-graphs``.
|
|
91
|
+
|
|
92
|
+
It provides a Cython interface to the
|
|
93
|
+
`Edge Addition Planarity Suite <https://github.com/graph-algorithms/edge-addition-planarity-suite/>`_
|
|
94
|
+
by John Boyer.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
What is included
|
|
98
|
+
----------------
|
|
99
|
+
|
|
100
|
+
- `Cython interface to Boyer's planarity algorithm <https://passagemath.org/docs/latest/html/en/reference/graphs/sage/graphs/planarity.html>`_
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
Examples
|
|
104
|
+
--------
|
|
105
|
+
|
|
106
|
+
::
|
|
107
|
+
|
|
108
|
+
$ pipx run --pip-args="--prefer-binary" --spec "passagemath-planarity[test]" ipython
|
|
109
|
+
|
|
110
|
+
In [1]: from passagemath_planarity import *
|
|
111
|
+
|
|
112
|
+
In [2]: g = graphs.PetersenGraph()
|
|
113
|
+
|
|
114
|
+
In [3]: g.is_planar()
|
|
115
|
+
Out[3]: False
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
passagemath_planarity/__init__.py,sha256=LfRGKlFg1VdJAq-0ZQWm_fWqDTdEh_e7V2AIVDIoe9I,92
|
|
2
|
+
passagemath_planarity-10.6.41.dist-info/DELVEWHEEL,sha256=D0tU6PohUx4pPCt6js2wEMAz4TUnuowkiLmaw6aWNx0,445
|
|
3
|
+
passagemath_planarity-10.6.41.dist-info/METADATA,sha256=7_1IB67z7CPFo4S-Z3_fXilv8dhQYnEHSeTvhnieiJ8,5018
|
|
4
|
+
passagemath_planarity-10.6.41.dist-info/RECORD,,
|
|
5
|
+
passagemath_planarity-10.6.41.dist-info/top_level.txt,sha256=3hlvD84OACDgl2cRvSDRxjGVpKRYmBvksz4-Bo5tM5c,28
|
|
6
|
+
passagemath_planarity-10.6.41.dist-info/WHEEL,sha256=zXchtPDG49pF0-WydodiT6g5I4rYIqRMLOrUzYY4Dyw,102
|
|
7
|
+
passagemath_planarity.libs/libplanarity-2-6d6ffc6ee4acfc5a3368537cfe91fe86.dll,sha256=bW_8buSs_FozaFN8_pH-htkaz6eRUKDmBVGp2vOv7xA,599552
|
|
8
|
+
sage/all__sagemath_planarity.py,sha256=Ud1K-uR7M1F4tD5v5Av38Tg-Qf8Jq7iX5lebmguJZkM,413
|
|
9
|
+
sage/graphs/all__sagemath_planarity.py,sha256=CYZamBzI163p8V2TX9c1rV2S9cGAOxEOhc82QQkpTvQ,48
|
|
10
|
+
sage/graphs/planarity.cp314t-win_arm64.pyd,sha256=_JVUbgzLY03JsSWYpfzkwIehC8YZ9DkErS6-GtDC89s,50688
|
|
11
|
+
sage/graphs/planarity.pyx,sha256=2OQXReYJKYQ6MjVMO0uAj3I-z_X7fN4nau1aCfe_EUU,7093
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-planarity
|
|
2
|
+
# start delvewheel patch
|
|
3
|
+
def _delvewheel_patch_1_11_2():
|
|
4
|
+
import os
|
|
5
|
+
if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'passagemath_planarity.libs'))):
|
|
6
|
+
os.add_dll_directory(libs_dir)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
_delvewheel_patch_1_11_2()
|
|
10
|
+
del _delvewheel_patch_1_11_2
|
|
11
|
+
# end delvewheel patch
|
|
12
|
+
|
|
13
|
+
from sage.all__sagemath_graphs import *
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-planarity
|
|
Binary file
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-planarity
|
|
2
|
+
# distutils: libraries = planarity
|
|
3
|
+
"""
|
|
4
|
+
Wrapper for Boyer's (C) planarity algorithm
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
cdef extern from "planarity/graph.h":
|
|
8
|
+
ctypedef struct vertexRec:
|
|
9
|
+
int link[2]
|
|
10
|
+
int index
|
|
11
|
+
ctypedef vertexRec * vertexRecP
|
|
12
|
+
|
|
13
|
+
ctypedef struct edgeRec:
|
|
14
|
+
int link[2]
|
|
15
|
+
int neighbor
|
|
16
|
+
ctypedef edgeRec * edgeRecP
|
|
17
|
+
|
|
18
|
+
ctypedef struct BM_graph:
|
|
19
|
+
vertexRecP V
|
|
20
|
+
edgeRecP E
|
|
21
|
+
int N
|
|
22
|
+
ctypedef BM_graph * graphP
|
|
23
|
+
|
|
24
|
+
cdef int OK, EMBEDFLAGS_PLANAR, NONEMBEDDABLE, NOTOK
|
|
25
|
+
|
|
26
|
+
cdef graphP gp_New()
|
|
27
|
+
cdef void gp_Free(graphP *pGraph)
|
|
28
|
+
cdef int gp_InitGraph(graphP theGraph, int N)
|
|
29
|
+
cdef int gp_AddEdge(graphP theGraph, int u, int ulink, int v, int vlink)
|
|
30
|
+
cdef int gp_Embed(graphP theGraph, int embedFlags)
|
|
31
|
+
cdef int gp_SortVertices(graphP theGraph)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def is_planar(g, kuratowski=False, set_pos=False, set_embedding=False):
|
|
35
|
+
r"""
|
|
36
|
+
Check whether ``g`` is planar using Boyer's planarity algorithm.
|
|
37
|
+
|
|
38
|
+
If ``kuratowski`` is ``False``, returns ``True`` if ``g`` is planar,
|
|
39
|
+
``False`` otherwise. If ``kuratowski`` is ``True``, returns a tuple, first
|
|
40
|
+
entry is a boolean (whether or not the graph is planar) and second entry is
|
|
41
|
+
a Kuratowski subgraph, i.e. an edge subdivision of `K_5` or `K_{3,3}` (if
|
|
42
|
+
not planar) or ``None`` (if planar). Also, will set an ``_embedding``
|
|
43
|
+
attribute for the graph ``g`` if ``set_embedding`` is set to ``True``.
|
|
44
|
+
|
|
45
|
+
INPUT:
|
|
46
|
+
|
|
47
|
+
- ``kuratowski`` -- boolean (default: ``False``); when set to ``True``,
|
|
48
|
+
return a tuple of a boolean and either ``None`` or a Kuratowski subgraph
|
|
49
|
+
(i.e. an edge subdivision of `K_5` or `K_{3,3}`). When set to ``False``,
|
|
50
|
+
returns ``True`` if ``g`` is planar, ``False`` otherwise.
|
|
51
|
+
|
|
52
|
+
- ``set_pos`` -- boolean (default: ``False``); whether to use Schnyder's
|
|
53
|
+
algorithm to determine and set positions
|
|
54
|
+
|
|
55
|
+
- ``set_embedding`` -- boolean (default: ``False``); whether to record the
|
|
56
|
+
combinatorial embedding returned (see
|
|
57
|
+
:meth:`~sage.graphs.generic_graph.GenericGraph.get_embedding`)
|
|
58
|
+
|
|
59
|
+
EXAMPLES::
|
|
60
|
+
|
|
61
|
+
sage: G = graphs.DodecahedralGraph()
|
|
62
|
+
sage: from sage.graphs.planarity import is_planar
|
|
63
|
+
sage: is_planar(G)
|
|
64
|
+
True
|
|
65
|
+
sage: Graph('@').is_planar()
|
|
66
|
+
True
|
|
67
|
+
|
|
68
|
+
TESTS:
|
|
69
|
+
|
|
70
|
+
We try checking the planarity of all graphs on 7 or fewer
|
|
71
|
+
vertices. In fact, to try to track down a segfault, we do it
|
|
72
|
+
twice. ::
|
|
73
|
+
|
|
74
|
+
sage: # long time, needs networkx
|
|
75
|
+
sage: import networkx.generators.atlas
|
|
76
|
+
sage: atlas_graphs = [Graph(i) for i in networkx.generators.atlas.graph_atlas_g()]
|
|
77
|
+
sage: a = [i for i in [1..1252] if atlas_graphs[i].is_planar()]
|
|
78
|
+
sage: b = [i for i in [1..1252] if atlas_graphs[i].is_planar()]
|
|
79
|
+
sage: a == b
|
|
80
|
+
True
|
|
81
|
+
|
|
82
|
+
There were some problems with ``set_pos`` stability in the past,
|
|
83
|
+
so let's check if this runs without exception::
|
|
84
|
+
|
|
85
|
+
sage: for i, g in enumerate(atlas_graphs): # long time # needs networkx
|
|
86
|
+
....: if (not g.is_connected() or i == 0):
|
|
87
|
+
....: continue
|
|
88
|
+
....: _ = g.is_planar(set_embedding=True, set_pos=True)
|
|
89
|
+
|
|
90
|
+
Argument saving::
|
|
91
|
+
|
|
92
|
+
sage: G = Graph([(1, 2)])
|
|
93
|
+
sage: for set_embedding, set_pos in ((True,True), (True,False), (False, True), (False, False)):
|
|
94
|
+
....: G = Graph([(1, 2)])
|
|
95
|
+
....: assert is_planar(G, set_embedding=set_embedding, set_pos=set_pos)
|
|
96
|
+
....: assert (hasattr(G, '_embedding') and G._embedding is not None) == set_embedding, (set_embedding, set_pos)
|
|
97
|
+
....: assert (hasattr(G, '_pos') and G._pos is not None) == set_pos, (set_embedding, set_pos)
|
|
98
|
+
"""
|
|
99
|
+
g._scream_if_not_simple()
|
|
100
|
+
if set_pos and not g.is_connected():
|
|
101
|
+
raise ValueError("is_planar() cannot set vertex positions for a disconnected graph")
|
|
102
|
+
|
|
103
|
+
# First take care of a trivial cases
|
|
104
|
+
if not g.size():
|
|
105
|
+
# There are no edges
|
|
106
|
+
if set_embedding:
|
|
107
|
+
g._embedding = {v: [] for v in g}
|
|
108
|
+
return (True, None) if kuratowski else True
|
|
109
|
+
if g.order() == 2 and g.is_connected():
|
|
110
|
+
# P_2 is too small to be triangulated
|
|
111
|
+
u, v = list(g)
|
|
112
|
+
if set_embedding:
|
|
113
|
+
g._embedding = {u: [v], v: [u]}
|
|
114
|
+
if set_pos:
|
|
115
|
+
g._pos = {u: [0, 0], v: [0, 1]}
|
|
116
|
+
return (True, None) if kuratowski else True
|
|
117
|
+
|
|
118
|
+
# Create to and from mappings to relabel vertices to the set {1,...,n}
|
|
119
|
+
# (planarity 3 uses 1-based array indexing, with 0 representing NIL)
|
|
120
|
+
cdef int i
|
|
121
|
+
cdef list listto = list(g)
|
|
122
|
+
cdef dict ffrom = {vvv: i for i, vvv in enumerate(listto, start=1)}
|
|
123
|
+
cdef dict to = {i: vvv for i, vvv in enumerate(listto, start=1)}
|
|
124
|
+
|
|
125
|
+
cdef graphP theGraph
|
|
126
|
+
theGraph = gp_New()
|
|
127
|
+
cdef int status
|
|
128
|
+
status = gp_InitGraph(theGraph, g.order())
|
|
129
|
+
if status != OK:
|
|
130
|
+
raise RuntimeError("gp_InitGraph status is not ok")
|
|
131
|
+
for u, v in g.edge_iterator(labels=False):
|
|
132
|
+
status = gp_AddEdge(theGraph, ffrom[u], 0, ffrom[v], 0)
|
|
133
|
+
if status == NOTOK:
|
|
134
|
+
raise RuntimeError("gp_AddEdge status is not ok")
|
|
135
|
+
elif status == NONEMBEDDABLE:
|
|
136
|
+
# We now know that the graph is nonplanar.
|
|
137
|
+
if not kuratowski:
|
|
138
|
+
gp_Free(&theGraph)
|
|
139
|
+
return False
|
|
140
|
+
# With just the current edges, we have a nonplanar graph,
|
|
141
|
+
# so to isolate a kuratowski subgraph, just keep going.
|
|
142
|
+
break
|
|
143
|
+
|
|
144
|
+
status = gp_Embed(theGraph, EMBEDFLAGS_PLANAR)
|
|
145
|
+
|
|
146
|
+
if status == NOTOK:
|
|
147
|
+
raise RuntimeError("status is not ok")
|
|
148
|
+
|
|
149
|
+
gp_SortVertices(theGraph)
|
|
150
|
+
|
|
151
|
+
if status == NONEMBEDDABLE:
|
|
152
|
+
# Kuratowski subgraph isolator
|
|
153
|
+
if not kuratowski:
|
|
154
|
+
gp_Free(&theGraph)
|
|
155
|
+
return False
|
|
156
|
+
g_dict = {}
|
|
157
|
+
for i in range(1, theGraph.N + 1):
|
|
158
|
+
linked_list = []
|
|
159
|
+
j = theGraph.V[i].link[1]
|
|
160
|
+
while j:
|
|
161
|
+
linked_list.append(to[theGraph.E[j].neighbor])
|
|
162
|
+
j = theGraph.E[j].link[1]
|
|
163
|
+
if linked_list:
|
|
164
|
+
g_dict[to[i]] = linked_list
|
|
165
|
+
gp_Free(&theGraph)
|
|
166
|
+
G = g.__class__(data=g_dict, weighted=g._weighted,
|
|
167
|
+
loops=g.allows_loops(),
|
|
168
|
+
multiedges=g.allows_multiple_edges(),
|
|
169
|
+
name="Kuratowski subgraph of (%s)" % g.name())
|
|
170
|
+
if g.get_pos():
|
|
171
|
+
G.set_pos({u: g._pos[u] for u in g_dict})
|
|
172
|
+
return (False, G)
|
|
173
|
+
|
|
174
|
+
if set_pos or set_embedding:
|
|
175
|
+
emb_dict = {}
|
|
176
|
+
for i in range(1, theGraph.N + 1):
|
|
177
|
+
linked_list = []
|
|
178
|
+
j = theGraph.V[i].link[1]
|
|
179
|
+
while j:
|
|
180
|
+
linked_list.append(to[theGraph.E[j].neighbor])
|
|
181
|
+
j = theGraph.E[j].link[1]
|
|
182
|
+
emb_dict[to[i]] = linked_list
|
|
183
|
+
if set_embedding:
|
|
184
|
+
g._embedding = emb_dict
|
|
185
|
+
if set_pos:
|
|
186
|
+
g.layout(layout='planar', save_pos=True, on_embedding=emb_dict)
|
|
187
|
+
|
|
188
|
+
gp_Free(&theGraph)
|
|
189
|
+
if kuratowski:
|
|
190
|
+
return (True, None)
|
|
191
|
+
return True
|