- Delete `calculate_degrees_and_edges_adj_serial` function and related threshold logic in modularity.cpp; always invoke parallel calculation function
- Optimize center selection, empty graph handling, neighbor traversal, and numerical computation logic in localsearch.cpp
- Fix several edge cases and add automatic center number selection logic
- localsearch: replace C++17 structured binding with std::tie for C++14
compatibility (parent/dist destructuring in BFS queue)
- louvain / motif / graph_coloring: detect OpenMP support via _OPENMP
macro and emit a clear runtime warning when OpenMP is unavailable,
falling back to serial execution gracefully
- modularity: handle edge cases (empty node list, edgeless graph) by
returning 0.0 and skip zero-degree nodes without division-by-zero
- tests/: add a complete unittest suite covering modularity,
greedy_modularity, enumerate_subgraph, louvain (parallel + serial),
LPA, ego_graph (+ CSR variant), and localsearch, plus a run_all_tests.py
entry point with a friendly summary
Add C++ implementations of community detection algorithms such as LPA, Greedy Modularity, Louvin, and Local Search, as well as tool functions like ego_graph, motif enumeration , and modularity calculation.
The C++ code was using `operator==` to check if a pybind11 object was
`py::none()`. This is deprecated because it maps to Python's `__eq__` (equality)
check, not the `is` (identity) check, which can lead to incorrect behavior.
This commit updates the check to use the `.is()` method, as recommended by
the pybind11 documentation. This ensures a correct identity check against
the `None` singleton and silences associated compiler deprecation warnings.
The `register` storage class specifier is a legacy C++ feature that has been
ignored by modern compilers for years. It was officially deprecated in C++11
and removed entirely in the C++17 standard.
This commit removes all instances of `register` from the C++ codebase. This
modernizes the code, improves its clarity, and eliminates compiler warnings
without any impact on performance.
The pybind11 Git submodule was pointing to an older commit. To ensure
compatibility with modern C++ standards and compilers, and to leverage
the latest features and bug fixes, the submodule has been updated.
This brings the project in line with the latest stable release of pybind11,
improving maintainability and reducing potential build issues.