This is an individual assignment, not a group exercise! You are each expected to work on this individually. If you submit your answer early, I may look at it and provide feedback before the deadline, giving you a chance to improve. Adherence to the detailed instruction is very important, so that the testing can be automated. Read these instructions carefully to avoid missing some details…
Your task is to send to xnodet@uco.fr (and not any other email address!),
on 2025-12-15 07:00 UTC at the lastest, an email with:
-
Your name
-
the URL to a project on GitHub.com that contains a Python program solving the problem described below.
The layout of your project should be such that:
-
All the files should use UTF-8 encoding.
-
A file
.python-versionexists that has the Python version to be used. If you usepyenv, thenpyenv local 3.13(for example) will create such a file. If you don’t usepyenv, then the following command should do what I want:
python3 -c "import sys; v=sys.version_info; print('{}.{}'.format(v[0], v[1]))"
-
A file
requirements.txtexists with the Python libraries that are required for the project to run. See e.g.pip freezedocumentation. -
A file
videos.outdoes NOT exist. -
A Python script
videos.pyexists and I can invoke it to solve the problem. It should accept an argument that is the path to a dataset from which to generate the solution. -
It should create, in the current directory, a file
videos.mpsthat contains the problem given to Gurobi. -
It should create, in the current directory, a file
videos.outthat should be in the format described in the text of the exercise, and contain an optimal solution (to 0.5% gap) to the problem described in thedataset.
If url is the value of that URL in your email, I will do, in a
brand new Python virtual environment, something similar to the following:
$ git clone [url] repo
$ cd repo
$ pip install --requirement requirements.txt
$ python videos.py [relative/path/to/dataset]
$ python [somewhere/only/i/know]/check_solution.py [relative/path/to/dataset] videos.out
The dataset I will use to evaluate your submission may be one that you didn’t see.
Your Python code should be well structured and easy to understand. It
should use gurobipy to create an optimization model and solve it. The
optimality gap
(MipGap)
should be 5e-3 or less. While it reads the data and creates the
model, the script should show what it does with a few lines of traces.
The shorter the time it takes to generate the model, the better.
You will find within the archive
https://nodet.github.io/gurobipy-course/data.zip, in the folder
project, a PDF file describing the problem to solve:
hashcode_2017_qualification_round.pdf and the formats of the input and
solution files.
There are also, in the datasets directory, two input files:
-
a trivial one to get you started:
example.in -
one that will give you a potentially interesting problem to solve:
trending_4000_10k.in
Good luck!