adding max distance for edge creation between topological nodes