Skip to content
Snippets Groups Projects

Keyboard layout optimization via ILP

This repository contains my implementation of the task to optimize a keyboard layout in terms of assigning the available characters to the keys in a clever way. This is part of my participation in the Seminar: Integer Programming modeling of puzzles, games, and real-world problems during the winter term 21/22 at Technische Universität zu Berlin.

Usage

This code requires the SCIP Optimization Suite to be installed on the machine to be used, which we prepared in a Docker image at docker_pyscipopt . The proper use of this image is well documented in its README.md . The actual code can then be found in the src/ilp_keyboard_layout_optimization subfolder . The example configuration to run an optimization can be found in the optimize module and invoked via

$ pip install --pre ilp_keyboard_layout_optimization
Processing ilp_keyboard_layout_optimization
  Installing build dependencies ... done
[...]
Successfully installed ilp-keyboard-layout-optimization-0.0.4a1
$ python -m ilp_keyboard_layout_optimization.optimize

Remote development

We included a bash script pull_and_optimize.sh in our codebase to streamline a remote development workflow. We work on the code on a computer, that is well-equipped for that task. The committed and pushed code then gets processed on another machine, which uses this script, to update its code base and run the parameters handed over. It is designed to be called without parameters to execute the optimize module of the latest version released on PyPI.org .

$ ./pull_and_optimize.sh

The execution requires the Docker image of our repository docker_pyscipopt to be built in advance, but it could be easily adapted for a local installation of the SCIP Optimization Suite.