Skip to content

Add computeEdgeKBetweennessCentralities function#440

Merged
Grufoony merged 17 commits into
mainfrom
kBetweenness
May 6, 2026
Merged

Add computeEdgeKBetweennessCentralities function#440
Grufoony merged 17 commits into
mainfrom
kBetweenness

Conversation

@Grufoony
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 15, 2026 13:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 91.78082% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.00%. Comparing base (2f84b50) to head (0be3cc3).

Files with missing lines Patch % Lines
src/dsf/mobility/RoadNetwork.cpp 10.52% 17 Missing ⚠️
src/dsf/base/Network.hpp 94.64% 12 Missing ⚠️
test/mobility/Test_graph.cpp 99.18% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
unittests 88.00% <91.78%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Network inline 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.

Comment thread src/dsf/base/Network.hpp Outdated
Comment thread src/dsf/base/Network.hpp Outdated
Comment thread src/dsf/base/Network.hpp
Comment thread src/dsf/base/Network.hpp Outdated
Comment thread src/dsf/base/Network.hpp
Comment thread src/dsf/base/Network.hpp Outdated
Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread setup.py
)
with open("./src/dsf/.docstrings.hpp", "w") as f:

with open("./src/dsf/.docstrings.hpp", "w", encoding="UTF-8") as f:
Comment thread setup.py
)
with open("./src/dsf/.docstrings.hpp", "w") as f:

with open("./src/dsf/.docstrings.hpp", "w", encoding="UTF-8") as f:
@Grufoony Grufoony marked this pull request as draft April 27, 2026 16:00
@Grufoony Grufoony force-pushed the kBetweenness branch 5 times, most recently from aa9d87d to 3e96682 Compare April 28, 2026 15:29
@Grufoony Grufoony marked this pull request as ready for review May 5, 2026 14:35
@Grufoony Grufoony requested a review from Copilot May 5, 2026 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/dsf/base/Network.hpp Outdated
Comment thread src/dsf/base/Network.hpp
Comment thread src/dsf/mobility/RoadNetwork.cpp
Comment thread test/mobility/Test_graph.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/dsf/base/Network.hpp
Comment thread src/dsf/base/Network.hpp
Comment thread src/dsf/base/Network.hpp Outdated
Comment thread src/dsf/base/Network.hpp
Comment on lines +812 to +816
std::vector<Id> nodeIds;
nodeIds.reserve(N_NODES);
for (auto const& [id, _] : m_nodes) {
nodeIds.push_back(id);
}
Comment thread src/dsf/base/Network.hpp
Comment thread src/dsf/base/Network.hpp
Comment thread src/dsf/mobility/RoadNetwork.cpp
Comment thread src/dsf/base/Network.hpp
@Grufoony Grufoony changed the title Init computeEdgeKBetweennessCentralities function Add computeEdgeKBetweennessCentralities function May 6, 2026
@Grufoony Grufoony merged commit 3a78eea into main May 6, 2026
@Grufoony Grufoony deleted the kBetweenness branch May 6, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants