Hello everyone,

I have been working on a python script to help assign university students to workplace placements.

The problem is that for a given group of students there are only a limited amount of places and each placement location can only caters for a few students.

The ideal solution is that each student is assigned one of these placements, based on their location (minimum possible distance).

My current script estabishes the distance from each placement location for each of these students using google maps apis. I parse this into a list of students, each containing a name and another list of distances from the placement locations.

What I am struggling to solve is how to recursively work out the lowest possible combination of distances for the group of students.

Any help or guidance in working out this function would be greatly appreciated.

Recursion has always done my head in :(

Thanking you all in advance,


5 Years
Discussion Span
Last Post by pyTony

What I forgot to mention was that there is another list of placement locations containing the amount of places for each location.


Post the code you have, sample input data for the function you are strugling with and current output including the full error messages and desired output. Do not forget to push the [CODE] before pasting.

Edited by pyTony: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.