## The Problem

Shift workers prefer to work certain days over others, but can't express this with their timetable. Managers hate having to manually adjust schedules to everyone's preferences each week.

## Our Solution

prefer.io is a gamified system where each employee receives credits to allocate to shifts depending on how much they want that shift. Placing a lot of credits on one shift is a tradeoff as you have less to allocate to other shifts you may want.

Managers can press a single button and our algorithm calculates the optimal roster. Managers can also see a heatmap of popular and unpopular times, allowing them to hire new employees that can work the unpopular shifts.

### Inspiration

A common economics problem is the gap between a scarce resource and the demand for it. By giving employees fake credits, we essentially created a "free market" solution to solve the scarcity of shifts. The employee that want the shift the most will allocate the most credits.

### How we built it

We used HTML and JavaScript to develop a web app, with the help of Google's MDL to help with interfacing.

In order to solve the preference allocation problem, we created a matrix of preferences, where each row was a worker in need of a shift, and each column was a shift. We converted this into a square matrix by duplicating rows when a worker would like to work more than one shift in order to use previously solved problems in graph theory.

i.e. Row i, column j of this matrix tells you the amount of credits worker i allocated for shift j.

This essentially boils down to a maximum-weight minimal edge cover problem, which can be obtained by adapting the Hungarian algorithm developed in 1995.

### Accomplishments that we're proud of

• Creating and mapping a general purpose algorithm to allocate finite resources (shifts in this case) to some amount of people. This can be used in bidding for scarce resources or other timetabling applications.
• Creating a elegant and fast web app for employees and management alike.
• Incorporating Google API sign-ups to save user data.
• Using Firebase API for the database.
• Visually representing the results with a heat-map and a recommended timetable.