added distance between nodes-nodes, node-trajectory, traj-traj