passagemath-tdlib 10.6.1rc5__cp311-cp311-macosx_13_0_x86_64.whl → 10.6.16__cp311-cp311-macosx_13_0_x86_64.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.

Potentially problematic release.


This version of passagemath-tdlib might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: passagemath-tdlib
3
- Version: 10.6.1rc5
3
+ Version: 10.6.16
4
4
  Summary: passagemath: Tree decompositions with tdlib
5
5
  Author-email: The Sage Developers <sage-support@googlegroups.com>
6
6
  Maintainer: Matthias Köppe, passagemath contributors
@@ -8,7 +8,7 @@ License-Expression: GPL-2.0-or-later
8
8
  Project-URL: release notes, https://github.com/passagemath/passagemath/releases
9
9
  Project-URL: repo (upstream), https://github.com/sagemath/sage
10
10
  Project-URL: repo, https://github.com/passagemath/passagemath
11
- Project-URL: documentation, https://doc.sagemath.org
11
+ Project-URL: documentation, https://passagemath.org/docs/latest
12
12
  Project-URL: homepage (upstream), https://www.sagemath.org
13
13
  Project-URL: discourse, https://passagemath.discourse.group
14
14
  Project-URL: tracker (upstream), https://github.com/sagemath/sage/issues
@@ -17,6 +17,7 @@ Classifier: Development Status :: 6 - Mature
17
17
  Classifier: Intended Audience :: Education
18
18
  Classifier: Intended Audience :: Science/Research
19
19
  Classifier: Operating System :: POSIX
20
+ Classifier: Operating System :: POSIX :: Linux
20
21
  Classifier: Operating System :: MacOS :: MacOS X
21
22
  Classifier: Programming Language :: Python :: 3 :: Only
22
23
  Classifier: Programming Language :: Python :: 3.10
@@ -27,7 +28,11 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
27
28
  Classifier: Topic :: Scientific/Engineering :: Mathematics
28
29
  Requires-Python: <3.14,>=3.10
29
30
  Description-Content-Type: text/x-rst
31
+ Requires-Dist: cysignals<1.12.4; sys_platform == "win32"
30
32
  Requires-Dist: cysignals!=1.12.0,>=1.11.2
33
+ Provides-Extra: test
34
+ Requires-Dist: passagemath-repl; extra == "test"
35
+ Requires-Dist: passagemath-graphs; extra == "test"
31
36
 
32
37
  ========================================================================
33
38
  passagemath: Tree decompositions with tdlib
@@ -41,44 +46,47 @@ It is a fork of `SageMath <https://www.sagemath.org/>`__, which has been
41
46
  developed 2005-2025 under the motto “Creating a Viable Open Source
42
47
  Alternative to Magma, Maple, Mathematica, and MATLAB”.
43
48
 
44
- The passagemath fork was created in October 2024 with the following
45
- goals:
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:
46
52
 
47
- - providing modularized installation with pip, thus completing a `major
48
- project started in 2020 in the Sage
49
- codebase <https://github.com/sagemath/sage/issues/29705>`__,
53
+ - providing modularized installation with pip,
50
54
  - establishing first-class membership in the scientific Python
51
55
  ecosystem,
52
56
  - giving `clear attribution of upstream
53
57
  projects <https://groups.google.com/g/sage-devel/c/6HO1HEtL1Fs/m/G002rPGpAAAJ>`__,
54
58
  - providing independently usable Python interfaces to upstream
55
59
  libraries,
56
- - providing `platform portability and integration testing
60
+ - offering `platform portability and integration testing
57
61
  services <https://github.com/passagemath/passagemath/issues/704>`__
58
62
  to upstream projects,
59
63
  - inviting collaborations with upstream projects,
60
64
  - `building a professional, respectful, inclusive
61
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,
62
68
  - developing a port to `Pyodide <https://pyodide.org/en/stable/>`__ for
63
69
  serverless deployment with Javascript,
64
70
  - developing a native Windows port.
65
71
 
