Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New algorithm: dynamic approx electrical closeness #1097

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

bernlu
Copy link
Contributor

@bernlu bernlu commented Jun 27, 2023

This algorithm is based on the ApproxElectricalCloseness algorithm in networkit.
The dynamic algorithm supports:

  • edge addition. Algorithm details can be found in our recent paper (which I think is not published yet (?))
  • edge deletion. Based on the same idea as edge addition, with small changes to the math / reordering some terms.

This implementation currently does not support arbitrary edge deletions: edges on the BFS tree from the pivot element u (which is used to approximate r(u,v) for all v) may not be deleted, because this would require a larger update computation. In principle, this is possible, but for my use case this is not a problem right now. The code can easily be extended when the need arises.

Additional changes in this PR:

  • updated the description of ApproxElectricalCloseness to a more accurate description of the results properties
  • created a new GTest file which now contains the tests for the static and dynamic algorithm

Copy link
Member

@angriman angriman left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. I see that this algorithm shares a lot of data structures and code with ApproxElectricalCloseness. I'd suggest declaring DynApproxElectricalCloseness as a subclass of ApproxElectricalCloseness, so that you can re-use existing code and avoid duplication.

/**
* @note batch updates are not supported.
*/
void updateBatch([[maybe_unused]] const std::vector<GraphEvent> &batch) override {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
void updateBatch([[maybe_unused]] const std::vector<GraphEvent> &batch) override {
void updateBatch(const std::vector<GraphEvent> &) override {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants