laurentchasserat / ford-fulkerson-ocaml

A solution for a max flow problem implemented in OCaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In this project you will find the implementation of the Ford-Fulkerson algorithm in OCaml.

The file ftest.ml contains several tests for the functions of our algorithm
To compile it --> ocamlbuild ftest.byte
To run it --> ./ftest.byte graph1 0 5 graph1out

The file flow_france.ml contains an application of the max flow problem.
It finds the maximum number of persons that can go from a city to another per day using public transportation.
Check the file "france" to see the different cities and lines between them.
The lines can have a value of (in person per day):
- 600 (bus lines)
- 15000 (train lines)
- 10000 (plane lines)
- 1000 (boat lines) 
If two lines have the same origin and destination they are merged into one edge and their values are added.
To compile it --> ocamlbuild flow_france.byte
To run it --> ./flow_france.byte france 0 8 
(for example)

Some dot graph files (such as dotGraphBefore) are generated by the tests
To convert them to png --> dot -Tpng dotGraphBefore > BeforeUpdateGraph.png
(for example)

About

A solution for a max flow problem implemented in OCaml


Languages

Language:OCaml 100.0%