HiPOP 2.0.0__tar.gz → 4.0.0__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.
Files changed (78) hide show
  1. {hipop-2.0.0 → hipop-4.0.0}/.clang-tidy +7 -0
  2. {hipop-2.0.0 → hipop-4.0.0}/.github/workflows/ci.yaml +1 -1
  3. {hipop-2.0.0 → hipop-4.0.0}/.github/workflows/deploy.yaml +2 -2
  4. {hipop-2.0.0 → hipop-4.0.0}/PKG-INFO +1 -1
  5. hipop-4.0.0/VERSION.txt +1 -0
  6. {hipop-2.0.0 → hipop-4.0.0}/cpp/examples/ParallelKShortestPath.cpp +11 -16
  7. hipop-4.0.0/cpp/include/hipop/create.h +62 -0
  8. {hipop-2.0.0 → hipop-4.0.0}/cpp/include/hipop/graph.h +313 -141
  9. hipop-4.0.0/cpp/include/hipop/graph_path.h +452 -0
  10. {hipop-2.0.0 → hipop-4.0.0}/cpp/include/hipop/graph_path_cost.h +10 -17
  11. hipop-4.0.0/cpp/include/hipop/iterator_util.h +134 -0
  12. {hipop-2.0.0 → hipop-4.0.0}/cpp/include/hipop/shortest_path.h +70 -45
  13. hipop-4.0.0/cpp/src/graph.cpp +433 -0
  14. {hipop-2.0.0 → hipop-4.0.0}/cpp/src/graph_path_cost.cpp +5 -6
  15. {hipop-2.0.0 → hipop-4.0.0}/cpp/src/shortest_path.cpp +295 -315
  16. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/CMakeLists.txt +2 -0
  17. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/helpers.h +40 -27
  18. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/sample_graphs.h +35 -0
  19. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testAStar.cpp +20 -18
  20. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testDijkstra.cpp +60 -35
  21. hipop-4.0.0/cpp/tests/testDijkstraSingleSource.cpp +248 -0
  22. hipop-4.0.0/cpp/tests/testGraph.cpp +833 -0
  23. hipop-4.0.0/cpp/tests/testGraphPath.cpp +577 -0
  24. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testKShortestPath.cpp +4 -3
  25. hipop-4.0.0/cpp/tests/testProjectionRange.cpp +271 -0
  26. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testYenKShortestPath.cpp +4 -3
  27. {hipop-2.0.0 → hipop-4.0.0}/pyproject.toml +1 -1
  28. {hipop-2.0.0 → hipop-4.0.0}/python/examples/UpdateCosts.py +1 -1
  29. hipop-4.0.0/python/hipop/cpp/graph.cpp +484 -0
  30. {hipop-2.0.0 → hipop-4.0.0}/python/hipop/cpp/shortest_path.cpp +16 -3
  31. {hipop-2.0.0 → hipop-4.0.0}/python/hipop/graph.py +8 -2
  32. hipop-4.0.0/python/tests/test_Graph.py +537 -0
  33. hipop-4.0.0/python/tests/test_GraphPath.py +222 -0
  34. {hipop-2.0.0 → hipop-4.0.0}/python/tests/test_ShortestPath.py +39 -24
  35. hipop-2.0.0/VERSION.txt +0 -1
  36. hipop-2.0.0/cpp/include/hipop/create.h +0 -8
  37. hipop-2.0.0/cpp/src/graph.cpp +0 -216
  38. hipop-2.0.0/cpp/tests/testDijkstraSingleSource.cpp +0 -173
  39. hipop-2.0.0/cpp/tests/testGraph.cpp +0 -612
  40. hipop-2.0.0/python/hipop/cpp/graph.cpp +0 -281
  41. hipop-2.0.0/python/tests/test_Graph.py +0 -366
  42. {hipop-2.0.0 → hipop-4.0.0}/.gitattributes +0 -0
  43. {hipop-2.0.0 → hipop-4.0.0}/.gitignore +0 -0
  44. {hipop-2.0.0 → hipop-4.0.0}/.pre-commit-config.yaml +0 -0
  45. {hipop-2.0.0 → hipop-4.0.0}/CMakeLists.txt +0 -0
  46. {hipop-2.0.0 → hipop-4.0.0}/CONTRIBUTING.md +0 -0
  47. {hipop-2.0.0 → hipop-4.0.0}/DEVELOPMENT.md +0 -0
  48. {hipop-2.0.0 → hipop-4.0.0}/LICENSE +0 -0
  49. {hipop-2.0.0 → hipop-4.0.0}/README.md +0 -0
  50. {hipop-2.0.0 → hipop-4.0.0}/cmake/ClangTidySettings.cmake +0 -0
  51. {hipop-2.0.0 → hipop-4.0.0}/cmake/IPOSettings.cmake +0 -0
  52. {hipop-2.0.0 → hipop-4.0.0}/cmake/MainSettings.cmake +0 -0
  53. {hipop-2.0.0 → hipop-4.0.0}/conda/env.yaml +0 -0
  54. {hipop-2.0.0 → hipop-4.0.0}/cpp/CMakeLists.txt +0 -0
  55. {hipop-2.0.0 → hipop-4.0.0}/cpp/cmake/HipopConfig.cmake.in +0 -0
  56. {hipop-2.0.0 → hipop-4.0.0}/cpp/examples/.clang-tidy +0 -0
  57. {hipop-2.0.0 → hipop-4.0.0}/cpp/examples/CMakeLists.txt +0 -0
  58. {hipop-2.0.0 → hipop-4.0.0}/cpp/include/hipop/string_util.h +0 -0
  59. {hipop-2.0.0 → hipop-4.0.0}/cpp/src/create.cpp +0 -0
  60. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/.clang-tidy +0 -0
  61. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testGraphMerge.cpp +0 -0
  62. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testManhattan.cpp +0 -0
  63. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testStringUtil.cpp +0 -0
  64. {hipop-2.0.0 → hipop-4.0.0}/cpp/tests/testparallelKShortestPath.cpp +0 -0
  65. {hipop-2.0.0 → hipop-4.0.0}/pyrefly.toml +0 -0
  66. {hipop-2.0.0 → hipop-4.0.0}/pytest.toml +0 -0
  67. {hipop-2.0.0 → hipop-4.0.0}/python/CMakeLists.txt +0 -0
  68. {hipop-2.0.0 → hipop-4.0.0}/python/examples/ksp.py +0 -0
  69. {hipop-2.0.0 → hipop-4.0.0}/python/examples/merge.py +0 -0
  70. {hipop-2.0.0 → hipop-4.0.0}/python/examples/render.py +0 -0
  71. {hipop-2.0.0 → hipop-4.0.0}/python/examples/test.py +0 -0
  72. {hipop-2.0.0 → hipop-4.0.0}/python/hipop/__init__.py.template +0 -0
  73. {hipop-2.0.0 → hipop-4.0.0}/python/hipop/cpp/main.cpp +0 -0
  74. {hipop-2.0.0 → hipop-4.0.0}/python/hipop/py.typed +0 -0
  75. {hipop-2.0.0 → hipop-4.0.0}/python/hipop/render.py +0 -0
  76. {hipop-2.0.0 → hipop-4.0.0}/python/hipop/shortest_path.py +0 -0
  77. {hipop-2.0.0 → hipop-4.0.0}/python/tests/test_VersionConsistency.py +0 -0
  78. {hipop-2.0.0 → hipop-4.0.0}/ruff.toml +0 -0
