Skip to content

Commit

Permalink
✅ triplet testing
Browse files Browse the repository at this point in the history
- created legacy testing file
- compare previous algorithms
  • Loading branch information
rodigu committed Apr 7, 2022
1 parent bd627d4 commit 884238c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,11 +698,11 @@ export class Network {

if (triplet.addEdge(k2.edgeBetween(triplet.tip, id)?.args))
if (triplet.close(k2.edgeBetween(triplet.tip, triplet.loop)?.args))
if (
if (
triplet_list.every((t) => !t.isSameAs(triplet)) &&
triplet.is_complete
)
triplet_list.push(triplet);
)
triplet_list.push(triplet);
});
});

Expand Down
6 changes: 6 additions & 0 deletions test_legacy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as nets from "https://deno.land/x/[email protected]/mod.ts";
import * as nex from "https://deno.land/x/[email protected]/extra.ts";

const start = Date.now();
const network = await nex.loadAdjacencyMatrix("./data/networkMatrix.csv");
console.log(network.triplets().length, Date.now() - start);
6 changes: 5 additions & 1 deletion tester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,8 @@ function generalTesting() {
}

// compareQuadAlgorithms(nex.genCompleteNetwork(10), true);
randomNetEfficiencyTest(20, { min: 20, max: 120 }, "rand_dense.json");
// randomNetEfficiencyTest(20, { min: 20, max: 120 }, "rand_dense.json");

const start = Date.now();
const net = await nex.loadAdjacencyMatrix("./data/networkMatrix.csv");
console.log(net.triplets().length, Date.now() - start);

0 comments on commit 884238c

Please sign in to comment.