Skip to content

Fixes approximate dominating set greedy choice. - #1566

Merged
chebee7i merged 1 commit into
networkx:masterfrom
jfinkels:approximate-minimum-domset
Jun 8, 2015
Merged

chebee7i merged 1 commit into
networkx:masterfrom
jfinkels:approximate-minimum-domset

Conversation

@jfinkels

@jfinkels jfinkels commented Jun 6, 2015

Copy link
Copy Markdown
Contributor

Before, the greedy algorithm for approximate dominating set chose each
node based on the sum of the weights in the closed neighborhood of the
node. Now it just uses the weight of the node. This fixes an issue that
causes, for example, the return value for a star graph to be all nodes
other than the center node.

Fixes issue #1527.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm fine if we want to move to having a blank line after section headings, but we should do so consistently. Can you make this docstring self-consistent, or clue me in if there is a different rationale?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, sorry, I keep forgetting that. I'll fix it.

Before, the greedy algorithm for approximate dominating set chose each
node based on the sum of the weights in the closed neighborhood of the
node. Now it just uses the weight of the node. This fixes an issue that
causes, for example, the return value for a star graph to be all nodes
other than the center node.
@jfinkels
jfinkels force-pushed the approximate-minimum-domset branch from feccdf7 to 1388437 Compare June 7, 2015 21:04
@chebee7i chebee7i added this to the networkx-1.10 milestone Jun 8, 2015
chebee7i added a commit that referenced this pull request Jun 8, 2015
Fixes approximate dominating set greedy choice.
@chebee7i
chebee7i merged commit d49733b into networkx:master Jun 8, 2015
@bbphd

bbphd commented Jun 9, 2015

Copy link
Copy Markdown

I have now implemented the post processing improvement described in a paper by Tal Grossman and Avishai Wool. It can be disabled with an argument. I found a small test case where it improves the result over the basic greedy algorithm, which does not (in this case) even give a minimal set. -Bill

Edited to remove large code block, now at https://gist.github.com/jfinkels/9ea6ef5cb50789328c42.

@jfinkels

jfinkels commented Jun 9, 2015

Copy link
Copy Markdown
Contributor Author

@bbphd Thanks for the suggestions. If you're not comfortable with using GitHub to create a pull request, it's probably best to just put code into a Gist and provide a link to it, as the code is not displayed well in comments left on GitHub issues. I can do that for you and create a new issue and pull request on your behalf.

@bbphd

bbphd commented Jun 9, 2015

Copy link
Copy Markdown

Thanks! I'll try that in the future.
I should have added some commentary on what the post-processing does:
Any node in the dominating set is redundant if its neighborhood (including itself) is a subset of the union of the neighborhoods of the other elements of the dominating set. The depth of redundancy is the smallest number of extra times any element in a node's neighborhood is covered. The most deeply redundant node is removed first--(highest cost first in case of ties). This continues until the answer is minimal (i.e., all nodes have zero redundancy).

@jfinkels

jfinkels commented Jun 9, 2015

Copy link
Copy Markdown
Contributor Author

I have some questions that I'll post on the other issue that I created for your suggested postprocessing change.

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

Development

Successfully merging this pull request may close these issues.

3 participants