// put the weights for the edges in. This assumes unidirectionality.
for(vari=0;i<edgesArray.length;i++){
varedge=edges[edgesArray[i]];
if(edge.connected===true){
// edge has to be connected if it counts to the distances.
// edge has to be connected if it counts to the distances. If it is connected to inner clusters it will crash so we also check if it is in the D_matrix
// put the weights for the edges in. This assumes unidirectionality.
for(leti=0;i<edgesArray.length;i++){
letedge=edges[edgesArray[i]];
if(edge.connected===true){// edge has to be connected if it counts to the distances.
// edge has to be connected if it counts to the distances. If it is connected to inner clusters it will crash so we also check if it is in the D_matrix