get distance matrix partial