final version for calc mincostflow matrix only, then let's try the assignTasks part