From 76ef202f98d17cc0613735b886893657d6c7e603 Mon Sep 17 00:00:00 2001 From: Rodrigo Morais <58960796+rodigu@users.noreply.github.com> Date: Wed, 6 Apr 2022 19:06:35 -0700 Subject: [PATCH] :sparkles: created Cycle.path - returns a list of vertices that make up the cycle's path --- network.ts | 4 ++++ tester.ts | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/network.ts b/network.ts index 653054b..ff8d6ef 100644 --- a/network.ts +++ b/network.ts @@ -944,6 +944,10 @@ export class Cycle extends Network { return 0; } + get path(): base_id[] { + return [...this.vertices.keys()]; + } + /** * Returns true if the cycle is closed, otherwise returns false. * @returns boolean diff --git a/tester.ts b/tester.ts index 0bdf8e3..b19b47d 100644 --- a/tester.ts +++ b/tester.ts @@ -238,6 +238,9 @@ function generalTesting() { // compareQuadAlgorithms(nex.genCompleteNetwork(10), true); // 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); +// const start = Date.now(); +// const net = await nex.loadAdjacencyMatrix("./data/networkMatrix.csv"); +// console.log(net.triplets().length, Date.now() - start); + +const net = nex.genCompleteNetwork(4); +console.log(net.quadruplets().map(({ path }) => path));