Skip to content

Commit

Permalink
Manual cleanup of edgesum.js
Browse files Browse the repository at this point in the history
  • Loading branch information
curran committed Jan 2, 2021
1 parent 11f7906 commit d6d84dd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/edgesum.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ export function edgesum(graph, order) {

const inv = inverse_permutation(order);
const links = graph.links();
let i;
let e;
let d;
let sum = 0;

for (i = 0; i < links.length; i++) {
e = links[i];
d = Math.abs(inv[e.source.index] - inv[e.target.index]);
for (let i = 0; i < links.length; i++) {
const e = links[i];
const d = Math.abs(inv[e.source.index] - inv[e.target.index]);
sum += d;
}
return sum;
Expand Down

0 comments on commit d6d84dd

Please sign in to comment.