edsger 0.1.0__tar.gz → 0.1.1__tar.gz
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.
- {edsger-0.1.0 → edsger-0.1.1}/.github/workflows/publish.yml +1 -1
- {edsger-0.1.0 → edsger-0.1.1}/.github/workflows/tests.yml +7 -1
- edsger-0.1.1/.pre-commit-config.yaml +14 -0
- edsger-0.1.1/PKG-INFO +69 -0
- edsger-0.1.1/README.md +28 -0
- {edsger-0.1.0 → edsger-0.1.1}/docs/source/api.md +0 -20
- {edsger-0.1.0 → edsger-0.1.1}/docs/source/conf.py +5 -4
- {edsger-0.1.0 → edsger-0.1.1}/docs/source/quickstart.md +25 -5
- {edsger-0.1.0 → edsger-0.1.1}/pyproject.toml +11 -2
- {edsger-0.1.0 → edsger-0.1.1}/requirements-dev.txt +2 -0
- {edsger-0.1.0 → edsger-0.1.1}/setup.py +1 -2
- edsger-0.1.1/src/edsger/.gitignore +1 -0
- edsger-0.1.1/src/edsger/_version.py +1 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/commons.c +151 -151
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/commons.pxd +6 -6
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/commons.pyx +4 -4
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/dijkstra.c +204 -204
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/dijkstra.pyx +71 -71
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/networks.py +1 -2
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/path.py +1 -1
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/path_tracking.c +147 -147
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/path_tracking.pyx +7 -7
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/pq_4ary_dec_0b.c +248 -248
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/pq_4ary_dec_0b.pyx +69 -69
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/spiess_florian.c +220 -220
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/spiess_florian.pyx +24 -24
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/star.c +189 -189
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/star.pyx +41 -41
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/utils.py +2 -2
- edsger-0.1.1/src/edsger.egg-info/PKG-INFO +69 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger.egg-info/SOURCES.txt +2 -0
- {edsger-0.1.0 → edsger-0.1.1}/tests/test_dijkstra.py +7 -3
- {edsger-0.1.0 → edsger-0.1.1}/tests/test_path.py +1 -1
- {edsger-0.1.0 → edsger-0.1.1}/tests/test_path_tracking.py +1 -1
- {edsger-0.1.0 → edsger-0.1.1}/tests/test_pq_4ary_dec_0b.py +1 -1
- {edsger-0.1.0 → edsger-0.1.1}/tests/test_spiess_florian.py +1 -2
- edsger-0.1.0/PKG-INFO +0 -279
- edsger-0.1.0/README.md +0 -243
- edsger-0.1.0/src/edsger/_version.py +0 -1
- edsger-0.1.0/src/edsger.egg-info/PKG-INFO +0 -279
- {edsger-0.1.0 → edsger-0.1.1}/.github/workflows/docs.yml +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/.gitignore +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/.readthedocs.yaml +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/AUTHORS.rst +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/CHANGELOG.rst +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/CONTRIBUTING.rst +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/LICENSE +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/MANIFEST.in +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/docs/Makefile +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/docs/requirements.txt +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/docs/source/contributing.md +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/docs/source/index.md +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/docs/source/installation.md +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/requirements.txt +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/scripts/dijkstra_dimacs.py +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/setup.cfg +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/__init__.py +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger/pq_4ary_dec_0b.pxd +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger.egg-info/dependency_links.txt +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger.egg-info/not-zip-safe +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger.egg-info/requires.txt +0 -0
- {edsger-0.1.0 → edsger-0.1.1}/src/edsger.egg-info/top_level.txt +0 -0
@@ -10,7 +10,7 @@ jobs:
|
|
10
10
|
strategy:
|
11
11
|
matrix:
|
12
12
|
os: [ubuntu-22.04, windows-2022, macos-14]
|
13
|
-
python-version: ["3.11"]
|
13
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
14
14
|
runs-on: ${{ matrix.os }}
|
15
15
|
steps:
|
16
16
|
- uses: actions/checkout@v4
|
@@ -23,6 +23,12 @@ jobs:
|
|
23
23
|
python -m pip install --upgrade pip
|
24
24
|
pip install -r requirements-dev.txt
|
25
25
|
pip install .
|
26
|
+
- name: Format Python code with black
|
27
|
+
run: |
|
28
|
+
black --check --diff .
|
29
|
+
- name: Lint Cython code
|
30
|
+
run: |
|
31
|
+
cython-lint src/edsger/commons.pyx src/edsger/dijkstra.pyx src/edsger/path_tracking.pyx src/edsger/pq_4ary_dec_0b.pyx src/edsger/spiess_florian.pyx src/edsger/star.pyx src/edsger/commons.pxd src/edsger/pq_4ary_dec_0b.pxd
|
26
32
|
- name: Testing
|
27
33
|
run: |
|
28
34
|
python -m pytest tests
|
@@ -0,0 +1,14 @@
|
|
1
|
+
repos:
|
2
|
+
- repo: https://github.com/psf/black
|
3
|
+
rev: 24.10.0
|
4
|
+
hooks:
|
5
|
+
- id: black
|
6
|
+
files: '\.(py)$'
|
7
|
+
exclude: 'src/edsger/.*\.pyx$'
|
8
|
+
|
9
|
+
- repo: https://github.com/MarcoGorelli/cython-lint
|
10
|
+
rev: v0.16.2
|
11
|
+
hooks:
|
12
|
+
- id: cython-lint
|
13
|
+
files: '\.(pyx|pxd)$'
|
14
|
+
args: [--max-line-length=88]
|
edsger-0.1.1/PKG-INFO
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: edsger
|
3
|
+
Version: 0.1.1
|
4
|
+
Summary: Graph algorithms in Cython.
|
5
|
+
Author-email: François Pacull <francois.pacull@architecture-performance.fr>
|
6
|
+
Maintainer-email: François Pacull <francois.pacull@architecture-performance.fr>
|
7
|
+
License: MIT License
|
8
|
+
Project-URL: Repository, https://github.com/aetperf/Edsger
|
9
|
+
Project-URL: Documentation, https://edsger.readthedocs.io
|
10
|
+
Keywords: python,graph,shortest path,Dijkstra
|
11
|
+
Platform: any
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
20
|
+
Classifier: Operating System :: OS Independent
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
22
|
+
Requires-Python: >=3.9
|
23
|
+
Description-Content-Type: text/markdown
|
24
|
+
License-File: LICENSE
|
25
|
+
License-File: AUTHORS.rst
|
26
|
+
Requires-Dist: setuptools
|
27
|
+
Requires-Dist: setuptools_scm
|
28
|
+
Requires-Dist: numpy>=1.26
|
29
|
+
Requires-Dist: Cython>=3
|
30
|
+
Requires-Dist: pandas
|
31
|
+
Provides-Extra: dev
|
32
|
+
Requires-Dist: black; extra == "dev"
|
33
|
+
Provides-Extra: test
|
34
|
+
Requires-Dist: pytest; extra == "test"
|
35
|
+
Requires-Dist: scipy<1.11; extra == "test"
|
36
|
+
Provides-Extra: doc
|
37
|
+
Requires-Dist: sphinx; extra == "doc"
|
38
|
+
Requires-Dist: sphinx_design; extra == "doc"
|
39
|
+
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
40
|
+
Dynamic: license-file
|
41
|
+
|
42
|
+
|
43
|
+

