Skip to content

Commit 884238c

Browse files
committed
✅ triplet testing
- created legacy testing file - compare previous algorithms
1 parent bd627d4 commit 884238c

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

network.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -698,11 +698,11 @@ export class Network {
698698

699699
if (triplet.addEdge(k2.edgeBetween(triplet.tip, id)?.args))
700700
if (triplet.close(k2.edgeBetween(triplet.tip, triplet.loop)?.args))
701-
if (
701+
if (
702702
triplet_list.every((t) => !t.isSameAs(triplet)) &&
703703
triplet.is_complete
704-
)
705-
triplet_list.push(triplet);
704+
)
705+
triplet_list.push(triplet);
706706
});
707707
});
708708

test_legacy.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as nets from "https://deno.land/x/[email protected]/mod.ts";
2+
import * as nex from "https://deno.land/x/[email protected]/extra.ts";
3+
4+
const start = Date.now();
5+
const network = await nex.loadAdjacencyMatrix("./data/networkMatrix.csv");
6+
console.log(network.triplets().length, Date.now() - start);

tester.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,8 @@ function generalTesting() {
236236
}
237237

238238
// compareQuadAlgorithms(nex.genCompleteNetwork(10), true);
239-
randomNetEfficiencyTest(20, { min: 20, max: 120 }, "rand_dense.json");
239+
// randomNetEfficiencyTest(20, { min: 20, max: 120 }, "rand_dense.json");
240+
241+
const start = Date.now();
242+
const net = await nex.loadAdjacencyMatrix("./data/networkMatrix.csv");
243+
console.log(net.triplets().length, Date.now() - start);

0 commit comments

Comments
 (0)