Skip to content

Commit 76ef202

Browse files
committed
✨ created Cycle.path
- returns a list of vertices that make up the cycle's path
1 parent b992a3b commit 76ef202

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

network.ts

+4
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,10 @@ export class Cycle extends Network {
944944
return 0;
945945
}
946946

947+
get path(): base_id[] {
948+
return [...this.vertices.keys()];
949+
}
950+
947951
/**
948952
* Returns true if the cycle is closed, otherwise returns false.
949953
* @returns boolean

tester.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ function generalTesting() {
238238
// compareQuadAlgorithms(nex.genCompleteNetwork(10), true);
239239
// randomNetEfficiencyTest(20, { min: 20, max: 120 }, "rand_dense.json");
240240

241-
const start = Date.now();
242-
const net = await nex.loadAdjacencyMatrix("./data/networkMatrix.csv");
243-
console.log(net.triplets().length, Date.now() - start);
241+
// const start = Date.now();
242+
// const net = await nex.loadAdjacencyMatrix("./data/networkMatrix.csv");
243+
// console.log(net.triplets().length, Date.now() - start);
244+
245+
const net = nex.genCompleteNetwork(4);
246+
console.log(net.quadruplets().map(({ path }) => path));

0 commit comments

Comments
 (0)