|
44
|
+
[](https://pypi.org/project/edsger/)
|
45
|
+
[](https://pepy.tech/project/edsger)
|
46
|
+
[](https://pypi.org/project/edsger/)
|
47
|
+
[](https://github.com/psf/black)
|
48
|
+
[](https://github.com/MarcoGorelli/cython-lint)
|
49
|
+
[](https://opensource.org/licenses/MIT)
|
50
|
+
|
51
|
+
# Edsger
|
52
|
+
|
53
|
+
*Graph algorithms in Cython*
|
54
|
+
|
55
|
+
Welcome to our Python library for graph algorithms. So far, the library only includes Dijkstra's algorithm but we should add a range of common path algorithms later. It is also open-source and easy to integrate with other Python libraries. To get started, simply install the library using pip, and import it into your Python project.
|
56
|
+
|
57
|
+
Documentation : [https://edsger.readthedocs.io/en/latest/](https://edsger.readthedocs.io/en/latest/)
|
58
|
+
|
59
|
+
## Contributing
|
60
|
+
|
61
|
+
We welcome contributions to the Edsger library. If you have any suggestions, bug reports, or feature requests, please open an issue on our [GitHub repository](https://github.com/aetperf/Edsger).
|
62
|
+
|
63
|
+
## License
|
64
|
+
|
65
|
+
Edsger is licensed under the MIT License. See the LICENSE file for more details.
|
66
|
+
|
67
|
+
## Contact
|
68
|
+
|
69
|
+
For any questions or inquiries, please contact François Pacull at [francois.pacull@architecture-performance.fr](mailto:francois.pacull@architecture-performance.fr).
|
edsger-0.1.1/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+

|
3
|
+
[](https://pypi.org/project/edsger/)
|
4
|
+
[](https://pepy.tech/project/edsger)
|
5
|
+
[](https://pypi.org/project/edsger/)
|
6
|
+
[](https://github.com/psf/black)
|
7
|
+
[](https://github.com/MarcoGorelli/cython-lint)
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
9
|
+
|
10
|
+
# Edsger
|
11
|
+
|
12
|
+
*Graph algorithms in Cython*
|
13
|
+
|
14
|
+
Welcome to our Python library for graph algorithms. So far, the library only includes Dijkstra's algorithm but we should add a range of common path algorithms later. It is also open-source and easy to integrate with other Python libraries. To get started, simply install the library using pip, and import it into your Python project.
|
15
|
+
|
16
|
+
Documentation : [https://edsger.readthedocs.io/en/latest/](https://edsger.readthedocs.io/en/latest/)
|
17
|
+
|
18
|
+
## Contributing
|
19
|
+
|
20
|
+
We welcome contributions to the Edsger library. If you have any suggestions, bug reports, or feature requests, please open an issue on our [GitHub repository](https://github.com/aetperf/Edsger).
|
21
|
+
|
22
|
+
## License
|
23
|
+
|
24
|
+
Edsger is licensed under the MIT License. See the LICENSE file for more details.
|
25
|
+
|
26
|
+
## Contact
|
27
|
+
|
28
|
+
For any questions or inquiries, please contact François Pacull at [francois.pacull@architecture-performance.fr](mailto:francois.pacull@architecture-performance.fr).
|
@@ -114,23 +114,3 @@ paths = dijkstra.run(
|
|
114
114
|
heap_length_ratio=0.5
|
115
115
|
)
|
116
116
|
```
|
117
|
-
|
118
|
-
### Graph Data Format
|
119
|
-
|
120
|
-
Edsger expects graph data as a pandas DataFrame with the following structure:
|
121
|
-
|
122
|
-
| Column | Type | Description |
|
123
|
-
|--------|---------|--------------------------------------|
|
124
|
-
| tail | int | Source vertex ID |
|
125
|
-
| head | int | Destination vertex ID |
|
126
|
-
| weight | float | Edge weight (must be non-negative) |
|
127
|
-
|
128
|
-
Example:
|
129
|
-
```python
|
130
|
-
edges = pd.DataFrame({
|
131
|
-
'tail': [0, 0, 1, 2],
|
132
|
-
'head': [1, 2, 2, 3],
|
133
|
-
'weight': [1.0, 4.0, 2.0, 1.0]
|
134
|
-
})
|
135
|
-
```
|
136
|
-
|
@@ -18,12 +18,13 @@ sys.path.insert(0, os.path.abspath("../../src/"))
|
|
18
18
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
19
19
|
|
20
20
|
project = "Edsger"
|
21
|
-
copyright = "
|
21
|
+
copyright = "2025, Architecture & Performance"
|
22
22
|
author = "Francois Pacull"
|
23
23
|
|
24
24
|
# Get version from the package
|
25
25
|
try:
|
26
26
|
from edsger._version import __version__
|
27
|
+
|
27
28
|
release = __version__
|
28
29
|
version = __version__
|
29
30
|
except ImportError:
|
@@ -69,6 +70,6 @@ myst_enable_extensions = [
|
|
69
70
|
|
70
71
|
# Source suffix
|
71
72
|
source_suffix = {
|
72
|
-
|
73
|
-
|
74
|
-
}
|
73
|
+
".rst": "restructuredtext",
|
74
|
+
".md": "markdown",
|
75
|
+
}
|
@@ -2,6 +2,26 @@
|
|
2
2
|
|
3
3
|
Welcome to our Python library for graph algorithms. So far, the library only includes Dijkstra's algorithm but we should add a range of common path algorithms later. It is also open-source and easy to integrate with other Python libraries.
|
4
4
|
|
5
|
+
|
6
|
+
## Graph Data Format
|
7
|
+
|
8
|
+
Edsger expects graph data as a pandas DataFrame with the following structure:
|
9
|
+
|
10
|
+
| Column | Type | Description |
|
11
|
+
|--------|---------|--------------------------------------|
|
12
|
+
| tail | int | Source vertex ID |
|
13
|
+
| head | int | Destination vertex ID |
|
14
|
+
| weight | float | Edge weight (must be non-negative) |
|
15
|
+
|
16
|
+
Example:
|
17
|
+
```python
|
18
|
+
edges = pd.DataFrame({
|
19
|
+
'tail': [0, 0, 1, 2],
|
20
|
+
'head': [1, 2, 2, 3],
|
21
|
+
'weight': [1.0, 4.0, 2.0, 1.0]
|
22
|
+
})
|
23
|
+
```
|
24
|
+
|
5
25
|
## Dijkstra's Algorithm
|
6
26
|
|
7
27
|
To use Dijkstra's algorithm, you can import the `Dijkstra` class from the `path` module. The function takes a graph and a source node as input, and returns the shortest path from the source node to all other nodes in the graph.
|
@@ -54,7 +74,7 @@ other_edges = pd.DataFrame({
|
|
54
74
|
other_dijkstra = Dijkstra(edges, tail='from', head='to', weight='travel_time')
|
55
75
|
```
|
56
76
|
|
57
|
-
|
77
|
+
### Orientation
|
58
78
|
|
59
79
|
The `orientation` argument (a string with a default value of `'out'`) specifies the orientation of the algorithm. It can be either `'out'` for single source shortest paths or `'in'` for single target shortest path.
|
60
80
|
|
@@ -68,7 +88,7 @@ print("Shortest paths:", shortest_paths)
|
|
68
88
|
|
69
89
|
Shortest paths: [ 0. inf inf inf inf]
|
70
90
|
|
71
|
-
|
91
|
+
### Run Multiple Times
|
72
92
|
|
73
93
|
Once the Dijkstra is instantiated with a given graph and orientation, the `run` method can be called multiple times with different source vertices.
|
74
94
|
|
@@ -80,7 +100,7 @@ print("Shortest paths:", shortest_paths)
|
|
80
100
|
|
81
101
|
Shortest paths: [5. 4. 2. 1. 0.]
|
82
102
|
|
83
|
-
|
103
|
+
### Check Edges
|
84
104
|
|
85
105
|
The `check_edges` argument (a boolean with a default value of `False`) validates the given graph. When set to `True`, it ensures the DataFrame is well-formed by:
|
86
106
|
|
@@ -101,7 +121,7 @@ dijkstra = Dijkstra(invalid_edges, check_edges=True)
|
|
101
121
|
|
102
122
|
ValueError: edges['weight'] should be nonnegative
|
103
123
|
|
104
|
-
|
124
|
+
### Permute
|
105
125
|
|
106
126
|
Finally, the `permute` argument (boolean with a default value of `False`) allows to permute the IDs of the nodes. If set to `True`, the node IDs will be reindexed to start from 0 and be contiguous for the inner computations, and the output will be reindexed to the original IDs, loading the same result as if the IDs were not permuted. The permutation may save memory and computation time for large graphs, for example if a significant ratio of the nodes are not actually used in the graph.
|
107
127
|
|
@@ -140,7 +160,7 @@ shortest_paths[-5:]
|
|
140
160
|
|
141
161
|
array([0., 1., 3., 4., 5.])
|
142
162
|
|
143
|
-
|
163
|
+
### Run Method Options
|
144
164
|
|
145
165
|
The `run` method can take the following arguments besides the source/target vertex index:
|
146
166
|
|
@@ -7,7 +7,7 @@ name = "edsger"
|
|
7
7
|
dynamic = ["version"]
|
8
8
|
description = "Graph algorithms in Cython."
|
9
9
|
readme = "README.md"
|
10
|
-
requires-python = ">=3.
|
10
|
+
requires-python = ">=3.9"
|
11
11
|
license = {text = "MIT License"}
|
12
12
|
authors = [
|
13
13
|
{ name = "François Pacull", email = "francois.pacull@architecture-performance.fr" },
|
@@ -19,6 +19,11 @@ keywords = ["python", "graph", "shortest path", "Dijkstra"]
|
|
19
19
|
classifiers = [
|
20
20
|
"Development Status :: 4 - Beta",
|
21
21
|
"Programming Language :: Python :: 3",
|
22
|
+
"Programming Language :: Python :: 3.9",
|
23
|
+
"Programming Language :: Python :: 3.10",
|
24
|
+
"Programming Language :: Python :: 3.11",
|
25
|
+
"Programming Language :: Python :: 3.12",
|
26
|
+
"Programming Language :: Python :: 3.13",
|
22
27
|
"License :: OSI Approved :: MIT License",
|
23
28
|
"Operating System :: OS Independent",
|
24
29
|
"Topic :: Scientific/Engineering"
|
@@ -61,4 +66,8 @@ write_to_template = '__version__ = "{version}"'
|
|
61
66
|
[tool.pytest.ini_options]
|
62
67
|
testpaths = [
|
63
68
|
"tests"
|
64
|
-
]
|
69
|
+
]
|
70
|
+
|
71
|
+
[tool.cibuildwheel]
|
72
|
+
# Skip 32-bit i686 architectures (outdated, rarely needed)
|
73
|
+
skip = "*_i686"
|
@@ -0,0 +1 @@
|
|
1
|
+
_version.py
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.1.1"
|