Skip to content

Latest commit

Β 

History

History
83 lines (61 loc) Β· 2.56 KB

README.md

File metadata and controls

83 lines (61 loc) Β· 2.56 KB

Aquaeductus Optimus assignment

Abstract πŸ—’οΈ:

Given a set of points (p), a maximum height of an aquaeduct (h) and a beta and alpha cost variables, gives the minimum cost of the possible aqueduct and if it doesn't exists, prints impossible.

The solution of this problem has been solved with three variants: greedy, backtracking and dynamic programming.

The better solution for this problem is the dynamic programming one, which is based on the principle of optimality of Bellman. The asymptotic function of this algorithm is O(n^3).

If you would like to know more about how it works, I would totally recommend reading the report of this assignment, which is found in documentation/informe.pdf.

The repository can be found on: https://github.com/Algorismia/Aquaeductus-Optimus

Project structure πŸ“:

.
β”œβ”€β”€ cpp                 --> cpp code (iterative version) 
β”‚Β Β  β”œβ”€β”€ backtracking    
β”‚Β Β  β”œβ”€β”€ dynamic         
β”‚Β Β  └── greedy          
β”œβ”€β”€ documentation       --> report of the assignment in .pdf and .tex (just in case you want to contribute or read how some resources were done)
β”œβ”€β”€ python              --> python code (iterative and recursive version)
β”œβ”€β”€ python
β”‚Β Β  β”œβ”€β”€ backtracking
β”‚Β Β  β”œβ”€β”€ common          --> where common classes and methods are saved.
β”‚Β Β  β”œβ”€β”€ dynamic
β”‚Β Β  └── greedy
β”œβ”€β”€ README.md
└── test                --> test files
    β”œβ”€β”€ backtracking
    β”œβ”€β”€ dynamic
    └── greedy

Running tests πŸƒ:

Python

If you want to run the tests (for the iterative version) and the code analysis tool (pylint for the recursive and iterative version) do:

    $ make test

If you would like to run only the test of the iterative version:

    $ make iterative

If you want to run the RECURSIVE tests, do:

    $ make recursive

If you would like to run just the code analysis tool (pylint) without docstring warnings (because the code is self-explanatory without comments):

    $ make pylint

By default, the Makefile uses python as his interpreter. If you would like to change it to other like for example pypy3 (which runs a lot faster than python3) , you can do it changing the Makefile variable to pypy3.

interpreter=pypy3

C++

For compiling the .cpp file with all the optimizations and warning checkers:

    $ make

For compiling and running the tests:

    $ make test