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

Add utility functions for checking whether a vertex subset is dominating #105

Open
jplauri opened this issue May 3, 2020 · 1 comment
Open
Assignees

Comments

@jplauri
Copy link

jplauri commented May 3, 2020

Domination is one of the most central concepts in (algorithmic) graph theory, but there's not a lot of support for domination in IGraphM. As a start, to extend the family consisting of IGDominatorTree and IGImmediateDominators, I'd suggest adding utility functions to verify whether a given subset of vertices form a dominating set.

To check if S is a dominating set in G, we can check if S intersects the neighborhood of each vertex not in S. In Mathematica, one could write this as:

DominatingSetQ[g_, s_] := 
  !MemberQ[Intersection[s, AdjacencyList[g, #]]&/@Complement[VertexList[g], s], {}];

It also not at all common to be interested in connected dominating sets, for which a similar check could then by constructed as:

ConnectedDominatingSetQ[g_, s_] := 
  ConnectedGraphQ[Subgraph[g, s]] && DominatingSetQ[g, s];

Ultimately, I think it would be great if IGraphM also had functionality to find a minimum (connected) dominating set, the (connected) domination number and so on, but I think this should be a fine addition and a good start. At the very least, it makes it very easy for the user to write a brute-force algorithm for either problem applicable for tiny graphs.

Do you think adding these functions would make sense?

@szhorvat
Copy link
Owner

szhorvat commented May 3, 2020

These are all good suggestions. Thanks! I'll also make a few changes to make it easier to get started with development, and will send you an email during next week.

@szhorvat szhorvat self-assigned this May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants