Problem Overview
The Minimum Dominating Set (MDS) problem is a classic challenge in graph theory and computer science. Given an undirected graph , the goal is to find a subset of vertices of minimum size such that every vertex in is either in or adjacent to at least one vertex in . This subset is called a dominating set, and the MDS seeks the smallest possible such set.
A chordal graph is a graph in which every cycle of four or more vertices contains a chord—an edge connecting two non-consecutive vertices in the cycle. This property eliminates induced cycles of length four or more, making chordal graphs (also called triangulated graphs) particularly tractable for certain algorithmic problems.
- Input: An undirected graph , where is the set of vertices and is the set of edges.
- Output: A subset of minimum cardinality that dominates .
- Complexity: The MDS problem is NP-hard for general graphs, meaning no polynomial-time algorithm is known unless P = NP (Karp, Richard M. "Reducibility among Combinatorial Problems." In Complexity of Computer Computations, edited by R. E. Miller, J. W. Thatcher, and J. D. Bohlinger, 85–103. New York: Plenum, 1972. doi: 10.1007/978-1-4684-2001-2_9). However, for specific graph classes, such as chordal graphs, it can be solved efficiently (in linear time) (Booth, Kellogg S., and J. Howard Johnson. "Dominating Sets in Chordal Graphs." SIAM Journal on Computing 11, no. 1 (1982): 191–199. doi: 10.1137/0211015): This article is available for free access at this https://cs.uwaterloo.ca/research/tr/1980/CS-80-34.pdf.
Algorithm Description
The provided algorithm, implemented in Python using NetworkX, computes the MDS for a general undirected graph by transforming it into a chordal graph, where the MDS can be solved in linear time.
Minimum Dominating Set Algorithm
Below is the Python implementation of the find_dominating_set
algorithm using NetworkX. This algorithm computes the minimum dominating set of an undirected graph by transforming it into a chordal graph and leveraging a linear-time solution for chordal graphs.
import networkx as nx
def find_dominating_set(graph):
if not isinstance(graph, nx.Graph):
raise ValueError("Input must be an undirected NetworkX Graph.")
if graph.number_of_nodes() == 0 or graph.number_of_edges() == 0:
return set()
optimal_dominating_set = set(nx.isolates(graph))
graph.remove_nodes_from(optimal_dominating_set)
if graph.number_of_nodes() == 0:
return optimal_dominating_set
dominance = {i: frozenset(list(graph.neighbors(i)) + [i]) for i in graph.nodes()}
chordal_graph = nx.Graph()
for i in graph.nodes():
chordal_graph.add_edge((i, i), (i, dominance[i]))
for j in graph.neighbors(i):
if i < j:
chordal_graph.add_edge((j, j), (i, dominance[i]))
chordal_graph.add_edge((i, i), (j, dominance[j]))
for i in graph.nodes():
for j in graph.nodes():
if i < j:
chordal_graph.add_edge((i, i), (j, j))
tuple_nodes = minimum_dominating_set_in_chordal_graph(chordal_graph)
optimal_dominating_set.update({tuple_node[0] for tuple_node in tuple_nodes})
return optimal_dominating_set
Here’s a step-by-step description:
-
Input Validation:
- Checks if the input is a valid
nx.Graph
. Raises aValueError
if not.
- Checks if the input is a valid
-
Handle Special Cases:
- Returns an empty set if the graph has no nodes or no edges.
- Identifies isolated nodes (vertices with degree 0) using
nx.isolates(graph)
, adds them to the dominating set , and removes them from the graph. If the graph becomes empty, returns .
-
Graph Transformation:
- Optimize by precomputing the
dominance
dictionary: Calculate the closed neighborhood for each vertex once and store it in a dictionary. This avoids redundant calculations in each iteration, improving efficiency. - Constructs a new graph
chordal_graph
(assumed to be chordal) with tuple nodes:- For each vertex , creates nodes and , where (the closed neighborhood).
- Adds edges:
- to for each .
- For each edge with :
- to .
- to .
- to for all , forming a clique among nodes.
- Optimize by precomputing the
-
Compute MDS in Chordal Graph:
- Calls
minimum_dominating_set_in_chordal_graph(chordal_graph)
(assumed to run in linear time) to find the MDS in the transformed graph, returning a set of tuple nodes .
- Calls
-
Map Back to Original Graph:
- Extracts the first component of each tuple in (i.e., ) and adds them to , which already includes isolated nodes.
- Returns as the MDS of .
Correctness Analysis
The algorithm’s correctness hinges on two claims:
- The transformed graph is chordal, allowing an efficient MDS computation.
- The MDS of the chordal graph corresponds to the MDS of the original graph.
Key Points:
- Isolated Nodes: Correctly included in since they must be dominated and have no neighbors.
-
Chordal Property: The new constructed graph
chordal_graph
is chordal (every cycle of length 4 or more has a chord), enabling efficient computation of the Minimum Dominating Set (MDS). The clique of Type 1 nodes (e.g., ) and structured Type 2 connections (e.g., ) ensure this. The Type 1 nodes form a clique, which is trivially chordal. Any cycle involving Type 2 nodes must include their neighbors and . Since all Type 1 nodes are interconnected (forming a clique), every cycle longer than 3 has a chord. Thus,chordal_graph
is chordal. -
Domination in
:
- For a vertex :
- If or is in , then , and is dominated.
- If neither is in
,
must be dominated in
chordal_graph
. Its neighbors include (where is a neighbor of ) and all . If any such node is in , , and if is adjacent to in , is dominated. - The clique among nodes ensures connectivity, and edges to preserve ’s structure.
-
Minimality:
- The Minimum Dominating Set (MDS) minimizes
. If the algorithm produces a dominating set
and a smaller dominating set
exists in the graph, then the set
would dominate all nodes in
chordal_graph
, contradicting the minimality of .
- The Minimum Dominating Set (MDS) minimizes
. If the algorithm produces a dominating set
and a smaller dominating set
exists in the graph, then the set
would dominate all nodes in
-
Guarantee the Appropriate Solution:
- When deciding between selecting
or
, choosing either has the same significance. This is because we extract from
and
the first coordinate in the tuple, i.e., the node
. Consequently, the transformation encodes
’s domination constraints such that the MDS in
chordal_graph
maps to a minimal set in .
- When deciding between selecting
or
, choosing either has the same significance. This is because we extract from
and
the first coordinate in the tuple, i.e., the node
. Consequently, the transformation encodes
’s domination constraints such that the MDS in
Conclusion:
Assuming minimum_dominating_set_in_chordal_graph
correctly finds the MDS, the algorithm produces a valid MDS for
. The transformation preserves domination relationships, and the inclusion of isolated nodes.
Running Time Analysis
Let (number of vertices) and (number of edges) in the original graph .
- Input Validation: using isinstance check.
-
Special Cases:
-
graph.number_of_nodes()
andgraph.number_of_edges()
: in NetworkX. -
nx.isolates(graph)
: to check degrees. - Removing nodes: in worst case.
-
-
Transformation:
-
Time complexity of precomputing the
dominance
dictionary: Constructing the dictionary requires time, as it involves iterating over all nodes and, for each node, retrieving its neighbors, which can take up to time per node in the worst case. - Nodes: tuple nodes created (2 per vertex, but constant factor).
-
Edges:
- to : .
- For each with : edges added.
- Clique edges to : for pairs.
- Computing : , total across all .
- Total for
chordal_graph
: edges, construction time .
-
Time complexity of precomputing the
-
MDS in Chordal Graph:
- , .
- Assumed linear time: .
- Mapping Back: to extract and update .
Total Running Time:
- Dominant term: from clique edges and chordal MDS computation.
- Overall: , quadratic in the number of vertices.
Notes:
- We implement a solution for finding the minimum dominating set in chordal graphs using Mixed Integer Linear Programming (MILP) techniques, as detailed here. Although this approach has a worse time complexity compared to the well-known linear-time algorithm for this problem, it serves to validate the correctness of the algorithm for small to medium-sized graphs. The complete Python implementation is available via
pip install baldor
and can be found in Baldor: Minimum Dominating Set Solver.
Conclusion
This algorithm resolves MDS in time, suggesting and delivering practical benefits across diverse fields, including artificial intelligence, medicine, and impact in the industries. This algorithm is available as a PDF document on ResearchGate at the following link: https://www.researchgate.net/publication/389992967_A_Quadratic-Time_Solution_to_the_Minimum_Dominating_Set_Problem_A_Breakthrough_Algorithm.
Top comments (0)