{"id":46104151,"url":"https://github.com/frankvegadelgado/finlay","last_synced_at":"2026-05-22T16:02:11.221Z","repository":{"id":270846243,"uuid":"911443542","full_name":"frankvegadelgado/finlay","owner":"frankvegadelgado","description":"Aegypti: Approximate Clique Solver","archived":false,"fork":false,"pushed_at":"2026-05-19T16:56:33.000Z","size":225,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-19T19:59:23.008Z","etag":null,"topics":["approximation-algorithms","combinatorial-optimization","complexity-theory","graph-algorithms","maximum-clique","np-hard","optimization-algorithms"],"latest_commit_sha":null,"homepage":"https://frankvegadelgado.github.io/finlay/","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":"2025-01-03T03:14:11.000Z","updated_at":"2026-05-19T16:46:36.000Z","dependencies_parsed_at":"2025-02-28T17:25:44.241Z","dependency_job_id":"1321909a-cf98-4802-b225-bad55cce4878","html_url":"https://github.com/frankvegadelgado/finlay","commit_stats":null,"previous_names":["frankvegadelgado/finlay"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/frankvegadelgado/finlay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Ffinlay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Ffinlay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Ffinlay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Ffinlay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frankvegadelgado","download_url":"https://codeload.github.com/frankvegadelgado/finlay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankvegadelgado%2Ffinlay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33352383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"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","combinatorial-optimization","complexity-theory","graph-algorithms","maximum-clique","np-hard","optimization-algorithms"],"created_at":"2026-03-01T20:35:02.122Z","updated_at":"2026-05-22T16:02:11.204Z","avatar_url":"https://github.com/frankvegadelgado.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aegypti: Triangle-Free Solver\n\n![Honoring the Memory of Carlos Juan Finlay (Pioneer in the research of yellow fever)](docs/finlay.jpg)\n\nThis work builds upon [The Aegypti Algorithm](https://dev.to/frank_vega_987689489099bf/the-aegypti-algorithm-52i9).\n\n---\n\n# Triangle-Free Problem\n\nThe Triangle-Free problem is a fundamental decision problem in graph theory. Given an undirected graph, the problem asks whether it's possible to determine if the graph contains no triangles (cycles of length 3). In other words, it checks if there exists a configuration where no three vertices are connected by edges that form a closed triangle.\n\nThis problem is important for various reasons:\n\n- **Graph Analysis:** It's a basic building block for more complex graph algorithms and has applications in social network analysis, web graph analysis, and other domains.\n- **Computational Complexity:** It serves as a benchmark problem in the study of efficient algorithms for graph properties. While the naive approach has a time complexity of $O(n^3)$, there are more efficient algorithms with subcubic complexity.\n\nUnderstanding the Triangle-Free problem is essential for anyone working with graphs and graph algorithms.\n\n## Problem Statement\n\nInput: A Boolean Adjacency Matrix $M$.\n\nQuestion: Does $M$ contain no triangles?\n\nAnswer: True / False\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\nTriangle Found `(1, 3, 5)`: In Rows `3` \u0026 `5` and Columns `1` \u0026 `3`\n\n# Compile and Environment\n\n## Install Python \u003e=3.12.\n\n## Install Aegypti's Library and its Dependencies with:\n\n```bash\npip install aegypti\n```\n\n# Execute\n\n1. Go to the package directory to use the benchmarks:\n\n```bash\ngit clone https://github.com/frankvegadelgado/finlay.git\ncd finlay\n```\n\n2. Execute the script:\n\n```bash\ntriangle -i .\\benchmarks\\testMatrix1\n```\n\nutilizing the `triangle` command provided by Aegypti's Library to execute the Boolean adjacency matrix `finlay\\benchmarks\\testMatrix1`. The file `testMatrix1` represents the example described herein. We also support .xz, .lzma, .bz2, and .bzip2 compressed text files.\n\n## The console output will display:\n\n```\nSmart Algorithm for testMatrix1: Triangle Found (1, 3, 5)\n```\n\nwhich implies that the Boolean adjacency matrix `finlay\\benchmarks\\testMatrix1` contains a triangle combining the nodes `(1, 3, 5)`.\n\n---\n\n# Command Options\n\nTo display the help message and available options, run the following command in your terminal:\n\n```bash\ntriangle -h\n```\n\nThis will output:\n\n```bash\nusage: triangle [-h] -i INPUTFILE [-b] [-c] [-v] [-l] [--version]\n\nSolve the Triangle-Free Problem for an 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  -b, --bruteForce      compare with a brute-force approach using matrix multiplication\n  -c, --combinatorial   compare with the classical Chiba-Nishizeki O(m^{3/2}) adjacency-intersection baseline\n  -v, --verbose         enable verbose output\n  -l, --log             enable file logging\n  --version             show program's version number and exit\n```\n\nThis output describes all available options.\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_triangle` command, use the following in your terminal or command prompt:\n\n```bash\nbatch_triangle -h\n```\n\nThis will display the following help information:\n\n```bash\nusage: batch_triangle [-h] -i INPUTDIRECTORY [-b] [-c] [-v] [-l] [--version]\n\nSolve the Triangle-Free Problem 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  -b, --bruteForce      compare with a brute-force approach using matrix multiplication\n  -c, --combinatorial   compare with the classical Chiba-Nishizeki O(m^{3/2}) adjacency-intersection baseline\n  -v, --verbose         enable verbose output\n  -l, --log             enable file logging\n  --version             show program's version number and exit\n  ```\n\n## The Finlay Testing Application\n\nA command-line tool, `test_triangle`, has been developed for testing algorithms on randomly generated, large sparse matrices. It accepts the following options:\n\n```bash\nusage: test_triangle [-h] -d DIMENSION [-n NUM_TESTS] [-s SPARSITY] [-b] [-c] [-w] [-v] [-l] [--version]\n\nThe Finlay 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  -b, --bruteForce      compare with a brute-force approach using matrix multiplication\n  -c, --combinatorial   compare with the classical Chiba-Nishizeki O(m^{3/2}) adjacency-intersection baseline\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**This tool is designed to benchmark algorithms for sparse matrix operations.**\n\nIt generates random square matrices with configurable dimensions (`-d`), sparsity levels (`-s`), and number of tests (`-n`). While a comparison with a brute-force matrix multiplication approach is available, it's recommended to avoid this for large datasets due to performance limitations. Additionally, the generated matrix can be written to the current directory (`-w`), and verbose output or file logging can be enabled with the (`-v`) or (`-l`) flag, respectively, to record test results.\n\n---\n\n# Code\n\n- Python code by **Frank Vega**.\n\n---\n\n# License\n\n- MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankvegadelgado%2Ffinlay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrankvegadelgado%2Ffinlay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankvegadelgado%2Ffinlay/lists"}