Skip to content

Commit

Permalink
🐞Fixed #4
Browse files Browse the repository at this point in the history
  • Loading branch information
rodigu committed Mar 2, 2022
1 parent 06ef049 commit 9e09bfc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,13 @@ export class Network {
const triplet: Triplet = [id, from, to];
const unsorted = [...triplet];

if (k2.isSameTriplet(unsorted, triplet.sort()))
if (k2.hasEdge(id, to, true)) triplet_list.push(triplet);
if (
k2.isSameTriplet(unsorted, triplet.sort()) ||
(this.is_directed && !this.listHasTriplet(triplet_list, triplet))
)
if (k2.hasEdge(id, to, true) && !this.is_directed)
triplet_list.push(triplet);
else if (k2.hasEdge(id, to, false)) triplet_list.push(triplet);
});
});

Expand Down

0 comments on commit 9e09bfc

Please sign in to comment.