66
- `Full documentation <https://doc.sagemath.org/html/en/index.html>`__ is
72
+ `Full documentation <https://passagemath.org/docs/latest/html/en/index.html>`__ is
67
73
  available online.
68
74
 
69
- passagemath attempts to support all major Linux distributions and recent versions of
70
- macOS. Use on Windows currently requires the use of Windows Subsystem for Linux or
71
- virtualization.
75
+ passagemath attempts to support and provides binary wheels suitable for
76
+ all major Linux distributions and recent versions of macOS.
72
77
 
73
- Complete sets of binary wheels are provided on PyPI for Python versions 3.10.x-3.13.x.
74
- Python 3.13.x is also supported, but some third-party packages are still missing wheels,
75
- so compilation from source is triggered for those.
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.13.x.
76
84
 
77
85
 
78
86
  About this pip-installable distribution package
79
87
  -----------------------------------------------
80
88
 
81
- This pip-installable distribution `passagemath-tdlib` is a small optional distribution for use with `passagemath-graphs <https://pypi.org/project/passagemath-graphs>`_.
89
+ This pip-installable distribution ``passagemath-tdlib`` is a small optional distribution for use with `passagemath-graphs <https://pypi.org/project/passagemath-graphs>`_.
82
90
 
83
91
  It provides a Cython interface to the ``tdlib`` library, now also known as `treedec <https://gitlab.com/freetdi/treedec>`_, providing
84
92
  algorithms concerning tree decompositions.