@@ -7,6 +7,7 @@ Checks: # See https://clang.llvm.org/extra/clang-tidy/checks/list.html
7
7
 
8
8
  - cppcoreguidelines-*
9
9
  - misc-include-cleaner # The other misc-* are worth enabling, but that would mean significant code refactoring.
10
+ - misc-non-private-member-variables-in-classes
10
11
  - modernize-*
11
12
  - performance-*
12
13
 
@@ -49,3 +50,9 @@ CheckOptions:
49
50
  # The nanobind STL headers provide the C++ <-> Python type casters through template specializations:
50
51
  # no symbol from them is referenced directly, but they must be included where the conversions happen.
51
52
  misc-include-cleaner.IgnoreHeaders: 'nanobind/stl/.*'
53
+
54
+ # Classes whose fields are ALL public are accepted as plain data structures (to avoid writing
55
+ # trivial getters). Still, this exception to the general rule should be reserved for simple small classes,
56
+ # with no abstraction, and no non-trivial logic implemented in the class.
57
+ # Complex classes MUST keep their fields private (although this check will miss them if they are all public).
58
+ misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true
@@ -41,7 +41,7 @@ jobs:
41
41
  os: # See https://docs.github.com/en/actions/reference/runners/github-hosted-runners
42
42
  - ubuntu-latest # Arch: x64
43
43
  - ubuntu-24.04-arm # Arch: arm64
44
- - windows-latest # Arch: x64
44
+ - windows-2022 # Arch: x64 FIXME Rollback to windows-latest once the fix for https://github.com/actions/runner-images/issues/15368 is available.
45
45
  - macos-latest # Arch: arm64
46
46
  python-version:
47
47
  - '3.10' # Oldest supported version (must be kept consistent with the classifiers in `pyproject.toml`).
@@ -36,8 +36,8 @@ jobs:
36
36
  os: # See https://docs.github.com/en/actions/reference/runners/github-hosted-runners
37
37
  - ubuntu-latest # Arch: x64
38
38
  - ubuntu-24.04-arm # Arch: arm64
39
- - windows-latest # Arch: x64
40
- - macos-14 # Arch: arm64
39
+ - windows-2022 # Arch: x64 FIXME Rollback to windows-latest once the fix for https://github.com/actions/runner-images/issues/15368 is available.
40
+ - macos-15 # Arch: arm64
41
41
  # Do not use the latest macOS runner to ensure backward compatibility.
42
42
  # See comment on MACOSX_DEPLOYMENT_TARGET in pyproject.toml for more details.
43
43
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: HiPOP
3
- Version: 2.0.0
3
+ Version: 4.0.0
4
4
  Summary: High Performance Optimal Path module
