{"id":50941827,"url":"https://github.com/frankvegadelgado/mids","last_synced_at":"2026-06-17T15:36:13.606Z","repository":{"id":362756733,"uuid":"1259700037","full_name":"frankvegadelgado/mids","owner":"frankvegadelgado","description":"Siriaisa: Approximate Independent Dominating Set Solver","archived":false,"fork":false,"pushed_at":"2026-06-11T15:38:14.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-17T15:36:11.428Z","etag":null,"topics":["approximation-algorithms","mids","np-hard","polynomial-algorithm","pvsnp"],"latest_commit_sha":null,"homepage":"https://frankvegadelgado.github.io/mids/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frankvegadelgado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-04T19:13:15.000Z","updated_at":"2026-06-11T15:37:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/frankvegadelgado/mids","commit_stats":null,"previous_names":["frankvegadelgado/mids"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/frankvegadelgado/mids","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Fmids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Fmids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Fmids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Fmids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frankvegadelgado","download_url":"https://codeload.github.com/frankvegadelgado/mids/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Fmids/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34453440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["approximation-algorithms","mids","np-hard","polynomial-algorithm","pvsnp"],"created_at":"2026-06-17T15:36:12.041Z","updated_at":"2026-06-17T15:36:13.595Z","avatar_url":"https://github.com/frankvegadelgado.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Siriaisa: Approximate Independent Dominating Set Solver\n\n![To my mother who I love.](docs/siriaisa.jpg)\n\nThis work builds upon [A 3-Approximation for Independent Dominating Sets: The Siriaisa Algorithm](https://github.com/frankvegadelgado/mids).\n\n---\n\n# Overview of the Minimum Independent Dominating Set (MIDS)\n\n## Definition:\n\nAn **independent dominating set** in a graph $G = (V, E)$ is a subset $D \\subseteq V$ such that no two vertices in $D$ are adjacent and every vertex not in $D$ is adjacent to at least one vertex in $D$. The **minimum independent dominating set (MIDS)** is the smallest possible independent dominating set in terms of the number of vertices.\n\n## Key Concepts:\n\n1. **Graph Representation**:\n\n   - $V$: Set of vertices.\n   - $E$: Set of edges connecting the vertices.\n\n2. **Independent Dominating Set**:\n\n   - A set $D$ where no two vertices in $D$ are adjacent, and for every vertex $v \\in V$, either $v \\in D$ or $v$ is adjacent to some vertex in $D$.\n\n3. **Minimum Independent Dominating Set**:\n   - The independent dominating set with the smallest cardinality (i.e., the fewest number of vertices).\n\n## Applications:\n\n- **Network Design**: Ensuring coverage in wireless sensor networks.\n- **Social Networks**: Identifying influential nodes.\n- **Game Theory**: Strategies in certain types of games.\n- **Biology**: Modeling protein-protein interaction networks.\n\n## Computational Complexity:\n\n- **NP-Hard**: Finding the minimum independent dominating set is computationally intensive for large graphs.\n- **Approximation Algorithms**: Used to find near-optimal solutions in polynomial time.\n\n## Algorithms:\n\n1. **Greedy Algorithm**:\n\n   - Builds a degree-four auxiliary graph, repairs the two lifted vertex seeds into maximal independent sets, and selects the smallest verified candidate.\n   - Provides the implementation studied in the 3-approximation certificate theorem.\n\n2. **Integer Linear Programming (ILP)**:\n\n   - Formulates the problem as an optimization problem.\n   - Solvable using ILP solvers for exact solutions, though computationally expensive.\n\n3. **Heuristics and Metaheuristics**:\n   - Genetic algorithms, simulated annealing, etc., for large-scale problems.\n\n## Challenges:\n\n- **Scalability**: Exact algorithms are infeasible for very large graphs.\n- **Dynamic Graphs**: Maintaining a minimum independent dominating set in graphs that change over time.\n\n## Research Directions:\n\n- **Parallel Algorithms**: Leveraging multi-core processors and distributed computing.\n- **Machine Learning**: Using learning-based approaches to predict dominating sets.\n- **Hybrid Methods**: Combining exact and heuristic methods for better performance.\n\n## Conclusion:\n\nThe minimum independent dominating set problem is a fundamental issue in graph theory with wide-ranging applications. While it is computationally challenging, various algorithms and heuristics provide practical solutions for different scenarios. Ongoing research continues to improve the efficiency and applicability of these methods.\n\n---\n\n## Problem Statement\n\nInput: A Boolean Adjacency Matrix $M$.\n\nAnswer: Find a Minimum Independent Dominating Set.\n\n### Example Instance: 5 x 5 matrix\n\n|        | c1  | c2  | c3  | c4  | c5  |\n| ------ | --- | --- | --- | --- | --- |\n| **r1** | 0   | 0   | 1   | 0   | 1   |\n| **r2** | 0   | 0   | 0   | 1   | 0   |\n| **r3** | 1   | 0   | 0   | 0   | 1   |\n| **r4** | 0   | 1   | 0   | 0   | 0   |\n| **r5** | 1   | 0   | 1   | 0   | 0   |\n\nThe input for undirected graph is typically provided in [DIMACS](http://dimacs.rutgers.edu/Challenges) format. In this way, the previous adjacency matrix is represented in a text file using the following string representation:\n\n```\np edge 5 4\ne 1 3\ne 1 5\ne 2 4\ne 3 5\n```\n\nThis represents a 5x5 matrix in DIMACS format such that each edge $(v,w)$ appears exactly once in the input file and is not repeated as $(w,v)$. In this format, every edge appears in the form of\n\n```\ne W V\n```\n\nwhere the fields W and V specify the endpoints of the edge while the lower-case character `e` signifies that this is an edge descriptor line.\n\n_Example Solution:_\n\nIndependent Dominating Set Found `1, 4`: Nodes `1` and `4` constitute an optimal solution.\n\n---\n\n# Compile and Environment\n\n## Prerequisites\n\n- Python \u003e= 3.12\n\n## Installation\n\n```bash\npip install siriaisa\n```\n\n## Execution\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/frankvegadelgado/mids.git\n   cd mids\n   ```\n\n2. Run the script:\n\n   ```bash\n   iris -i ./benchmarks/testMatrix1\n   ```\n\n   utilizing the `iris` command provided by Siriaisa's library to execute the Boolean adjacency matrix `mids\\benchmarks\\testMatrix1`. The file `testMatrix1` represents the example described herein. We also support `.xz`, `.lzma`, `.bz2`, and `.bzip2` compressed text files.\n\n   **Example Output:**\n\n   ```\n   testMatrix1: Independent Dominating Set Found 1, 4\n   ```\n\n   This indicates nodes `1, 4` form an Independent Dominating Set.\n\n---\n\n## Independent Dominating Set Size\n\nUse the `-c` flag to count the nodes in the Independent Dominating Set:\n\n```bash\niris -i ./benchmarks/testMatrix2 -c\n```\n\n**Output:**\n\n```\ntestMatrix2: Independent Dominating Set Size 2\n```\n\n---\n\n# Command Options\n\nDisplay help and options:\n\n```bash\niris -h\n```\n\n**Output:**\n\n```bash\nusage: iris [-h] -i INPUTFILE [-a] [-b] [-c] [-v] [-l] [--version]\n\nSolve the Approximate Independent Dominating Set for undirected graph encoded in DIMACS format.\n\noptions:\n  -h, --help            show this help message and exit\n  -i INPUTFILE, --inputFile INPUTFILE\n                        input file path\n  -a, --approximation   enable comparison with a polynomial-time approximation approach within a maximum degree factor\n  -b, --bruteForce      enable comparison with the exponential-time brute-force approach\n  -c, --count           calculate the size of the Independent Dominating Set\n  -v, --verbose         enable verbose output\n  -l, --log             enable file logging\n  --version             show program's version number and exit\n```\n\n---\n\n# Batch Execution\n\nBatch execution allows you to solve multiple graphs within a directory consecutively.\n\nTo view available command-line options for the `batch_iris` command, use the following in your terminal or command prompt:\n\n```bash\nbatch_iris -h\n```\n\nThis will display the following help information:\n\n```bash\nusage: batch_iris [-h] -i INPUTDIRECTORY [-a] [-b] [-c] [-v] [-l] [--version]\n\nSolve the Approximate Independent Dominating Set for all undirected graphs encoded in DIMACS format and stored in a directory.\n\noptions:\n  -h, --help            show this help message and exit\n  -i INPUTDIRECTORY, --inputDirectory INPUTDIRECTORY\n                        Input directory path\n  -a, --approximation   enable comparison with a polynomial-time approximation approach within a maximum degree factor\n  -b, --bruteForce      enable comparison with the exponential-time brute-force approach\n  -c, --count           calculate the size of the Independent Dominating Set\n  -v, --verbose         enable verbose output\n  -l, --log             enable file logging\n  --version             show program's version number and exit\n```\n\n---\n\n# Testing Application\n\nA command-line utility named `test_iris` is provided for evaluating the Algorithm using randomly generated, large sparse matrices. It supports the following options:\n\n```bash\nusage: test_iris [-h] -d DIMENSION [-n NUM_TESTS] [-s SPARSITY] [-a] [-b] [-c] [-w] [-v] [-l] [--version]\n\nThe Siriaisa Testing Application using randomly generated, large sparse matrices.\n\noptions:\n  -h, --help            show this help message and exit\n  -d DIMENSION, --dimension DIMENSION\n                        an integer specifying the dimensions of the square matrices\n  -n NUM_TESTS, --num_tests NUM_TESTS\n                        an integer specifying the number of tests to run\n  -s SPARSITY, --sparsity SPARSITY\n                        sparsity of the matrices (0.0 for dense, close to 1.0 for very sparse)\n  -a, --approximation   enable comparison with a polynomial-time approximation approach within a maximum degree factor\n  -b, --bruteForce      enable comparison with the exponential-time brute-force approach\n  -c, --count           calculate the size of the Independent Dominating Set\n  -w, --write           write the generated random matrix to a file in the current directory\n  -v, --verbose         enable verbose output\n  -l, --log             enable file logging\n  --version             show program's version number and exit\n```\n\n---\n\n# Code\n\n- Python implementation by **Frank Vega**.\n\n---\n\n# Complexity\n\n```diff\n+ Siriaisa separates feasibility from the approximation certificate: every returned set is verified as independent and dominating, while a universal proof of the 3-approximation certificate would imply P = NP by known MIDS inapproximability results.\n```\n\n---\n\n# License\n\n- MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankvegadelgado%2Fmids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrankvegadelgado%2Fmids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankvegadelgado%2Fmids/lists"}