i understand combinations, but not the lambda expression and reference to dm[i i1] . um what is substituted for i or is there a better way to think it through?
so, basically the combinations part will return tuples of all indexes in one of the triangles of dm. The lambda expression uses these indexes to query the distance matrix dm. So, a possible i could be (0, 1), the we query the distance matrix on dm[i][i] = dm.