{"id":17373166,"url":"https://github.com/dabendorf/inf234-programmes","last_synced_at":"2025-08-16T23:44:00.607Z","repository":{"id":87211122,"uuid":"430649615","full_name":"Dabendorf/INF234-Programmes","owner":"Dabendorf","description":"Heaps of different algorithms being useful for the UiB course INF234 Algorithms","archived":false,"fork":false,"pushed_at":"2022-06-14T09:48:02.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T03:19:55.506Z","etag":null,"topics":["algorithms","dynamic-programming","graphs-algorithms","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dabendorf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-11-22T09:52:01.000Z","updated_at":"2022-06-14T09:47:10.000Z","dependencies_parsed_at":"2023-03-18T02:36:07.382Z","dependency_job_id":null,"html_url":"https://github.com/Dabendorf/INF234-Programmes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Dabendorf/INF234-Programmes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabendorf%2FINF234-Programmes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabendorf%2FINF234-Programmes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabendorf%2FINF234-Programmes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabendorf%2FINF234-Programmes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dabendorf","download_url":"https://codeload.github.com/Dabendorf/INF234-Programmes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dabendorf%2FINF234-Programmes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270786186,"owners_count":24644559,"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-08-16T02:00:11.002Z","response_time":91,"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":["algorithms","dynamic-programming","graphs-algorithms","python3"],"created_at":"2024-10-16T02:35:53.304Z","updated_at":"2025-08-16T23:44:00.555Z","avatar_url":"https://github.com/Dabendorf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Programmes useful for INF234 course at UiB\nThis repository includes a lot of algorithms being useful for the UiB course [``INF234 Algorithms``](https://www.uib.no/en/course/INF234)\n\n# Programmes\n* ``BellmanFord.py``: Solving a distance problem with Bellman-Ford\n* ``BellmanFordLong.py``: Solving a distance problem with Bellman-Ford printing states\n* ``DFStime.py``: DFS including prefix order\n* ``Dijkstra.py``: Solving a distance problem with Dijkstra\n* ``EditDistance.py``: Calculating the EditDistance between two words\n* ``FordFulkerson.py``: Finding the flow with FordFulkerson\n* ``FordFulkersonInner.py``: Finding the flow with FordFulkerson by starting at one inner state\n* ``GraphMST.py``: Solving Minimum Spanning Tree with Kruskal\n* ``GraphMST2.py``: Solving Minimum Spanning Tree using networkx\n* ``Hufman.py``: Calculates Hufman code\n* ``HufmanWithoutWord.py``: Calculates Hufman Tree without generating the code\n* ``Knapsack.py``: Solving a Knapsack problem\n* ``ShortestDistance.py``: Calculates the EditDistance between two strings\n* ``SubsetSum.py``: Solving a SubSet sum problem (special case of Knapsack)\n\n# How to use them\n## Subset sum\n``python SubsetSum.py 20 3S4S5S7S11``\u003cbr\u003e\nParameter: max weight, sequence of weights (separator: S)\u003cbr\u003e\nAttention: List of elements doesn't work, use Knapsack\n\n## Knapsack\n``python Knapsack.py 20 3S4S5S7S11 3S4S5S7S11``\u003cbr\u003e\n``python Knapsack.py 10 4S4S5S3S2S6 10S11S14S6S5S14``\u003cbr\u003e\nParameter: max weight, sequence of weights (separator: S), sequence of values (S)\u003cbr\u003e\nSubset sum by setting weights and values equal\n\n## Minimum Spannung tree\nTwo programmes: GraphMST self programmed Kruskal\u003cbr\u003e\nGraphMST2 is framework implementation of Prim and Kruskal\u003cbr\u003e\nGraphMST only accepts numbers as node names\u003cbr\u003e\n``python GraphMST.py``\u003cbr\u003e\n``python GraphMST2.py``\n\n## Edit distance\nTakes as input two words\u003cbr\u003e\nCalculates control value via Levensthein framework\u003cbr\u003e\n``python EditDistance.py klinger klingre``\n\n## BellmanFord\nCalculates shortest path in graph\u003cbr\u003e\nInput path lengths in code\u003cbr\u003e\nDoes not output internal table\u003cbr\u003e\nLong version has output\u003cbr\u003e\n``python BellmanFord.py``\u003cbr\u003e\n``python BellmanFordLong.py``\n\n## Dijkstra\nShortest path without negative edges\u003cbr\u003e\nInput path lengths in code\u003cbr\u003e\nArgument is start node\u003cbr\u003e\n``python Dijkstra.py a``\n\n## FordFulkerson\nTwo programmes, one for the entire algorithm and one for one iteration\u003cbr\u003e\n\u003cbr\u003e\nEntire programme: insert edge weights in tuple orig_cap\u003cbr\u003e\n``python FordFulkerson.py``\u003cbr\u003e\n\u003cbr\u003e\nJust one iteration, three lists (third redundant, sorry)\u003cbr\u003e\n* orig_cap: edge weights in original graph\u003cbr\u003e\n* g_edges_used: used flow at the moment\u003cbr\u003e\n* g_f_edges: all edges of residual graph\u003cbr\u003e\n``python FordFulkersonInner.py``\n\n## Hufman\ninsert string as argument, spaces with \"_\" string\nMake sure the | are positioned like Pål wants them to be (like at beginning or end of word)\u003cbr\u003e\nSecond programme without words, but frequencies\u003cbr\u003e\n``python HufmannTree.py testiest_sensitiveness``\u003cbr\u003e\n``python HufmanWithoutWord.py``\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabendorf%2Finf234-programmes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdabendorf%2Finf234-programmes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabendorf%2Finf234-programmes/lists"}