{"id":24719300,"url":"https://github.com/simon-gardier/graph-flow","last_synced_at":"2025-03-22T11:42:20.038Z","repository":{"id":226827753,"uuid":"769733730","full_name":"simon-gardier/graph-flow","owner":"simon-gardier","description":"🔀 Flow visualization in graphs using Ford Fulkerson algorithm","archived":false,"fork":false,"pushed_at":"2024-06-05T16:29:45.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T11:17:19.711Z","etag":null,"topics":["data-science","graph-algorithms","math0499","networkx","python"],"latest_commit_sha":null,"homepage":"https://fr.wikipedia.org/wiki/Algorithme_de_Ford-Fulkerson","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simon-gardier.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":"2024-03-09T22:38:47.000Z","updated_at":"2024-06-05T16:29:48.000Z","dependencies_parsed_at":"2024-03-19T11:55:41.006Z","dependency_job_id":"764a6f84-c8ca-4f93-b445-3e9d5201c352","html_url":"https://github.com/simon-gardier/graph-flow","commit_stats":null,"previous_names":["sgardier/ford_fulkerson","simon-gardier/ford-fulkerson-algo","simon-gardier/graph-flow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fgraph-flow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fgraph-flow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fgraph-flow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simon-gardier%2Fgraph-flow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simon-gardier","download_url":"https://codeload.github.com/simon-gardier/graph-flow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244952554,"owners_count":20537467,"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":["data-science","graph-algorithms","math0499","networkx","python"],"created_at":"2025-01-27T11:17:21.239Z","updated_at":"2025-03-22T11:42:20.013Z","avatar_url":"https://github.com/simon-gardier.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔀 Ford-Fulkerson algorithm\n![Release](https://img.shields.io/badge/Release-v1.0-blueviolet?style=for-the-badge)\n![Language](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)\n\nPython project developped for the graph theory course (MATH0499) given by Pr. Rigo, ULiège.\u003cbr\u003e\nThe final mark for this project is 19/20.\n\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"ressources/flow1.png\" alt=\"Flow example\" style=\"width: 60%;\"/\u003e\n\u003c/div\u003e\n\nThe Ford-Fulkerson algorithm is a graph algorithm used to determine the maximum flow from a source node to a sink node. It can also be used to calculate if a minimum flow can flow through an entire network.\n\nUsing the -g option (see [Examples](#examples)), you can visualize the flow in the graph.\nThe lighter the color of an edge, the more saturated it is.\n\n\n## Summary\n1. [Required Modules](#required-modules)\n2. [Project structure](#project-structure)\n3. [Examples](#examples)\n4. [Technical Specifics](#technical-specifics)\n5. [Credits](#credits)\n\n## Required modules\n- NetworkX [https://pypi.org/project/networkx/](https://pypi.org/project/networkx/)\n- Matplotlib\n- Pylab\n\n## Project structure\n- ./\n  - main.py: Main script\n  - ford_fulkerson.py: Script containing the Ford-Fulkerson algorithm and pre-processing functions for loading files into Graph() objects\n  - display.py: Script for displaying graphs via matplotlib\n  - utils.py: Script for creating random graphs of any size\n\n## Examples\n1. **Finding the maximum flow from s to t in an existing file**\n    ```console\n    python3 main.py -i filename.txt -s s -t t\n    ```\n\n2. **Finding the maximum flow from s to t in an existing file and displaying the residual graph in a window**\n    ```console\n    python3 main.py -i filename.txt -s s -t t -g\n    ```\n\n3. **Finding the maximum flow from multiple sources to t in an existing file**\n    ```console\n    python3 main.py -i filename.txt -s \"s_1 s_2 s_3 s_n\" -t t\n    ```\n\n4. **Finding the maximum flow from multiple sources to multiple sinks in an existing file**\n    ```console\n    python3 main.py -i filename.txt -s \"s_1 s_2 s_3 ... s_n\" -t \"t_1 t_2 ... t_k\"\n    ```\n\n5. **Finding the maximum flow from s to t in a randomly generated file with n vertices**\n    ```console\n    python3 main.py -r n -s s -t t\n    ```\n\n## Technical specifics\n- Randomly generated graphs are systematically stored in ./example_random_graph.txt\n- Graphs are stored in Edge List files (see [NetworkX Edge List documentation](https://networkx.org/documentation/stable/reference/readwrite/edgelist.html))\n\n## Credits\n- [Simon Gardier](https://github.com/simon-gardier) (Co-author)\n- Camille Trinh (Co-author)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-gardier%2Fgraph-flow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimon-gardier%2Fgraph-flow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-gardier%2Fgraph-flow/lists"}