Repository navigation
Conversation
|
The two references that describe the method do not comment on the time it takes. And both did extensive simulations and used this method as their default. I believe it's likely that the additional run time is trivial in the typical case of these simulations, but worst case, I don't know, and one should also consider the possibility that my implementation could be less efficient than theirs. Perhaps tomorrow I'll try to figure out the worst case complexity. Also note one preprint http://arxiv.org/abs/1305.3584 found measurable improvement using this step on large random graphs, and chose to implement it by default rather than a more interesting recursive method they apparently invented.. |
|
Your code seems good to me, except defining redundancy for G rather than dom_set is a wasteful error, so I fixed that in the gist below (tried to use Git-Hub Mac, but it did not work--no permission or ??). I also improved on my test case and added that to the test file on the same Gist. I left the old test case in there since it's not hurting anything right now. Still to do, if we had a test case that required a maximal number of postprocessing steps we could decide whether to enable that by default... although there is some logic to using the simplest greedy algorithm as long as users realize they'll do better with postprocessing, probably at minimal cost. |
|
I did find a second subtle bug that was in the original code and fixed it in my updated Gist revision to the jfinkels version that I posted above. In the denominator of the cost function we must subtract the dom_set and its neighborhoods, which is equivalent to intersecting with the remaining vertices. I've been testing the code on problems with |dom_set| of order 1500 and it works great, and the postprocessing does give an improvement at a speed cost of only 1% to 3% in the data sets I used. That's the good news. (I think this should be merged because it works and the old code really doesn't.) The bad news is for large problems our speed is not good, and I found a paper that explains the situation well |
|
I've taken a crack at implementing a heap priority queue version, and posted it on a separate file in the same Gist as above. It is fast but currently has a bug or two. With post_process = True it doesn't even always return a dominating set. I used the heapq wrapper in the docs but I eliminated the order counter because I don't think we need it, but perhaps that breaks it somehow. It does give the right answer on some small examples.... |
8787a81 to
4f750af
Compare
|
I just updated this pull request with your suggested test cases and changed the |
|
I'm in agreement except I also think it imperative to fix the cost function (line 107) ; instead of |
|
Will do, thanks.
|
4f750af to
a45fd1a
Compare
|
Okay, this branch is ready to be reviewed and merged. Any other changes by @bbphd should come in a different pull request. |
|
Well, I got the new fast version working sooner than I thought. I believe On Sun, Jul 19, 2015 at 10:22 PM, jfinkels [email protected] wrote:
|
Improves the approximate dominating set algorithm by reducing redundancy in the returned dominating set. This is an optional optimization that is disabled by default, since it comes at the expense of increased running time.
a45fd1a to
5620299
Compare
Improves the approximate dominating set algorithm by reducing redundancy
in the returned dominating set. This is an optional optimization that is
disabled by default, since it comes at the expense of increased running
time.
Fixes issue #1572 by modifying code provided by @bbphd in a comment on issue #1566. However, there are still some tasks before this can be merged, mainly to determine the running time if the postprocessing option is enabled, and whether it should be enabled by default.