@@ -0,0 +1,9 @@
1
+ passagemath_tdlib-10.6.16.dist-info/RECORD,,
2
+ passagemath_tdlib-10.6.16.dist-info/WHEEL,sha256=RyxoEM-DdYra2rgZTpxdiJkmjbwgUQ_Obk5UCeDLiEQ,137
3
+ passagemath_tdlib-10.6.16.dist-info/top_level.txt,sha256=Kmzulf9WsphADFQuqgvdy5mvTLDj_V2zkFHU2s3UXos,6
4
+ passagemath_tdlib-10.6.16.dist-info/METADATA,sha256=csWcXzCWpiuHrCiHtwBs5EiK56uCGs_ucdtoY--a_sw,4498
5
+ sage/all__sagemath_tdlib.py,sha256=zag9UqFlkcjkiBCrkeLRFIXjnemsqnpTNJFfqQMezKE,64
6
+ sage/graphs/all__sagemath_tdlib.py,sha256=xwEAp-3HSleZKAjcgudzEBoWekMyMSx7mY9lzHCETcU,44
7
+ sage/graphs/graph_decompositions/all__sagemath_tdlib.py,sha256=xwEAp-3HSleZKAjcgudzEBoWekMyMSx7mY9lzHCETcU,44
8
+ sage/graphs/graph_decompositions/tdlib.pyx,sha256=O11Mem19-4WuyNAfnL_9ZLuWv_CKiO7SLyDlI94DQDo,5381
9
+ sage/graphs/graph_decompositions/tdlib.cpython-311-darwin.so,sha256=MaJIRV2WXRfG9NrsvNoqkhY_2oA7jwRTuepnXgHoFIo,349520
@@ -0,0 +1,185 @@
1
+ # distutils: language = c++
2
+ # distutils: extra_compile_args = -std=c++11
3
+ # sage_setup: distribution = sagemath-tdlib
4
+
5
+ r"""
6
+ Interface with TdLib (algorithms for tree decompositions)
7
+
8
+ This module defines functions based on TdLib, a library that implements
9
+ algorithms for tree decompositions written by Lukas Larisch.
10
+
11
+ **Definition** :
12
+
13
+ A `tree decomposition` of a graph `G` is a pair `(T, \beta)` consisting of a
14
+ tree T and a function `\beta: V(T) \rightarrow 2^{V(G)}` associating with each
15
+ node `t \in V(T)` a set of vertices `\beta (t) \subseteq V(G)` such that
16
+
17
+ * (T1) for every edge `e \in E(G)` there is a node `t \in V(T)` with `e
18
+ \subseteq \beta (t)`, and
19
+
20
+ * (T2) for all `v \in V(G)` the set `\beta^{-1} := \{t \in V(T): v \in \beta
21
+ (t)\}` is non-empty and connected in T.
22
+
23
+ The width of `(T, \beta)` is defined as `max\{|\beta (t)|-1: t \in V(T) \}`.
24
+ The treewidth of G is defined as the minimum width over all tree decompositions
25
+ of `G`.
26
+
27
+ **Some known results** :
28
+
29
+ - Trees have treewidth 1
30
+
31
+ - Cycles have treewidth 2
32
+
33
+ - Series-parallel graphs have treewidth at most 2
34
+
35
+ - Cliques must be contained in some bag of a tree decomposition
36
+
37
+ Computing the treewidth or a tree decomposition of a given graph is NP-hard in
38
+ general.
39
+
40
+ **This module contains the following functions** :
41
+
42
+ .. csv-table::
43
+ :class: contentstable
44
+ :widths: 30, 70
45
+ :delim: |
46
+
47
+ :meth:`treedecomposition_exact` | Compute a tree decomposition of exact width
48
+ :meth:`get_width` | Return the width of a given tree decomposition
49
+
50
+
51
+ AUTHOR: Lukas Larisch (10-25-2015): Initial version
52
+
53
+ REFERENCE:
54
+
55
+ - [ST1993]_
56
+
57
+ - [AP1986]_
58
+
59
+ - [Bod1993]_
60
+
61
+ Methods
62
+ -------
63
+ """
64
+
65
+ from libcpp.vector cimport vector
66
+ from cysignals.signals cimport sig_on, sig_off
67
+
68
+ from sage.sets.set import Set
69
+ from sage.graphs.graph import Graph
70
+
71
+ cdef extern from "sage_tdlib.cpp":
72
+ int sage_exact_decomposition(vector[unsigned int] &V_G, vector[unsigned int] &E_G, vector[vector[int]] &V_T, vector[unsigned int] &E_T, int lb)
73
+
74
+
75
+ ##############################################################
76
+ # ########## GRAPH/DECOMPOSITION ENCODING/DECODING ###########
77
+ # the following will be used implicitly to do the translation
78
+ # between Sage graph encoding and BGL graph encoding.
79
+
80
+ cdef make_tdlib_graph(G, vertex_to_int, vector[unsigned int] &V, vector[unsigned int] &E) noexcept:
81
+ for i in range(G.order()):
82
+ V.push_back(i)
83
+
84
+ for u, v in G.edge_iterator(labels=False):
85
+ E.push_back(vertex_to_int[u])
86
+ E.push_back(vertex_to_int[v])
87
+
88
+
89
+ cdef make_sage_decomp(G, vector[vector[int]] &V, vector[unsigned int] &E, int_to_vertex) noexcept:
90
+ cdef int i, j
91
+ for i in range(len(V)):
92
+ G.add_vertex(Set([int_to_vertex[j] for j in V[i]]))
93
+
94
+ for i in range(0, len(E), 2):
95
+ G.add_edge(Set([int_to_vertex[j] for j in V[E[i]]]), Set([int_to_vertex[j] for j in V[E[i+1]]]))
96
+
97
+
98
+ ##############################################################
99
+ # ########## EXACT ALGORITHMS ################################
100
+
101
+ def treedecomposition_exact(G, lb=-1):
102
+ r"""
103
+ Compute a tree decomposition of exact width.
104
+
105
+ The returned tree decomposition is exact iff the given lower bound is not
106
+ greater than the treewidth of the input graph. Otherwise a tree
107
+ decomposition of a width than matches the given lower bound will be
108
+ computed.
109
+
110
+ INPUT:
111
+
112
+ - ``G`` -- a generic graph
113
+
114
+ - ``lb`` -- integer (default: -1); a lower bound to the treewidth of G,
115
+ e.g. computed by lower_bound
116
+
117
+ OUTPUT:
118
+
119
+ A tree decomposition of ``G`` of ``tw(G)``, if the lower bound was not
120
+ greater than ``tw(G)``, otherwise a tree decomposition of ``width = lb``.
121
+
122
+ .. WARNING::
123
+
124
+ The computation can take a lot of time for a graph `G` on more than
125
+ about 30 vertices and `tw(G) > 3`.
126
+
127
+ EXAMPLES::
128
+
129
+ sage: # optional - tdlib
130
+ sage: import sage.graphs.graph_decompositions.tdlib as tdlib
131
+ sage: G = graphs.HouseGraph()
132
+ sage: T = tdlib.treedecomposition_exact(G)
133
+ sage: T.show(vertex_size=2000) # needs sage.plot
134
+
135
+ TESTS::
136
+
137
+ sage: # optional - tdlib
138
+ sage: import sage.graphs.graph_decompositions.tdlib as tdlib
139
+ sage: G = graphs.HouseGraph()
140
+ sage: T = tdlib.treedecomposition_exact(G)
141
+ sage: G = graphs.PetersenGraph()
142
+ sage: T = tdlib.treedecomposition_exact(G)
143
+ """
144
+ cdef vector[unsigned int] V_G, E_G, E_T
145
+ cdef vector[vector[int]] V_T
146
+
147
+ cdef list int_to_vertex = list(G)
148
+ cdef dict vertex_to_int = {v: i for i, v in enumerate(G)}
149
+
150
+ make_tdlib_graph(G, vertex_to_int, V_G, E_G)
151
+
152
+ cdef int c_lb = lb
153
+
154
+ sig_on()
155
+ sage_exact_decomposition(V_G, E_G, V_T, E_T, c_lb)
156
+ sig_off()
157
+
158
+ T = Graph(name="Tree decomposition")
159
+ make_sage_decomp(T, V_T, E_T, int_to_vertex)
160
+
161
+ return T
162
+
163
+
164
+ def get_width(T):
165
+ """
166
+ Return the width of a given tree decomposition.
167
+
168
+ The width of a tree decompositions is the maximal size of a bag minus one.
169
+
170
+ INPUT:
171
+
172
+ - ``T`` -- a tree decomposition
173
+
174
+ OUTPUT: the width of ``T``
175
+
176
+ EXAMPLES::
177
+
178
+ sage: # optional - tdlib
179
+ sage: import sage.graphs.graph_decompositions.tdlib as tdlib
180
+ sage: G = graphs.PetersenGraph()
181
+ sage: T = tdlib.treedecomposition_exact(G)
182
+ sage: tdlib.get_width(T)
183
+ 4
184
+ """
185
+ return (max(len(x) for x in T) - 1) if T else -1
@@ -1,8 +0,0 @@
1
- passagemath_tdlib-10.6.1rc5.dist-info/RECORD,,
2
- passagemath_tdlib-10.6.1rc5.dist-info/WHEEL,sha256=RyxoEM-DdYra2rgZTpxdiJkmjbwgUQ_Obk5UCeDLiEQ,137
3
- passagemath_tdlib-10.6.1rc5.dist-info/top_level.txt,sha256=hibFyzQHiLOMK68qL1OWsNKaXOmSXqZjeLTBem6Yy7I,5
4
- passagemath_tdlib-10.6.1rc5.dist-info/METADATA,sha256=gHq_k9CU0A1_rFFJO9cN-4wK2uppzJpuBN4VAYGWsJA,4045
5
- sage/all__sagemath_tdlib.py,sha256=zag9UqFlkcjkiBCrkeLRFIXjnemsqnpTNJFfqQMezKE,64
6
- sage/graphs/all__sagemath_tdlib.py,sha256=xwEAp-3HSleZKAjcgudzEBoWekMyMSx7mY9lzHCETcU,44
7
- sage/graphs/graph_decompositions/all__sagemath_tdlib.py,sha256=xwEAp-3HSleZKAjcgudzEBoWekMyMSx7mY9lzHCETcU,44
8
- sage/graphs/graph_decompositions/tdlib.cpython-311-darwin.so,sha256=kKYnjx0Q0_AGyKRQeCAsCBbkvvmPERh-al6JHeZZORM,349544