Skip to content

Conversation

@Nachiket18
Copy link

@Nachiket18 Nachiket18 commented Jan 10, 2023

As per instructions from the previous PR Link. We fetch upstream the master branch , created a new branch add added the 4 files that we worked on in the previous PR to update the files.

The functionality that is being developed is calculating the Steiner tree in a graph. Steiner Tree is created on basis of subset of terminals in the graphs with the condition that length of the tree should be minimum.

We are following the approach suggested in this paper - https://arxiv.org/abs/1710.00668

Also, we are taking reference of an FPT algorithm known as Dreyfus- Wagner algorithm - https://onlinelibrary.wiley.com/doi/10.1002/net.3230010302

RonakGSahu and others added 5 commits January 9, 2023 21:23
@Nachiket18 Nachiket18 changed the title Feat/steiner Feat/Steiner Tree feature Jan 10, 2023
@Nachiket18 Nachiket18 changed the title Feat/Steiner Tree feature Feat/Steiner Tree Jan 10, 2023
@szhorvat
Copy link
Member

szhorvat commented Jan 10, 2023

Thanks, this is great, and will make it much easier to continue!

Can you please remove the accidentally committed .DS_Store files? Generally, you can look at https://github.com/igraph/igraph/pull/2288/files and check if there are any unintended changes are present.

@codecov
Copy link

codecov bot commented Jan 10, 2023

Codecov Report

❌ Patch coverage is 93.84615% with 12 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@251091a). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/paths/steiner.cpp 93.84% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2288   +/-   ##
=======================================
  Coverage        ?   84.35%           
=======================================
  Files           ?      381           
  Lines           ?    62412           
  Branches        ?    12252           
=======================================
  Hits            ?    52650           
  Misses          ?     9762           
  Partials        ?        0           
Files with missing lines Coverage Δ
src/paths/steiner.cpp 93.84% <93.84%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 251091a...24dce05. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@szhorvat szhorvat mentioned this pull request Jan 10, 2023
6 tasks
@RonakGSahu
Copy link

Just wondering if there is any further action to be taken by us.

@szhorvat
Copy link
Member

Just wondering if there is any further action to be taken by us.

Thank you, not at the moment. I also needed to deal with some other PRs. I will try to get back to this in February, but until then I'm overwhelmed.

@GroteGnoom
Copy link
Member

GroteGnoom commented Jan 28, 2023

Could you add the function to src/CMakeLists.txt and the test to tests/CMakelists.txt? Then the tests will run.

Tests you could add:

  • A graph with 1 vertex, no edges.
  • A graph with a loop connecting a vertex to itself.
  • A terminal given multiple times. What should happen?
  • CHECK_ERROR on a terminal out of bounds.

K_7_Unit graph test is currently not checked like the others.

review notes: I made a brute forcer, which confirms that the resulting trees in the tests have minimum weights.
I've put it here: https://github.com/GroteGnoom/igraph/tree/feat/steiner.

Comments on the algorithm. These are a bit preliminary, because I don't have a complete overview of how the algorithm works. But I just wanted to write things down things I noticed.

generateSubsets:

  • It overflows when 2 ^ terminals > max integer_t. We probably want to add a check for that.
  • i = 0 never produces any subsets, so can be skipped.
  • The number of subsets generated is the number of 1s in the binary representation of i, so i=1 and i=2 can only produce one subset, so they can also be skipped.
  • I also wonder if it might efficient to let j stop based on i. Probably not worth the effort.
  • Why do you need to check if a subset already exists?

fetchIndexofMapofSets:

  • Why do you add this function instead of using the at or find map methods?

steiner_dreyfus_wagner:

  • You are now also checking weights (for negative numbers, etc.) if they are not provided by the user and they are all set to 1. This is not necessary.
  • In some algorithms we do + weight[edge] if we have weights, and + 1 otherwise. In other algorithms (including this one) we generate a vector of 1 weights. This does matter for performance, but I don't know what's best here.
  • I think we leak memory in the case of no weights and no terminals. The weights are initialized, and then the function returns without destroying them because there's no terminals. The same problem occurs when no_of_terminals == no_of_nodes.
  • If negative weights are not supported, I wonder why the paper by Dreyfus and Wagner uses Floyd as a reference to find shortest paths.
  • If you don't use negative weights, are nodes that are further away from any terminal than any other terminal ever relevant?

@alekkk94
Copy link

alekkk94 commented Mar 3, 2023

Is the Steiner Tree algorithm available now in March 2023?

@ntamas
Copy link
Member

ntamas commented Mar 3, 2023

The PR is still unmerged; you can try checking out this branch and compiling it on your own if you want to use the code in this PR, but it's not in an official release yet.

@Nachiket18
Copy link
Author

Nachiket18 commented Nov 15, 2023

I was wondering whether there are more steps that have to be taken from our end for this PR in terms of testing. I was thinking if there's any update about the code review.

@GroteGnoom
Copy link
Member

Maybe I have time this weekend or the weekend after to take another look.

@GroteGnoom
Copy link
Member

I checked again, added some tests, and I can't seem to find any inputs where your algorithm goes wrong (if I remember correctly some errors could be handled better). I haven't checked the code itself, so I'll have a talk with my colleagues about merging it like this.

@GroteGnoom
Copy link
Member

All right 🥳 we will look at the code and the docs to see if it still needs work, but the functionality seems there :) So thank you for all your work, and we'll take it from here to get it merged!

@ntamas
Copy link
Member

ntamas commented Dec 9, 2023

@GroteGnoom ask me for a review when you are done with this and I'll have a final look before it is merged.

@stale
Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues that have been inactive for a long time; will be closed in the absence of further activity label Apr 26, 2025
@szhorvat szhorvat added the todo Triaged for implementation in some unspecified future version label Apr 26, 2025
@RonakGSahu
Copy link

hi, rechecking on this. if we have to do any work

@stale stale bot removed the stale Issues that have been inactive for a long time; will be closed in the absence of further activity label Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

todo Triaged for implementation in some unspecified future version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants