improved d1 min_inpart_greedy runtime by changing used datastructures -> O(m^2)