{"id":29826651,"url":"https://github.com/infinityofspace/efficient_kruskal","last_synced_at":"2025-10-05T15:42:10.333Z","repository":{"id":208614123,"uuid":"308157563","full_name":"infinityofspace/efficient_kruskal","owner":"infinityofspace","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-22T20:21:43.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T17:56:29.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/infinityofspace.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}},"created_at":"2020-10-28T22:37:09.000Z","updated_at":"2023-11-22T10:17:48.000Z","dependencies_parsed_at":"2023-11-22T12:29:06.829Z","dependency_job_id":"13cdf3c3-f62e-40af-be08-3b317fe72da4","html_url":"https://github.com/infinityofspace/efficient_kruskal","commit_stats":null,"previous_names":["infinityofspace/efficient_kruskal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/infinityofspace/efficient_kruskal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fefficient_kruskal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fefficient_kruskal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fefficient_kruskal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fefficient_kruskal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinityofspace","download_url":"https://codeload.github.com/infinityofspace/efficient_kruskal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinityofspace%2Fefficient_kruskal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278477817,"owners_count":25993540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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":[],"created_at":"2025-07-29T05:11:25.678Z","updated_at":"2025-10-05T15:42:10.302Z","avatar_url":"https://github.com/infinityofspace.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Kruskal\n\nThe Kruskal algorithm defined in the kruskal module computes the minimal spanning tree of a provided Graph object in O(|E| log |V|) time.\nThis implementation compares the efficiency (runtime) of the algorithm in different implementation variants. For the results consider \nthe [Benchmark](#benchmark) section.\n\n### Usage:\n\nGo into the project directory (the directory which contains this Readme file). You can run the different example with\nthe following command:\n\n```commandline\npython -m efficient_kruskal.examples.\u003cthe-example-name\u003e\n```\n\nReplace the \u003cthe-example-name\u003e the specific name.\n\nFor example, to start the graph_1 example the run command is:\n\n```commandline\npython -m efficient_kruskal.examples.graph_1\n```\n\n### Modules:\n\nThe module efficient_kruskal consists of multiple modules.\n\n#### examples\n\nThis module consists of 3 predefined graphs and an image of the graph. The Python script graph_random.py allows you to\ngenerate a random graph and perform several performance benchmarks. It takes the number of nodes to generate in the\ngraph and allows you to store the generated graph or load a previous generated graph. There is also a file called\nbenchmark_results.txt which contains a simple overview of a benchmark with different node numbers.\n\n#### kruskal\n\nThere are 2 different implementations for the algorithm. The first called kruskal_slow uses a simple adjacency matrix as\ndata structure and perform a depth first search to check if a cycle was created. The second implementation is called\nkruskal and uses the disjoint data structure implemented in the util module.\n\n#### util\n\nThis module contains the Graph object which provides some simple methods to print or add new edges. Also in this module\nthe mergesort algorithm is implemented. This exists in a parallel and non-parallel implementation. In addition, the\nmodule contains the implementation of the disjoint data set.\n\n## Benchmark\n\nYou can test the performance of different sort and data structure implementations with the graph_random.py script.\nThe script allows you to generate a random graph and perform several performance benchmarks.\n\nExample benchmark with 100 runs and 500 nodes:\n```commandline\npython -m efficient_kruskal.examples.graph_random --nodes 500 --runs 100\n```\n\nAll options:\n```commandline\npython -m efficient_kruskal.examples.graph_random --help\n```\n\n```commandline\nusage: graph_random.py [-h] [--nodes NODES] [--save SAVE] [--graph GRAPH] [--format FORMAT] [--seed SEED] [--runs RUNS]\n\noptions:\n  -h, --help            show this help message and exit\n  --nodes NODES, -n NODES\n                        Number of unique nodes in the graph.\n  --save SAVE, -s SAVE  Store the random generated graph to the provided file path.\n  --graph GRAPH, -g GRAPH\n                        Load the graph from the provided file path.\n  --format FORMAT, -f FORMAT\n                        Number of digits formatted duration logging.\n  --seed SEED           Seed to use for random init\n  --runs RUNS, -r RUNS  Number of runs\n```\n\nYou can find some results in the `results_*.txt` files calculate on an 6 core 3.8GHz CPU.\n\n## License\n\n[MIT](License) - Copyright (c) 2023 Marvin Heptner\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityofspace%2Fefficient_kruskal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinityofspace%2Fefficient_kruskal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinityofspace%2Fefficient_kruskal/lists"}