{"id":16890303,"url":"https://github.com/orcaman/flownetwork","last_synced_at":"2025-04-11T13:09:51.908Z","repository":{"id":61927237,"uuid":"41799888","full_name":"orcaman/flownetwork","owner":"orcaman","description":"Javascript implementation of flownetwork algorithms for finding max flow in a flow network","archived":false,"fork":false,"pushed_at":"2015-09-09T21:08:40.000Z","size":281,"stargazers_count":8,"open_issues_count":1,"forks_count":5,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-25T09:21:36.970Z","etag":null,"topics":["flow-network","flownetwork-algorithms","javascript","maxflow"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/orcaman.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}},"created_at":"2015-09-02T12:32:25.000Z","updated_at":"2022-10-23T15:57:08.000Z","dependencies_parsed_at":"2022-10-23T17:15:18.922Z","dependency_job_id":null,"html_url":"https://github.com/orcaman/flownetwork","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/orcaman%2Fflownetwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orcaman%2Fflownetwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orcaman%2Fflownetwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orcaman%2Fflownetwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orcaman","download_url":"https://codeload.github.com/orcaman/flownetwork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248404935,"owners_count":21097860,"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":["flow-network","flownetwork-algorithms","javascript","maxflow"],"created_at":"2024-10-13T17:02:17.826Z","updated_at":"2025-04-11T13:09:51.886Z","avatar_url":"https://github.com/orcaman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flownetwork [![Circle CI](https://circleci.com/gh/streamrail/flownetwork.svg?style=svg)](https://circleci.com/gh/streamrail/flownetwork)\nJavascript implementation of flownetwork algorithms for finding max flow in a flow network\n\n## Live Demos\n* [Use MaxFlow for wedding guests seating arrangements](http://streamrail.github.io/flownetwork/examples/wedding/)\n* [Use MaxFlowMinCost to find alternative routes](http://streamrail.github.io/flownetwork/examples/routes/)\n\n\n## Usage\n## Find maximum flow in a network\n\n```javascript\n\t// construct a network\n\tvar fn = new FlowNetwork();\n\tfn.addEdge('s','o',3);\n\tfn.addEdge('s','p',3);\n\tfn.addEdge('o','p',2);\n\tfn.addEdge('o','q',3);\n\tfn.addEdge('p','r',2);\n\tfn.addEdge('r','t',3);\n\tfn.addEdge('q','r',4);\n\tfn.addEdge('q','t',2);\t\n\n\t// find max flow\n\tvar max = fn.maxFlow('s','t');\n```\n\n## Find maximum flow with minimum cost in a unit graph\n\n```javascript\n\t// construct a network\n\tvar fn = new FlowNetwork();\n\tfn.addEdge('s','o',1, 1);\n\tfn.addEdge('s','p',1, 2);\n\tfn.addEdge('o','p',1, 0);\n\tfn.addEdge('o','q',1, 1);\n\tfn.addEdge('p','r',1, 2);\n\tfn.addEdge('r','t',1, 0);\n\tfn.addEdge('q','r',1, 3);\n\tfn.addEdge('q','t',1, 1);\n\n\t// find max flow\n\tvar res = fn.MFCUnitGraph('s','t');\n\tvar flow = res.flow;\n\tvar cost = res.cost;\n```\n\n## Examples\n* [Use MaxFlow for wedding guests seating arrangements](https://github.com/streamrail/flownetwork/tree/master/examples/wedding)\n* [Use MaxFlowMinCost to find alternative routes](https://github.com/streamrail/flownetwork/tree/master/examples/routes)\n\n## License\nMIT (see license file)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forcaman%2Fflownetwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forcaman%2Fflownetwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forcaman%2Fflownetwork/lists"}