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,

Starkles.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.