Dépôt du be Ocaml 4IR
Find a file
2020-12-07 16:17:29 +01:00
.github/workflows use provided base project 2020-11-03 16:06:32 +01:00
.vscode use provided base project 2020-11-03 16:06:32 +01:00
circulation_input_graphs add circulation problem resolution 2020-11-24 15:20:02 +01:00
graphs add circulation problem resolution 2020-11-24 15:20:02 +01:00
src improve build process 2020-12-07 16:17:29 +01:00
.gitignore add circulation problem resolution 2020-11-24 15:20:02 +01:00
.merlin use provided base project 2020-11-03 16:06:32 +01:00
_tags use provided base project 2020-11-03 16:06:32 +01:00
Makefile improve build process 2020-12-07 16:17:29 +01:00
README.md improve build process 2020-12-07 16:17:29 +01:00

BE OCAML 4IR

Group

  • SIMARD Yohan
  • VERGNET Arnaud

Description

Ocaml project on Ford-Fulkerson. This project contains some simple configuration files to facilitate editing Ocaml in VSCode.

This project can compile 2 executables:

  • ftest.native, the base FF algorithm implementation
  • circulationtest.native, a circulation-demand problem solved by the use of the FF algorithm. The problem can be found on Wikipedia.

Use in VSCode

To use in VSCode, you should install the OCaml extension in VSCode. Other extensions might work as well but make sure there is only one installed. Then open VSCode in the root directory of this repository.

Features :

  • full compilation as VSCode build task (Ctrl+Shift+b)
  • highlights of compilation errors as you type
  • code completion
  • automatic indentation on file save

Setup

This project uses the Graphviz library to render svg graphs. To install it, simply type :

sudo apt install graphviz

Build and Run

A makefile provides some useful commands:

  • make build to compile the base ff algorithm. This creates an ftest.native executable
  • make test to run the ftest program with only the infile (executes tests on it) and generate svg files for each tests. This uses the graph1 in the graphs folder and outputs in the test folder.
  • make demo to run the ftest program with some arguments and generate the final svg file. This uses graphs in the graphs folder and outputs in the run folder.
  • make build_circulation to compile the circulation-demand problem resolution. This creates a circulationtest.native executable
  • make demo_circulation to run the circulationtest program with some arguments and generate the final svg file. This uses graphs in the circulation_input_graphs folder and outputs in the run folder.
  • make format to indent the entire project
  • make clean to remove build artifacts

In case of trouble with the VSCode extension (e.g. the project does not build, there are strange mistakes), a common workaround is to (1) close vscode, (2) make clean, (3) make build and (4) reopen vscode.