Skip to content

Commit

Permalink
tests for new features, prepare 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
blutorange committed Jun 24, 2018
1 parent f9648c4 commit 3f1c472
Show file tree
Hide file tree
Showing 26 changed files with 575 additions and 217 deletions.
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ test
perf
coverage

tsconfig.json
tslint.json
/src
/index.ts
.babelrc
tsconfig.json
tslint.json
*.tgz
*.zip
sandbox.ts
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ Tests done with [benchmark](https://www.npmjs.com/package/benchmark). Compared w
sort with `graphlib` (via `alg.isAcyclic(graph)`) each time a vertex is added. Measured time is the time that
was needed for creating a new graph and adding `n` vertices, checking for a cycle after each edge insertion.

> **incremental-cycle-detection**(insert 15000, RandomSource) x **36.43** ops/sec ±0.79% (58 runs sampled)
> **incremental-cycle-detection**(insert 15000, RandomSource) x **38.21** ops/sec ±1.78% (47 runs sampled)
>
> **incremental-cycle-detection-multi**(insert 15000, RandomSource) x **25.71** ops/sec ±10.12% (45 runs sampled)
> **incremental-cycle-detection-multi**(insert 15000, RandomSource) x **31.58** ops/sec ±2.77% (52 runs sampled)
>
> **graphlib**(insert15000, RandomSource) x **0.17** ops/sec ±1.63% (5 runs sampled)
> **graphlib**(insert15000, RandomSource) x **0.19** ops/sec ±1.83% (5 runs sampled)
(200 vertices, 15000 random (same for each algorithm) edges added)
(node v8.9.4, graph with 200 vertices, 15000 random -- same for each algorithm -- edges added)

Also, even inserting into graphlib without checking for cycles seems to be slower:

> **graphlib-no-cycle-check** (insert 15000, RandomSource) x **21.59** ops/sec ±6.63% (37 runs sampled)
# JavaScript environment

Expand Down
4 changes: 2 additions & 2 deletions docs/classes/algorithm.html
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> find<wbr>Weakly<wbr>Conne
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Algorithm.ts:15</li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/Algorithm.ts#L15">Algorithm.ts:15</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1104,7 +1104,7 @@ <h3><span class="tsd-flag ts-flagStatic">Static</span> get<wbr>Neighbors</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Algorithm.ts:63</li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/Algorithm.ts#L63">Algorithm.ts:63</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
56 changes: 28 additions & 28 deletions docs/classes/genericgraphadapter.html

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions docs/classes/graphlibadapter.html

Large diffs are not rendered by default.

105 changes: 68 additions & 37 deletions docs/classes/multigraphadapter.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/classes/pearcekellydetector.html
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L68">PearceKellyDetector.ts:68</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L68">PearceKellyDetector.ts:68</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <a href="pearcekellydetector.html" class="tsd-signature-type">PearceKellyDetector</a></h4>
Expand All @@ -1133,7 +1133,7 @@ <h3>can<wbr>Add<wbr>Edge</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#canaddedge">canAddEdge</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L122">PearceKellyDetector.ts:122</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L122">PearceKellyDetector.ts:122</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -1163,7 +1163,7 @@ <h3>create<wbr>Vertex<wbr>Data</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#createvertexdata">createVertexData</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L108">PearceKellyDetector.ts:108</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L108">PearceKellyDetector.ts:108</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1187,7 +1187,7 @@ <h3>get<wbr>Order</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#getorder">getOrder</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L134">PearceKellyDetector.ts:134</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L134">PearceKellyDetector.ts:134</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1214,7 +1214,7 @@ <h3>is<wbr>Reachable</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#isreachable">isReachable</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L89">PearceKellyDetector.ts:89</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L89">PearceKellyDetector.ts:89</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -1244,7 +1244,7 @@ <h3>map</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#map">map</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L78">PearceKellyDetector.ts:78</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L78">PearceKellyDetector.ts:78</a></li>
</ul>
</aside>
<h4 class="tsd-type-parameters-title">Type parameters</h4>
Expand All @@ -1268,7 +1268,7 @@ <h3>on<wbr>Vertex<wbr>Deletion</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#onvertexdeletion">onVertexDeletion</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L116">PearceKellyDetector.ts:116</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L116">PearceKellyDetector.ts:116</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1295,7 +1295,7 @@ <h3>supports<wbr>Order</h3>
<aside class="tsd-sources">
<p>Implementation of <a href="../interfaces/cycledetector.html">CycleDetector</a>.<a href="../interfaces/cycledetector.html#supportsorder">supportsOrder</a></p>
<ul>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/08de510/src/PearceKellyDetector.ts#L130">PearceKellyDetector.ts:130</a></li>
<li>Defined in <a href="https://github.com/blutorange/js-incremental-cycle-detect/blob/f9648c4/src/PearceKellyDetector.ts#L130">PearceKellyDetector.ts:130</a></li>
</ul>
</aside>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
Expand Down
Loading

0 comments on commit 3f1c472

Please sign in to comment.