5
5
  Keywords: graph,graph-theory,shortest-path,dijkstra
6
6
  Maintainer-Email: Cécile Becarie <cecile.becarie@univ-eiffel.fr>
@@ -0,0 +1 @@
1
+ 4.0.0
@@ -4,6 +4,7 @@
4
4
  #include <cstdlib>
5
5
  #include <iostream>
6
6
  #include <limits>
7
+ #include <optional>
7
8
  #include <string>
8
9
  #include <unordered_map>
9
10
  #include <vector>
@@ -41,15 +42,12 @@ int main()
41
42
 
42
43
  //auto paths = hipop::parallelKShortestPath(G, origins, destinations, "time", vecMapLabelCosts, {}, 0.1, 0.95, 10, 10, kPaths, 4);
43
44
  auto paths = hipop::parallelDijkstra(G, origins, destinations, vecMapLabelCosts, "time", 1, {});
45
+ const std::optional<hipop::PathCost> &path = paths[0];
44
46
 
45
- std::cout << paths.size() << std::endl;
46
- //std::cout << paths[0].first << std::endl;
47
-
48
- if (paths.size()>0)
49
- {
50
- std::cout << "Cost: " << paths[0].second << std::endl;
51
-
52
- std::cout << "Path size: " << paths[0].first.size()<< std::endl;
47
+ if (path.has_value()) {
48
+ std::cout << "Cost: " << path->second << std::endl;
49
+ std::cout << "Path size (i.e. number of links): " << path->first.size() << std::endl;
50
+ std::cout << "Path: " << path->first << std::endl;
53
51
  }
54
52
 
55
53
  // Update costs
@@ -58,15 +56,12 @@ int main()
58
56
  G.UpdateCosts( maplinkcosts );
59
57
 
60
58
  auto paths2 = hipop::parallelDijkstra(G, origins, destinations, vecMapLabelCosts, "time", 1, {});
59
+ const std::optional<hipop::PathCost> &path2 = paths2[0];
61
60
 
62
- std::cout << paths2.size() << std::endl;
63
- //std::cout << paths[0].first << std::endl;
64
-
65
- if (paths2.size()>0)
66
- {
67
- std::cout << "Cost: " << paths2[0].second << std::endl;
68
-
69
- std::cout << "Path size: " << paths2[0].first.size()<< std::endl;
61
+ if (path2.has_value()) {
62
+ std::cout << "Cost: " << path2->second << std::endl;
63
+ std::cout << "Path size (i.e. number of links): " << path2->first.size() << std::endl;
64
+ std::cout << "Path: " << path2->first << std::endl;
70
65
  }
71
66
 
72
67
  return EXIT_SUCCESS;
@@ -0,0 +1,62 @@
1
+ #pragma once
2
+
3
+ #include <hipop/graph.h>
4
+ #include <hipop/graph_path.h>
5
+ #include <hipop/string_util.h>
6
+
7
+ #include <stdexcept>
8
+ #include <string>
9
+ #include <utility>
10
+ #include <vector>
11
+
12
+
13
+ namespace hipop {
14
+
15
+
16
+ OrientedGraph makeManhattan(int n, double linkLength);
17
+
18
+
19
+ /**
20
+ * Generate an empty path (i.e. a path with no link) relating the node corresponding to originNodeId
21
+ * to itself in the given graph.
22
+ *
23
+ * @throws std::invalid_argument if the given node ID does not exist in the graph.
24
+ */
25
+ inline OrientedGraphPath makeEmptyPath(const OrientedGraph &graph, const std::string &originNodeId) {
26
+ const Node *originNode = graph.findNode(originNodeId);
27
+ if (originNode == nullptr) {
28
+ throw std::invalid_argument(StrCat("[makeEmptyPath] Unknown node ID [", originNodeId, "]."));
29
+ }
30
+ return OrientedGraphPath(originNode);
31
+ }
32
+
33
+
34
+ /**
35
+ * Generate a path made of the links corresponding to the given link IDs in the given graph.
36
+ *
37
+ * @param linkIds Must not be empty.
38
+ * @throws std::invalid_argument if linkIds is empty, if any link ID does not exist in the graph,
39
+ * or if the sequence of links has inconsistent up/down nodes.
40
+ */
41
+ inline OrientedGraphPath makePath(const OrientedGraph &graph, const std::vector<std::string> &linkIds) {
42
+
43
+ if (linkIds.empty()) {
44
+ throw std::invalid_argument("[makePath] Link list cannot be empty.");
45
+ }
46
+
47
+ std::vector<const Link *> links;
48
+ links.reserve(linkIds.size());
49
+ for (const std::string &linkId : linkIds) {
50
+ const Link *link = graph.findLink(linkId);
51
+ if (link == nullptr) {
52
+ throw std::invalid_argument(StrCat("[makePath] Unknown link ID [", linkId, "]."));
53
+ }
54
+ links.emplace_back(link);
55
+ }
56
+
57
+ const Node *origin = links[0]->up();
58
+ return { origin, std::move(links) };
59
+ }
60
+
61
+
62
+ } // namespace hipop