Add computeEdgeKBetweennessCentralities function#440
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #440 +/- ##
==========================================
+ Coverage 87.82% 88.00% +0.17%
==========================================
Files 50 50
Lines 6850 7186 +336
Branches 793 850 +57
==========================================
+ Hits 6016 6324 +308
- Misses 805 832 +27
- Partials 29 30 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Pull request overview
Adds a new edge “K-betweenness” centrality computation based on Yen’s K-shortest loopless paths (parallelized with TBB) and introduces unit tests to validate behavior for K=1 and K=2 on small graphs.
Changes:
- Implement
Network::computeEdgeKBetweennessCentralities()using Yen’s K-shortest paths with TBB parallel accumulation. - Refactor some
Networkinline accessors and internal helpers. - Add doctest coverage for
computeEdgeKBetweennessCentralities()in mobility graph tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/dsf/base/Network.hpp |
Adds Yen K-shortest-paths edge centrality implementation and refactors some inline helpers/accessors. |
test/mobility/Test_graph.cpp |
Adds tests validating K=1 consistency on a unique-path chain and K=2 increased centrality on a graph with alternative shortest paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
| ) | ||
| with open("./src/dsf/.docstrings.hpp", "w") as f: | ||
|
|
||
| with open("./src/dsf/.docstrings.hpp", "w", encoding="UTF-8") as f: |
| ) | ||
| with open("./src/dsf/.docstrings.hpp", "w") as f: | ||
|
|
||
| with open("./src/dsf/.docstrings.hpp", "w", encoding="UTF-8") as f: |
aa9d87d to
3e96682
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| std::vector<Id> nodeIds; | ||
| nodeIds.reserve(N_NODES); | ||
| for (auto const& [id, _] : m_nodes) { | ||
| nodeIds.push_back(id); | ||
| } |
computeEdgeKBetweennessCentralities functioncomputeEdgeKBetweennessCentralities function
No description provided.