return(-1,"Item of price {} occurs {} times in the instance but {} times in your solution".format(occurences_in_instance[p],occurences_in_solution[p]))

In the balanced-partition problem, we are given n items, each having an integer price p_i for i = 1,..,n, and k bins of unlimited capacity. The objective is to assign items into bins so that total costs of items in all bins are as evenly distributed as possible; i.e. the difference of costs between the most expensive and the cheapest bins is minimized, called a gap.

The task is to implement the function *find_balanced_partition* in the file *partition.py* which is expected to find a *heuristic* solution to a given instance. The heuristic feasible solution has to be found within a time limit which the function find_balanced_partition obtains by an argument. To ensure that the your algorithm does not run too long, you can use a signal handler; see the file *timer.py* for more details.

Your algorithm is tested on 5 tests and a trivial one for debugging purposes, and each test contains 10 instances. In order to pass a test, your algorithm must find a feasible solution for every instance within a given time limit and the average gap must be smaller than some value.

In you program, explain your algorithm.

If you are interested, you can compare results of your algorithm with the following table (tested on Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz, 32BG RAM):