{"id":17558070,"url":"https://github.com/valandro/python-prim","last_synced_at":"2025-04-24T05:31:53.386Z","repository":{"id":67774637,"uuid":"161061536","full_name":"valandro/python-prim","owner":"valandro","description":"PRIM algorithm implemented using Python.","archived":false,"fork":false,"pushed_at":"2018-12-21T00:32:50.000Z","size":99,"stargazers_count":5,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T07:22:17.260Z","etag":null,"topics":["graph-algorithms","prim-algorithm","python"],"latest_commit_sha":null,"homepage":"","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/valandro.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}},"created_at":"2018-12-09T17:00:03.000Z","updated_at":"2021-12-13T07:49:54.000Z","dependencies_parsed_at":"2023-02-24T13:45:22.813Z","dependency_job_id":null,"html_url":"https://github.com/valandro/python-prim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valandro%2Fpython-prim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valandro%2Fpython-prim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valandro%2Fpython-prim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valandro%2Fpython-prim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valandro","download_url":"https://codeload.github.com/valandro/python-prim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250572356,"owners_count":21452329,"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","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":["graph-algorithms","prim-algorithm","python"],"created_at":"2024-10-21T09:43:10.794Z","updated_at":"2025-04-24T05:31:53.381Z","avatar_url":"https://github.com/valandro.png","language":"Python","readme":"![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)\n\n# PRIM Algorithm\n\nIn computer science, `Prim's` (also known as Jarník's) algorithm is a greedy algorithm that finds a `minimum spanning tree for a weighted undirected graph`. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. The algorithm operates by building this tree one vertex at a time, from an arbitrary starting vertex, at each step adding the cheapest possible connection from the tree to another vertex.\n\n### Running\n\n```\npython src/prim.py examples/*.wug\n```\n\n### Weighted Undirected Graph\nExamples:\n\n**Graph 1**\n\n![Graph image](/img/graph1.png)\n\n```\n(node) (node) (distance)\n0 1 2\n0 2 3\n0 3 3\n1 2 4\n1 4 3\n2 3 5\n2 4 1\n2 5 6\n3 5 7\n4 5 8\n5 6 9\n```\n\n**Graph 2**\n\n![Graph image](/img/graph2.png)\n\n```\n(node) (node) (distance)\n0 3 4\n0 1 5\n1 2 3\n3 1 2\n3 2 6\n```\n\n**Graph 3**\n\n![Graph image](/img/graph3.png)\n\n```\n(node) (node) (distance)\n0 1 7\n0 3 5\n1 3 9\n1 2 8\n1 4 7\n2 4 5\n3 4 15\n3 5 6\n4 5 8\n4 6 9\n5 6 11\n```\n\n### License\nMIT License. [Click here for more information.](LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalandro%2Fpython-prim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalandro%2Fpython-prim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalandro%2Fpython-prim/lists"}