Found a "solution" to my homework, but it was not correct nor was it complete. It partly had to do with algorithms and the algorithm they provided as answer, that was checked by an expert, clearly did not work if you tried to use it even once with some given test data.