From 03027ed702fb892cb8b6572dcabbe36093c7cf3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:07:00 +0200 Subject: [PATCH 001/118] Set theme jekyll-theme-architect --- docs/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index c419263..3397c9a 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-cayman \ No newline at end of file +theme: jekyll-theme-architect \ No newline at end of file From 451980bcd99c01afcea412f77ab72ef2f8967b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:31:02 +0200 Subject: [PATCH 002/118] Updated web page --- docs/index.md | 66 ++++++++++++------- sample/build.gradle | 21 ------ .../java/lv/id/jc/algorithm/AppExample.java | 49 -------------- sample/src/main/java/module-info.java | 3 - 4 files changed, 44 insertions(+), 95 deletions(-) delete mode 100644 sample/build.gradle delete mode 100644 sample/src/main/java/lv/id/jc/algorithm/AppExample.java delete mode 100644 sample/src/main/java/module-info.java diff --git a/docs/index.md b/docs/index.md index a1be8e7..d61cd47 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,37 +1,59 @@ -## Welcome to GitHub Pages +## Graph search algorithms -You can use the [editor on GitHub](https://github.com/rabestro/graph-algorithms/edit/gh-pages/index.md) to maintain and preview the content for your website in Markdown files. +The project implements a class for the general structure of the graph, as well as two algorithms for finding a path in the graph. -Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. +There are implementations and tests for two algorithms: -### Markdown +- [Breadth-first search](src/main/java/graph/BreadthFirstSearch.java) +- [Dijkstra's Algorithm](src/main/java/graph/DijkstrasAlgorithm.java) -Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for +The implementation is written in Java 17, the API documentation is available [here](api). +You can also see the [specifications](spock-reports) for the classes generated with the spock-reports. -```markdown -Syntax highlighted code block +### Unit Tests -# Header 1 -## Header 2 -### Header 3 +Tests are written in groove language. For unit testing, the Spock framework was used. To test the operation of the algorithms, the following sample graphs were created. -- Bulleted -- List +#### Small Graph -1. Numbered -2. List +![Small Graph](small.gif) -**Bold** and _Italic_ and `Code` text +```groovy + def graph = new Graph([ + A: [B: 7, C: 2], + B: [A: 3, C: 5], + C: [A: 1, B: 3] + ]) -[Link](url) and ![Image](src) ``` -For more details see [Basic writing and formatting syntax](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax). +#### Medium Graph -### Jekyll Themes +![Medium Graph](medium.gif) -Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/rabestro/graph-algorithms/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file. - -### Support or Contact +```groovy + def graph = new Graph([ + A: [B: 5], + B: [A: 5, C: 10], + C: [B: 20, D: 5], + D: [E: 5], + E: [B: 5] + ]) +``` -Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out. +#### Complex Graph + +![Complex Graph](complex.gif) + +```groovy + def graph = new Graph([ + A: [B: 5, H: 2], + B: [A: 5, C: 7], + C: [B: 7, D: 3, G: 4], + D: [C: 20, E: 4], + E: [F: 5], + F: [G: 6], + G: [C: 4], + H: [G: 3] + ]) +``` \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle deleted file mode 100644 index 217f94a..0000000 --- a/sample/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -plugins { - id 'groovy' - id 'java' -} - -group 'lv.id.jc' -version '1.0' - -repositories { - mavenCentral() -} - -dependencies { - implementation 'org.codehaus.groovy:groovy-all:3.0.5' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' -} - -test { - useJUnitPlatform() -} \ No newline at end of file diff --git a/sample/src/main/java/lv/id/jc/algorithm/AppExample.java b/sample/src/main/java/lv/id/jc/algorithm/AppExample.java deleted file mode 100644 index af88fcc..0000000 --- a/sample/src/main/java/lv/id/jc/algorithm/AppExample.java +++ /dev/null @@ -1,49 +0,0 @@ -package lv.id.jc.algorithm; - -import lv.id.jc.algorithm.graph.BreadthFirstSearch; -import lv.id.jc.algorithm.graph.DijkstrasAlgorithm; -import lv.id.jc.algorithm.graph.Graph; -import lv.id.jc.algorithm.graph.SearchAlgorithm; - -import java.util.Map; - -public class AppExample { - private static final Graph COMPLEX_GRAPH = new Graph<>(Map.of( - 'A', Map.of('B', 5, 'H', 2), - 'B', Map.of('A', 5, 'C', 7), - 'C', Map.of('B', 7, 'D', 3, 'G', 4), - 'D', Map.of('C', 20, 'E', 4), - 'E', Map.of('F', 5), - 'F', Map.of('G', 6), - 'G', Map.of('C', 4), - 'H', Map.of('G', 3) - )); - private static final SearchAlgorithm fastest = new DijkstrasAlgorithm<>(); - private static final SearchAlgorithm shortest = new BreadthFirstSearch<>(); - - public static void main(String[] args) { - System.out.println(COMPLEX_GRAPH); - - printRoute(COMPLEX_GRAPH, 'D', 'C'); - printRoute(COMPLEX_GRAPH, 'A', 'G'); - printRoute(COMPLEX_GRAPH, 'D', 'H'); - } - - private static void printRoute(final Graph graph, - final Character source, - final Character target) { - final var routeOne = shortest.findPath(graph, source, target); - final var routeTwo = fastest.findPath(graph, source, target); - final var message = """ - - Find the path from %s to %s - - the shortest take %.0f min and the path is %s - - the fastest take %.0f min and the path is %s""" - .formatted( - source, target, - graph.getDistance(routeOne), routeOne, - graph.getDistance(routeTwo), routeTwo); - - System.out.println(message); - } -} diff --git a/sample/src/main/java/module-info.java b/sample/src/main/java/module-info.java deleted file mode 100644 index 2faaaa4..0000000 --- a/sample/src/main/java/module-info.java +++ /dev/null @@ -1,3 +0,0 @@ -module search.algorithm.sample { - requires lv.id.jc.algorithm; -} \ No newline at end of file From 1f7af95301e2e64762567bb2de001fb90dcf12eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:32:15 +0200 Subject: [PATCH 003/118] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 70 +++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..0753093 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,70 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '33 15 * * 3' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://git.io/codeql-language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 06782b6996fdbdef201f1c07cf4d595b0cf50439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:32:54 +0200 Subject: [PATCH 004/118] Create CNAME --- docs/CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..b8a5961 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +algorithm.jc.id.lv \ No newline at end of file From 329af57fa758558aeacd3bba23e0bf27b4730c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:33:24 +0200 Subject: [PATCH 005/118] Delete CNAME --- docs/CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index b8a5961..0000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -algorithm.jc.id.lv \ No newline at end of file From f66f91e1615eb18ab17fdaab087988d481dae9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:37:55 +0200 Subject: [PATCH 006/118] Set theme jekyll-theme-minimal --- docs/_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 3397c9a..2f7efbe 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-architect \ No newline at end of file +theme: jekyll-theme-minimal \ No newline at end of file From b27baa6368ef7b9115eaaecaf4269e57c78fa8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:42:05 +0200 Subject: [PATCH 007/118] Created assets folder --- README.md | 6 +++--- docs/{ => assets}/Graphs.pptx | Bin docs/{ => assets}/complex.gif | Bin docs/{ => assets}/medium.gif | Bin docs/{ => assets}/small.gif | Bin docs/index.md | 6 +++--- 6 files changed, 6 insertions(+), 6 deletions(-) rename docs/{ => assets}/Graphs.pptx (100%) rename docs/{ => assets}/complex.gif (100%) rename docs/{ => assets}/medium.gif (100%) rename docs/{ => assets}/small.gif (100%) diff --git a/README.md b/README.md index 3027aad..4de072d 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ Algorithm code in Java 17. Tests written in Groovy 3 using Spock Framework 2. To test the operation of the algorithms, the following sample graphs were created. -![Small Graph](docs/small.gif) +![Small Graph](docs/assets/small.gif) ### Medium Graph -![Medium Graph](docs/medium.gif) +![Medium Graph](docs/assets/medium.gif) ### Complex Graph -![Complex Graph](docs/complex.gif) +![Complex Graph](docs/assets/complex.gif) diff --git a/docs/Graphs.pptx b/docs/assets/Graphs.pptx similarity index 100% rename from docs/Graphs.pptx rename to docs/assets/Graphs.pptx diff --git a/docs/complex.gif b/docs/assets/complex.gif similarity index 100% rename from docs/complex.gif rename to docs/assets/complex.gif diff --git a/docs/medium.gif b/docs/assets/medium.gif similarity index 100% rename from docs/medium.gif rename to docs/assets/medium.gif diff --git a/docs/small.gif b/docs/assets/small.gif similarity index 100% rename from docs/small.gif rename to docs/assets/small.gif diff --git a/docs/index.md b/docs/index.md index d61cd47..3a2052d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -16,7 +16,7 @@ Tests are written in groove language. For unit testing, the Spock framework was #### Small Graph -![Small Graph](small.gif) +![Small Graph](assets/small.gif) ```groovy def graph = new Graph([ @@ -29,7 +29,7 @@ Tests are written in groove language. For unit testing, the Spock framework was #### Medium Graph -![Medium Graph](medium.gif) +![Medium Graph](assets/medium.gif) ```groovy def graph = new Graph([ @@ -43,7 +43,7 @@ Tests are written in groove language. For unit testing, the Spock framework was #### Complex Graph -![Complex Graph](complex.gif) +![Complex Graph](assets/complex.gif) ```groovy def graph = new Graph([ From 86242bee670dee3422b773c1c73eab363552b5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:50:59 +0200 Subject: [PATCH 008/118] Create CNAME --- docs/CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..b8a5961 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +algorithm.jc.id.lv \ No newline at end of file From e9281dc02f772dd8d8cb6b615f0e404ab7e0cfdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:52:07 +0200 Subject: [PATCH 009/118] Update CNAME --- docs/CNAME | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CNAME b/docs/CNAME index b8a5961..e1f8911 100644 --- a/docs/CNAME +++ b/docs/CNAME @@ -1 +1 @@ -algorithm.jc.id.lv \ No newline at end of file +algorithms.jc.id.lv \ No newline at end of file From 12732037df486ddb0dad7019d6d2dab1cdc2b176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 20:55:37 +0200 Subject: [PATCH 010/118] Updated web page --- docs/index.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/index.md b/docs/index.md index 3a2052d..d47c443 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,8 +4,8 @@ The project implements a class for the general structure of the graph, as well a There are implementations and tests for two algorithms: -- [Breadth-first search](src/main/java/graph/BreadthFirstSearch.java) -- [Dijkstra's Algorithm](src/main/java/graph/DijkstrasAlgorithm.java) +- [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) +- [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) The implementation is written in Java 17, the API documentation is available [here](api). You can also see the [specifications](spock-reports) for the classes generated with the spock-reports. @@ -14,9 +14,7 @@ You can also see the [specifications](spock-reports) for the classes generated w Tests are written in groove language. For unit testing, the Spock framework was used. To test the operation of the algorithms, the following sample graphs were created. -#### Small Graph - -![Small Graph](assets/small.gif) +#### Small Graph Sample ```groovy def graph = new Graph([ @@ -27,9 +25,10 @@ Tests are written in groove language. For unit testing, the Spock framework was ``` -#### Medium Graph +![Small Graph](assets/small.gif) + -![Medium Graph](assets/medium.gif) +#### Medium Graph Sample ```groovy def graph = new Graph([ @@ -41,9 +40,10 @@ Tests are written in groove language. For unit testing, the Spock framework was ]) ``` -#### Complex Graph +![Medium Graph](assets/medium.gif) -![Complex Graph](assets/complex.gif) + +#### Complex Graph Sample ```groovy def graph = new Graph([ @@ -56,4 +56,6 @@ Tests are written in groove language. For unit testing, the Spock framework was G: [C: 4], H: [G: 3] ]) -``` \ No newline at end of file +``` +![Complex Graph](assets/complex.gif) + From f3c35ffb7e7e4b7b77a5be79d795f1564461b542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 21:26:33 +0200 Subject: [PATCH 011/118] Added an example of program --- docs/index.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index d47c443..f5ff33e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,6 +10,53 @@ There are implementations and tests for two algorithms: The implementation is written in Java 17, the API documentation is available [here](api). You can also see the [specifications](spock-reports) for the classes generated with the spock-reports. +### How to use the classes in your program + +The first step is create a graph structure. The Graph class is generic, and you can use any Java type for vertex and any Number type for distance. + +#### Example +In the following code we create a graph structure with eight nodes. We use Character class for vertex identification. You can see the graphic representation of the scheme [here](assets/complex.gif). +```java +final var graph = new Graph(Map.of( + 'A', Map.of('B', 5, 'H', 2), + 'B', Map.of('A', 5, 'C', 7), + 'C', Map.of('B', 7, 'D', 3, 'G', 4), + 'D', Map.of('C', 20, 'E', 4), + 'E', Map.of('F', 5), + 'F', Map.of('G', 6), + 'G', Map.of('C', 4), + 'H', Map.of('G', 3) + )); +``` + +The second step is creating a search algorithm class. You can choose one of the two algorithms. + +#### Example + +```java +final var fastest = new DijkstrasAlgorithm(); +final var shortest = new BreadthFirstSearch(); +``` + +Now we can search for the route. + +#### Example + +```java +final var source = 'D'; +final var target = 'C'; + +final var routeOne = shortest.findPath(graph, source, target); +final var routeTwo = fastest.findPath(graph, source, target); +``` + +As result, you get a list with the path. + +```java +routeOne == ['D', 'C'] +routeTwo == ['D', 'E', 'F', 'G', 'C'] +``` + ### Unit Tests Tests are written in groove language. For unit testing, the Spock framework was used. To test the operation of the algorithms, the following sample graphs were created. @@ -22,7 +69,6 @@ Tests are written in groove language. For unit testing, the Spock framework was B: [A: 3, C: 5], C: [A: 1, B: 3] ]) - ``` ![Small Graph](assets/small.gif) From 51f2b3577b49d36017dddb7a3f2d6e48674408aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 21:32:18 +0200 Subject: [PATCH 012/118] Updated web page --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index f5ff33e..92a06f3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ You can also see the [specifications](spock-reports) for the classes generated w ### How to use the classes in your program -The first step is create a graph structure. The Graph class is generic, and you can use any Java type for vertex and any Number type for distance. +The first step is create a graph structure. The [Graph class](http://algorithms.jc.id.lv/api/lv/id/jc/algorithm/graph/Graph.html) is generic, and you can use any Java type for vertex id and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. #### Example In the following code we create a graph structure with eight nodes. We use Character class for vertex identification. You can see the graphic representation of the scheme [here](assets/complex.gif). From e3c613977e52d873f3f8dcd1f26e4dcd1defbdb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 21:40:59 +0200 Subject: [PATCH 013/118] Updated web page --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 92a06f3..9fd40de 100644 --- a/docs/index.md +++ b/docs/index.md @@ -59,7 +59,7 @@ routeTwo == ['D', 'E', 'F', 'G', 'C'] ### Unit Tests -Tests are written in groove language. For unit testing, the Spock framework was used. To test the operation of the algorithms, the following sample graphs were created. +Tests are written in groove language. For unit testing, the Spock framework was used. You can check the reports for [unit tests](spock-reports) and for [test coverage](coverage). To test the operation of the algorithms, the following sample graphs were created. #### Small Graph Sample From 7b8ba5ba8857a9110ace702ea6b8e14925dc9605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 22:04:20 +0200 Subject: [PATCH 014/118] Update index.md --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index f5ff33e..fd75058 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,7 +7,7 @@ There are implementations and tests for two algorithms: - [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) - [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) -The implementation is written in Java 17, the API documentation is available [here](api). +The implementation is written in Java 17. [API documentation](api) is available. You can also see the [specifications](spock-reports) for the classes generated with the spock-reports. ### How to use the classes in your program From 36a9420722fd318dfed7f031d3b35f661b9b1c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 22:17:32 +0200 Subject: [PATCH 015/118] Delete codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 70 --------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 0753093..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '33 15 * * 3' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 From 3f5e7cd2e637200f0da7222b074291b6153b81f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 22:19:10 +0200 Subject: [PATCH 016/118] Update index.md --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index fd75058..a637592 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ You can also see the [specifications](spock-reports) for the classes generated w ### How to use the classes in your program -The first step is create a graph structure. The Graph class is generic, and you can use any Java type for vertex and any Number type for distance. +The first step is create a graph structure. The [Graph class](https://algorithms.jc.id.lv/api/lv/id/jc/algorithm/graph/Graph.html) is generic, and you can use any Java type for vertex and any Number type for distance. #### Example In the following code we create a graph structure with eight nodes. We use Character class for vertex identification. You can see the graphic representation of the scheme [here](assets/complex.gif). From a485ccb8bc1e5269cfdd353b8f85a35ce1987005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 22:26:11 +0200 Subject: [PATCH 017/118] Update index.md --- docs/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.md b/docs/index.md index a637592..e0e4b1a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,10 +12,11 @@ You can also see the [specifications](spock-reports) for the classes generated w ### How to use the classes in your program -The first step is create a graph structure. The [Graph class](https://algorithms.jc.id.lv/api/lv/id/jc/algorithm/graph/Graph.html) is generic, and you can use any Java type for vertex and any Number type for distance. +The first step is create a graph structure. The [Graph class](https://algorithms.jc.id.lv/api/lv/id/jc/algorithm/graph/Graph.html) is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. #### Example -In the following code we create a graph structure with eight nodes. We use Character class for vertex identification. You can see the graphic representation of the scheme [here](assets/complex.gif). +In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). + ```java final var graph = new Graph(Map.of( 'A', Map.of('B', 5, 'H', 2), From 60c5db0ad6afff8afe77e7b26e2f9fc6fe736b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 22:28:59 +0200 Subject: [PATCH 018/118] Update index.md --- docs/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/index.md b/docs/index.md index e0e4b1a..a3e6ae2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,7 @@ The first step is create a graph structure. The [Graph class](https://algorithms In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). ```java -final var graph = new Graph(Map.of( +var graph = new Graph(Map.of( 'A', Map.of('B', 5, 'H', 2), 'B', Map.of('A', 5, 'C', 7), 'C', Map.of('B', 7, 'D', 3, 'G', 4), @@ -35,8 +35,8 @@ The second step is creating a search algorithm class. You can choose one of the #### Example ```java -final var fastest = new DijkstrasAlgorithm(); -final var shortest = new BreadthFirstSearch(); +var fastest = new DijkstrasAlgorithm(); +var shortest = new BreadthFirstSearch(); ``` Now we can search for the route. @@ -44,11 +44,11 @@ Now we can search for the route. #### Example ```java -final var source = 'D'; -final var target = 'C'; +var source = 'D'; +var target = 'C'; -final var routeOne = shortest.findPath(graph, source, target); -final var routeTwo = fastest.findPath(graph, source, target); +var routeOne = shortest.findPath(graph, source, target); +var routeTwo = fastest.findPath(graph, source, target); ``` As result, you get a list with the path. From 292c4dd078ab8c03860af52f69cebd1f211321cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 22:30:29 +0200 Subject: [PATCH 019/118] Update index.md --- docs/index.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/index.md b/docs/index.md index a3e6ae2..729b573 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,4 @@ -## Graph search algorithms +# Graph search algorithms The project implements a class for the general structure of the graph, as well as two algorithms for finding a path in the graph. @@ -10,11 +10,11 @@ There are implementations and tests for two algorithms: The implementation is written in Java 17. [API documentation](api) is available. You can also see the [specifications](spock-reports) for the classes generated with the spock-reports. -### How to use the classes in your program +## How to use the classes in your program The first step is create a graph structure. The [Graph class](https://algorithms.jc.id.lv/api/lv/id/jc/algorithm/graph/Graph.html) is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. -#### Example +### Example In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). ```java @@ -32,7 +32,7 @@ var graph = new Graph(Map.of( The second step is creating a search algorithm class. You can choose one of the two algorithms. -#### Example +### Example ```java var fastest = new DijkstrasAlgorithm(); @@ -41,7 +41,7 @@ var shortest = new BreadthFirstSearch(); Now we can search for the route. -#### Example +### Example ```java var source = 'D'; @@ -58,11 +58,11 @@ routeOne == ['D', 'C'] routeTwo == ['D', 'E', 'F', 'G', 'C'] ``` -### Unit Tests +## Unit Tests Tests are written in groove language. For unit testing, the Spock framework was used. To test the operation of the algorithms, the following sample graphs were created. -#### Small Graph Sample +### Small Graph Sample ```groovy def graph = new Graph([ @@ -75,7 +75,7 @@ Tests are written in groove language. For unit testing, the Spock framework was ![Small Graph](assets/small.gif) -#### Medium Graph Sample +### Medium Graph Sample ```groovy def graph = new Graph([ @@ -89,8 +89,7 @@ Tests are written in groove language. For unit testing, the Spock framework was ![Medium Graph](assets/medium.gif) - -#### Complex Graph Sample +### Complex Graph Sample ```groovy def graph = new Graph([ From a27791384cde31f2fef2495691702d1d2ca71763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 2 Jan 2022 22:39:45 +0200 Subject: [PATCH 020/118] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4de072d..f049f6c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ This project was created to test graph search algorithms. There are implementations and tests for two algorithms: -- [Breadth-first search](src/main/java/graph/BreadthFirstSearch.java) -- [Dijkstra's Algorithm](src/main/java/graph/DijkstrasAlgorithm.java) +- Breadth-first search +- Dijkstra's Algorithm ## Technical specifications From 65157ed1a97e646739e8d4e0979ef224c2583b92 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 08:35:27 +0200 Subject: [PATCH 021/118] Add .gitignore --- .gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 From 1ed92921da2f36d489adb977cbd790a7dc231e87 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 08:37:44 +0200 Subject: [PATCH 022/118] Add LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3142a59 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Jegors Čemisovs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file From 10337b67ea0519fba266ef929d6b056ce1fe838e Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 08:44:51 +0200 Subject: [PATCH 023/118] Updated .gitignore --- .gitignore | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.gitignore b/.gitignore index e69de29..f6119d5 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,35 @@ +############################## +## Java +############################## +.mtj.tmp/ +*.class +*.jar +*.war +*.ear +*.nar +hs_err_pid* + +############################## +## Gradle +############################## +bin/ +build/ +.gradle +.gradletasknamecache +gradle-app.setting +!gradle-wrapper.jar + +############################## +## IntelliJ +############################## +out/ +.idea/ +.idea_modules/ +*.iml +*.ipr +*.iws + +############################## +## OS X +############################## +.DS_Store \ No newline at end of file From cdd919d8b55ce0e0c5f0fc08ae7f481431b3bcc4 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 09:04:27 +0200 Subject: [PATCH 024/118] Updated DijkstrasAlgorithm --- docs/spock-reports/aggregated_report.json | 2 +- .../graph.BreadthFirstSearchSpec.html | 63 +++++++++- .../graph.DijkstrasAlgorithmSpec.html | 118 +++++++++++++++++- docs/spock-reports/graph.GraphSpec.html | 4 +- .../graph.SearchAlgorithmSpec.html | 4 +- docs/spock-reports/index.html | 24 ++-- .../algorithm/graph/DijkstrasAlgorithm.java | 12 +- .../graph/BreadthFirstSearchSpec.groovy | 16 ++- .../graph/DijkstrasAlgorithmSpec.groovy | 27 +++- 9 files changed, 230 insertions(+), 40 deletions(-) diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index 72d984c..7f5d1ab 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"}} \ No newline at end of file +{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file diff --git a/docs/spock-reports/graph.BreadthFirstSearchSpec.html b/docs/spock-reports/graph.BreadthFirstSearchSpec.html index 2ee9b29..4bd7901 100644 --- a/docs/spock-reports/graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

Report for graph.BreadthFirstSearchSpec

Summary:

-
Created on Sun Jan 02 19:53:52 EET 2022 by rabes
+
Created on Mon Jan 03 09:03:11 EET 2022 by jegors.cemisovs
@@ -266,13 +266,13 @@

Summary:

- - + + - +
2233 0 0 0 100.0%0.204 seconds0.069 seconds
@@ -301,6 +301,9 @@

Features:

  • should find a route for complex graph
  • +
  • +should return an empty path if can't find a route +
  • @@ -577,6 +580,58 @@

    Features:

    7/7 passed
    + + +
    +should return an empty path if can't find a route + +Return + +
    + + + + +
    Given:
    + + +
    a simple graph with no edge between nodes
    + + + + + +
    def graph = new Graph([A: [:], B: [:]])
    + + + + +
    When:
    + + +
    we use Breadth First Search algorithm to find a path
    + + + + + +
    def path = algorithm.findPath(graph, 'A', 'B')
    + + + + +
    Then:
    + + +
    we get an empty path
    + + + + + +
    path == []
    + +
    diff --git a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html index 59332e8..3dc0240 100644 --- a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

    Report for graph.DijkstrasAlgorithmSpec

    Summary:

    -
    Created on Sun Jan 02 19:53:53 EET 2022 by rabes
    +
    Created on Mon Jan 03 09:03:11 EET 2022 by jegors.cemisovs
    @@ -266,13 +266,13 @@

    Summary:

    - - + + - +
    3355 0 0 0 100.0%0.074 seconds0.031 seconds
    @@ -304,6 +304,12 @@

    Features:

  • should find a route for a complex graph
  • +
  • +should throw NPE for an empty graph +
  • +
  • +should return an empty path if can't find a route +
  • @@ -748,6 +754,110 @@

    Features:

    12/12 passed
    + + +
    +should throw NPE for an empty graph + +Return + +
    + + + + +
    Given:
    + + +
    an empty graph
    + + + + + +
    def graph = new Graph([:])
    + + + + +
    When:
    + + +
    we use Dijkstra's algorithm to find a path
    + + + + + +
    algorithm.findPath(graph, _, _)
    + + + + +
    Then:
    + + +
    the exception thrown
    + + + + + +
    thrown NullPointerException
    + + + + +
    +should return an empty path if can't find a route + +Return + +
    + + + + +
    Given:
    + + +
    a simple graph with no edge between nodes
    + + + + + +
    def graph = new Graph([A: [:], B: [:]])
    + + + + +
    When:
    + + +
    we use Dijkstra's algorithm to find a path
    + + + + + +
    def path = algorithm.findPath(graph, 'A', 'B')
    + + + + +
    Then:
    + + +
    we get an empty path
    + + + + + +
    path == []
    + +
    diff --git a/docs/spock-reports/graph.GraphSpec.html b/docs/spock-reports/graph.GraphSpec.html index 97f7122..80de476 100644 --- a/docs/spock-reports/graph.GraphSpec.html +++ b/docs/spock-reports/graph.GraphSpec.html @@ -251,7 +251,7 @@

    Report for graph.GraphSpec

    Summary:

    -
    Created on Sun Jan 02 19:53:53 EET 2022 by rabes
    +
    Created on Mon Jan 03 09:03:11 EET 2022 by jegors.cemisovs
    @@ -272,7 +272,7 @@

    Summary:

    - +
    0 0 100.0%0.154 seconds0.069 seconds
    diff --git a/docs/spock-reports/graph.SearchAlgorithmSpec.html b/docs/spock-reports/graph.SearchAlgorithmSpec.html index e8529b8..8d59f7e 100644 --- a/docs/spock-reports/graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/graph.SearchAlgorithmSpec.html @@ -251,7 +251,7 @@

    Report for graph.SearchAlgorithmSpec

    Summary:

    -
    Created on Sun Jan 02 19:53:53 EET 2022 by rabes
    +
    Created on Mon Jan 03 09:03:11 EET 2022 by jegors.cemisovs
    @@ -272,7 +272,7 @@

    Summary:

    - +
    0 0 100.0%0.061 seconds0.016 seconds
    diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index f78c75b..f401742 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

    Specification run results

    Specifications summary:

    -
    Created on Sun Jan 02 19:53:54 EET 2022 by rabes
    +
    Created on Mon Jan 03 09:03:11 EET 2022 by jegors.cemisovs
    @@ -106,12 +106,12 @@

    Specifications summary:

    - - + + - +
    4 0 011111414 0 0 100.0%0.493 seconds0.185 seconds
    @@ -136,26 +136,26 @@

    Specifications:

    graph.BreadthFirstSearchSpec
    Breadth First Search Algorithm
    -2 -2 +3 +3 0 0 0 100.0% -0.204 seconds +0.069 seconds graph.DijkstrasAlgorithmSpec
    Dijkstra's Algorithm
    -3 -3 +5 +5 0 0 0 100.0% -0.074 seconds +0.031 seconds @@ -168,7 +168,7 @@

    Specifications:

    0 0 100.0% -0.154 seconds +0.069 seconds @@ -181,7 +181,7 @@

    Specifications:

    0 0 100.0% -0.061 seconds +0.016 seconds diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index c3d4352..4da7248 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -9,7 +9,7 @@ /** * Algorithm for finding the fastest paths between nodes in a graph. - * + *

    * The algorithm uses information about edge's distance to find the fastest path. * * @param type of vertex id @@ -35,10 +35,12 @@ public List findPath(Graph graph, T source, T target) { } }); } - - final var path = new LinkedList(); - iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst); - return path; + if (previous.containsKey(target) || source.equals(target)) { + final var path = new LinkedList(); + iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst); + return path; + } + return List.of(); } } diff --git a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy b/src/test/groovy/graph/BreadthFirstSearchSpec.groovy index a739879..6f41406 100644 --- a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy +++ b/src/test/groovy/graph/BreadthFirstSearchSpec.groovy @@ -2,11 +2,7 @@ package graph import lv.id.jc.algorithm.graph.BreadthFirstSearch import lv.id.jc.algorithm.graph.Graph -import spock.lang.Narrative -import spock.lang.See -import spock.lang.Specification -import spock.lang.Subject -import spock.lang.Title +import spock.lang.* @Title("Breadth First Search Algorithm") @See("https://en.wikipedia.org/wiki/Breadth-first_search") @@ -75,4 +71,14 @@ class BreadthFirstSearchSpec extends Specification { time = shortest.size() - 1 } + def "should return an empty path if can't find a route"() { + given: 'a simple graph with no edge between nodes' + def graph = new Graph([A: [:], B: [:]]) + + when: 'we use Breadth First Search algorithm to find a path' + def path = algorithm.findPath(graph, 'A', 'B') + + then: 'we get an empty path' + path == [] + } } diff --git a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy b/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy index 8780ea1..172e043 100644 --- a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy +++ b/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy @@ -2,11 +2,7 @@ package graph import lv.id.jc.algorithm.graph.DijkstrasAlgorithm import lv.id.jc.algorithm.graph.Graph -import spock.lang.Narrative -import spock.lang.See -import spock.lang.Specification -import spock.lang.Subject -import spock.lang.Title +import spock.lang.* @Title("Dijkstra's Algorithm") @See("https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm") @@ -107,4 +103,25 @@ class DijkstrasAlgorithmSpec extends Specification { 'D' | 'H' || 33 | ['D', 'E', 'F', 'G', 'C', 'B', 'A', 'H'] } + def 'should throw NPE for an empty graph'() { + given: 'an empty graph' + def graph = new Graph([:]) + + when: "we use Dijkstra's algorithm to find a path" + algorithm.findPath(graph, _, _) + + then: 'the exception thrown' + thrown NullPointerException + } + + def "should return an empty path if can't find a route"() { + given: 'a simple graph with no edge between nodes' + def graph = new Graph([A: [:], B: [:]]) + + when: "we use Dijkstra's algorithm to find a path" + def path = algorithm.findPath(graph, 'A', 'B') + + then: 'we get an empty path' + path == [] + } } From d7bb4cccea4ea2d62fac962f09642eed828717a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:18:52 +0200 Subject: [PATCH 025/118] Update LICENSE --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 3142a59..244293b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Jegors Čemisovs +Copyright (c) 2022 Jegors Čemisovs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. From 6d3052b74a2ec2fe6e8cd10b32e50d0aaa418de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:19:11 +0200 Subject: [PATCH 026/118] Update settings.gradle --- settings.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/settings.gradle b/settings.gradle index b28714d..89fef3f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1 @@ rootProject.name = 'search-algorithm' -include 'sample' - From bd229cd7c37ec1d499deca10914d685c42071f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:20:35 +0200 Subject: [PATCH 027/118] Update build.gradle --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 29cedc6..be9a153 100644 --- a/build.gradle +++ b/build.gradle @@ -13,12 +13,15 @@ repositories { dependencies { implementation 'org.codehaus.groovy:groovy-all:3.0.9' + // Spock Framework testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' testImplementation 'org.codehaus.groovy:groovy-all:3.0.9' + // Spock Reports testRuntimeClasspath( "com.athaydes:spock-reports:2.1.1-groovy-3.0" ) { // transitive = false // this avoids affecting your version of Groovy/Spock } + // Required for spock-reports testImplementation 'org.slf4j:slf4j-api:1.7.32' testRuntimeClasspath 'org.slf4j:slf4j-simple:1.7.32' } From 5b06ba4d166ab40d0108955e96fdbcc91ad1728d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:24:00 +0200 Subject: [PATCH 028/118] Update Graph.java --- src/main/java/lv/id/jc/algorithm/graph/Graph.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java index 8f91b2c..a28ddcb 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ b/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -7,7 +7,7 @@ /** * A generic graph representation * - * @param type of vertex id + * @param the type of vertex id in this graph */ public record Graph(Map> nodes) { From c3fd805acb94cf605c14c39c562e4605a5ac043f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:24:51 +0200 Subject: [PATCH 029/118] Update SearchAlgorithm.java --- src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java index 166a67e..78e77ec 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java @@ -5,7 +5,7 @@ /** * A functional interface for graph search algorithm * - * @param type of vertex id + * @param the type of vertex id */ @FunctionalInterface public interface SearchAlgorithm { From 2e2158176bf42b0f9bad2291e048adf71685d16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:25:16 +0200 Subject: [PATCH 030/118] Update BreadthFirstSearch.java --- src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java index 6d5e0fd..119aed1 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java +++ b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -14,7 +14,7 @@ * * The algorithm doesn't take into account the distance between nodes. * - * @param type of vertex id + * @param the type of vertex id */ public class BreadthFirstSearch implements SearchAlgorithm { From 0044d6d228f66ce501b56eaf1c36470532046125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:25:38 +0200 Subject: [PATCH 031/118] Update DijkstrasAlgorithm.java --- src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index 4da7248..f5ae5f3 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -12,7 +12,7 @@ *

    * The algorithm uses information about edge's distance to find the fastest path. * - * @param type of vertex id + * @param the type of vertex id */ public class DijkstrasAlgorithm implements SearchAlgorithm { From adac994c0cd7cb3c57f1c427d5a6090f5eee07db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:29:38 +0200 Subject: [PATCH 032/118] Update Graph.java --- src/main/java/lv/id/jc/algorithm/graph/Graph.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java index a28ddcb..a7a536b 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ b/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -7,7 +7,9 @@ /** * A generic graph representation * + * @author Jegors Čemisovs * @param the type of vertex id in this graph + * @since 1.0 */ public record Graph(Map> nodes) { From bf2b11ec3e570d9ffa584c5877dcba300e132927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:32:06 +0200 Subject: [PATCH 033/118] Update SearchAlgorithm.java --- src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java index 78e77ec..1b3ed02 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java @@ -6,6 +6,7 @@ * A functional interface for graph search algorithm * * @param the type of vertex id + * @since 1.0 */ @FunctionalInterface public interface SearchAlgorithm { From a87d1f23137908cf30d086ee1bf0bd8485dd4e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:32:44 +0200 Subject: [PATCH 034/118] Update SearchAlgorithm.java --- src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java index 1b3ed02..7048c50 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java @@ -5,6 +5,7 @@ /** * A functional interface for graph search algorithm * + * @author Jegors Čemisovs * @param the type of vertex id * @since 1.0 */ From a3f7b9780f62587bad92c5be517061c18ed63c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:33:07 +0200 Subject: [PATCH 035/118] Update BreadthFirstSearch.java --- src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java index 119aed1..eaadcdb 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java +++ b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -14,6 +14,7 @@ * * The algorithm doesn't take into account the distance between nodes. * + * @author Jegors Čemisovs * @param the type of vertex id */ public class BreadthFirstSearch implements SearchAlgorithm { From c2c11c76060ddab7ac61f29a9e44b13c7a2146fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:33:28 +0200 Subject: [PATCH 036/118] Update DijkstrasAlgorithm.java --- src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index f5ae5f3..d808348 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -12,6 +12,7 @@ *

    * The algorithm uses information about edge's distance to find the fastest path. * + * @author Jegors Čemisovs * @param the type of vertex id */ public class DijkstrasAlgorithm implements SearchAlgorithm { From 71379eef31cc386a8885be561cd95837b96000de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:35:17 +0200 Subject: [PATCH 037/118] Update BreadthFirstSearch.java --- src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java index eaadcdb..ffb8e29 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java +++ b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -20,7 +20,7 @@ public class BreadthFirstSearch implements SearchAlgorithm { @Override - public List findPath(Graph graph, T source, T target) { + public List findPath(final Graph graph, T source, T target) { final var queue = new LinkedList(); final var visited = new HashSet(); final var previous = new HashMap(); From 64d00f458b1ac021bcb3f94c8b290cfd5276229f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:35:36 +0200 Subject: [PATCH 038/118] Update DijkstrasAlgorithm.java --- src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index d808348..d65eb54 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -18,7 +18,7 @@ public class DijkstrasAlgorithm implements SearchAlgorithm { @Override - public List findPath(Graph graph, T source, T target) { + public List findPath(final Graph graph, T source, T target) { final var queue = new LinkedList(); final var distances = new HashMap(); final var previous = new HashMap(); From fc60a2ff318f4abff27ada214f9d8a36ff92fc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:36:21 +0200 Subject: [PATCH 039/118] Update BreadthFirstSearch.java --- src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java index ffb8e29..cd8c44d 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java +++ b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -16,6 +16,7 @@ * * @author Jegors Čemisovs * @param the type of vertex id + * @since 1.0 */ public class BreadthFirstSearch implements SearchAlgorithm { From 73e6f3a0d52edc3af94d84f18ec3fc6c2d0fce33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:36:39 +0200 Subject: [PATCH 040/118] Update DijkstrasAlgorithm.java --- src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index d65eb54..48349a1 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -14,6 +14,7 @@ * * @author Jegors Čemisovs * @param the type of vertex id + * @since 1.0 */ public class DijkstrasAlgorithm implements SearchAlgorithm { From a742afc4b97036905441dd6e327c6e5e38fc9844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:58:44 +0200 Subject: [PATCH 041/118] Update Graph.java --- src/main/java/lv/id/jc/algorithm/graph/Graph.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java index a7a536b..eb3606c 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ b/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -30,7 +30,7 @@ public Map edges(T id) { * @return distance for the given path as double * @throws NullPointerException if path is incorrect and contains more than one vertex */ - public double getDistance(final List path) { + public double getDistance(List path) { return IntStream .range(1, path.size()) .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i))) From 3c4f3eaf52ac0edd518f81808b519fdbff70dae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 10:59:53 +0200 Subject: [PATCH 042/118] Update BreadthFirstSearch.java --- .../lv/id/jc/algorithm/graph/BreadthFirstSearch.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java index cd8c44d..0f08f94 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java +++ b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -21,16 +21,16 @@ public class BreadthFirstSearch implements SearchAlgorithm { @Override - public List findPath(final Graph graph, T source, T target) { - final var queue = new LinkedList(); - final var visited = new HashSet(); - final var previous = new HashMap(); + public List findPath(Graph graph, T source, T target) { + var queue = new LinkedList(); + var visited = new HashSet(); + var previous = new HashMap(); queue.add(source); while (!queue.isEmpty()) { - final var node = queue.removeFirst(); + var node = queue.removeFirst(); if (target.equals(node)) { - final var path = new LinkedList(); + var path = new LinkedList(); iterate(node, Objects::nonNull, previous::get).forEach(path::addFirst); return path; } From 107e06ff4c243be8aa5dd0f25997170e1303c3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 11:00:59 +0200 Subject: [PATCH 043/118] Update DijkstrasAlgorithm.java --- .../id/jc/algorithm/graph/DijkstrasAlgorithm.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index 48349a1..b0c5858 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -19,17 +19,17 @@ public class DijkstrasAlgorithm implements SearchAlgorithm { @Override - public List findPath(final Graph graph, T source, T target) { - final var queue = new LinkedList(); - final var distances = new HashMap(); - final var previous = new HashMap(); + public List findPath(Graph graph, T source, T target) { + var queue = new LinkedList(); + var distances = new HashMap(); + var previous = new HashMap(); queue.add(source); distances.put(source, .0); while (!queue.isEmpty()) { - final var prev = queue.removeFirst(); + var prev = queue.removeFirst(); graph.edges(prev).forEach((node, time) -> { - final var distance = distances.get(prev) + time.doubleValue(); + var distance = distances.get(prev) + time.doubleValue(); if (distance < distances.getOrDefault(node, Double.MAX_VALUE)) { previous.put(node, prev); distances.put(node, distance); @@ -38,7 +38,7 @@ public List findPath(final Graph graph, T source, T target) { }); } if (previous.containsKey(target) || source.equals(target)) { - final var path = new LinkedList(); + var path = new LinkedList(); iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst); return path; } From 8b44e13db3988b4992fb1fa14041139ef65baf55 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 14:18:23 +0200 Subject: [PATCH 044/118] Changed Graph from record to interface --- .idea/gradle.xml | 3 +- .idea/misc.xml | 3 +- docs/api/allclasses-index.html | 21 ++-- docs/api/allpackages-index.html | 9 +- docs/api/element-list | 1 + docs/api/help-doc.html | 17 ++- docs/api/index-files/index-1.html | 15 +-- docs/api/index-files/index-2.html | 15 +-- docs/api/index-files/index-3.html | 17 ++- docs/api/index-files/index-4.html | 17 +-- docs/api/index-files/index-5.html | 23 ++-- docs/api/index-files/index-6.html | 23 ++-- docs/api/index-files/index-7.html | 21 ++-- docs/api/index-files/index-8.html | 25 ++-- docs/api/index.html | 12 +- docs/api/member-search-index.js | 2 +- docs/api/module-search-index.js | 2 +- docs/api/overview-tree.html | 19 ++- docs/api/package-search-index.js | 2 +- docs/coverage/index.html | 47 ++----- docs/coverage/index_SORT_BY_BLOCK.html | 47 ++----- docs/coverage/index_SORT_BY_BLOCK_DESC.html | 47 ++----- docs/coverage/index_SORT_BY_CLASS.html | 47 ++----- docs/coverage/index_SORT_BY_CLASS_DESC.html | 47 ++----- docs/coverage/index_SORT_BY_LINE.html | 47 ++----- docs/coverage/index_SORT_BY_LINE_DESC.html | 47 ++----- docs/coverage/index_SORT_BY_METHOD.html | 47 ++----- docs/coverage/index_SORT_BY_METHOD_DESC.html | 47 ++----- docs/coverage/index_SORT_BY_NAME_DESC.html | 47 ++----- docs/coverage/ns-1/index.html | 90 +++++++++++--- docs/coverage/ns-1/index_SORT_BY_BLOCK.html | 90 +++++++++++--- .../ns-1/index_SORT_BY_BLOCK_DESC.html | 90 +++++++++++--- docs/coverage/ns-1/index_SORT_BY_CLASS.html | 90 +++++++++++--- .../ns-1/index_SORT_BY_CLASS_DESC.html | 90 +++++++++++--- docs/coverage/ns-1/index_SORT_BY_LINE.html | 90 +++++++++++--- .../ns-1/index_SORT_BY_LINE_DESC.html | 90 +++++++++++--- docs/coverage/ns-1/index_SORT_BY_METHOD.html | 90 +++++++++++--- .../ns-1/index_SORT_BY_METHOD_DESC.html | 90 +++++++++++--- .../ns-1/index_SORT_BY_NAME_DESC.html | 90 +++++++++++--- docs/coverage/ns-1/sources/source-1.html | 115 +++++++++--------- docs/spock-reports/aggregated_report.json | 2 +- .../graph.BreadthFirstSearchSpec.html | 10 +- .../graph.DijkstrasAlgorithmSpec.html | 14 +-- docs/spock-reports/graph.GraphSpec.html | 14 +-- .../graph.SearchAlgorithmSpec.html | 6 +- docs/spock-reports/index.html | 12 +- .../java/lv/id/jc/algorithm/graph/Graph.java | 38 ++++-- .../graph/BreadthFirstSearchSpec.groovy | 6 +- .../graph/DijkstrasAlgorithmSpec.groovy | 10 +- src/test/groovy/graph/GraphSpec.groovy | 10 +- .../groovy/graph/SearchAlgorithmSpec.groovy | 2 +- 51 files changed, 1078 insertions(+), 778 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 36dedf8..1b3f3e9 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,13 +5,12 @@

    -
    +
    Class
    Description
    - +
    Algorithm for finding the shortest paths between nodes in a graph.
    - +
    Algorithm for finding the fastest paths between nodes in a graph.
    - -
    -
    A generic graph representation
    + +
    +
    An interface for weighted directed graph (network)
    - +
    A functional interface for graph search algorithm
    diff --git a/docs/api/allpackages-index.html b/docs/api/allpackages-index.html index 6969e6d..a1e6d58 100644 --- a/docs/api/allpackages-index.html +++ b/docs/api/allpackages-index.html @@ -1,11 +1,11 @@ - + All Packages - + @@ -28,7 +28,8 @@ diff --git a/docs/api/index-files/index-5.html b/docs/api/index-files/index-5.html index feac713..6b12f43 100644 --- a/docs/api/index-files/index-5.html +++ b/docs/api/index-files/index-5.html @@ -1,11 +1,11 @@ - + G-Index - + @@ -28,7 +28,8 @@
    diff --git a/docs/api/index-files/index-6.html b/docs/api/index-files/index-6.html index 3ed54e6..de7fe0b 100644 --- a/docs/api/index-files/index-6.html +++ b/docs/api/index-files/index-6.html @@ -1,12 +1,12 @@ - -H-Index + +L-Index - - + + @@ -28,7 +28,8 @@
    diff --git a/docs/api/index-files/index-7.html b/docs/api/index-files/index-7.html index f85af6f..351c82b 100644 --- a/docs/api/index-files/index-7.html +++ b/docs/api/index-files/index-7.html @@ -1,12 +1,12 @@ - -L-Index + +O-Index - - + + @@ -28,7 +28,8 @@
    diff --git a/docs/api/index-files/index-8.html b/docs/api/index-files/index-8.html index 93fc3ff..cea43d3 100644 --- a/docs/api/index-files/index-8.html +++ b/docs/api/index-files/index-8.html @@ -1,12 +1,12 @@ - -N-Index + +S-Index - - + + @@ -28,7 +28,8 @@
    diff --git a/docs/api/index.html b/docs/api/index.html index c06cec9..18bc4ee 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -1,18 +1,18 @@ - + Generated Documentation (Untitled) - + - + - + @@ -20,7 +20,7 @@ -

    lv/id/jc/algorithm/graph/package-summary.html

    +

    lv.id.jc.algorithm/module-summary.html

    diff --git a/docs/api/member-search-index.js b/docs/api/member-search-index.js index 1abfd10..c918352 100644 --- a/docs/api/member-search-index.js +++ b/docs/api/member-search-index.js @@ -1 +1 @@ -memberSearchIndex = [{"p":"lv.id.jc.algorithm.graph","c":"BreadthFirstSearch","l":"BreadthFirstSearch()","u":"%3Cinit%3E()"},{"p":"lv.id.jc.algorithm.graph","c":"DijkstrasAlgorithm","l":"DijkstrasAlgorithm()","u":"%3Cinit%3E()"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"edges(T)"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"equals(Object)","u":"equals(java.lang.Object)"},{"p":"lv.id.jc.algorithm.graph","c":"BreadthFirstSearch","l":"findPath(Graph, T, T)","u":"findPath(lv.id.jc.algorithm.graph.Graph,T,T)"},{"p":"lv.id.jc.algorithm.graph","c":"DijkstrasAlgorithm","l":"findPath(Graph, T, T)","u":"findPath(lv.id.jc.algorithm.graph.Graph,T,T)"},{"p":"lv.id.jc.algorithm.graph","c":"SearchAlgorithm","l":"findPath(Graph, T, T)","u":"findPath(lv.id.jc.algorithm.graph.Graph,T,T)"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"getDistance(List)","u":"getDistance(java.util.List)"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"Graph(Map>)","u":"%3Cinit%3E(java.util.Map)"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"hashCode()"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"nodes()"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"toString()"}];updateSearchResults(); \ No newline at end of file +memberSearchIndex = [{"p":"lv.id.jc.algorithm.graph","c":"BreadthFirstSearch","l":"BreadthFirstSearch()","u":"%3Cinit%3E()"},{"p":"lv.id.jc.algorithm.graph","c":"DijkstrasAlgorithm","l":"DijkstrasAlgorithm()","u":"%3Cinit%3E()"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"edges(T)"},{"p":"lv.id.jc.algorithm.graph","c":"BreadthFirstSearch","l":"findPath(Graph, T, T)","u":"findPath(lv.id.jc.algorithm.graph.Graph,T,T)"},{"p":"lv.id.jc.algorithm.graph","c":"DijkstrasAlgorithm","l":"findPath(Graph, T, T)","u":"findPath(lv.id.jc.algorithm.graph.Graph,T,T)"},{"p":"lv.id.jc.algorithm.graph","c":"SearchAlgorithm","l":"findPath(Graph, T, T)","u":"findPath(lv.id.jc.algorithm.graph.Graph,T,T)"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"getDistance(List)","u":"getDistance(java.util.List)"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"of(Map>)","u":"of(java.util.Map)"},{"p":"lv.id.jc.algorithm.graph","c":"Graph","l":"schema()"}];updateSearchResults(); \ No newline at end of file diff --git a/docs/api/module-search-index.js b/docs/api/module-search-index.js index 0d59754..32ef47e 100644 --- a/docs/api/module-search-index.js +++ b/docs/api/module-search-index.js @@ -1 +1 @@ -moduleSearchIndex = [];updateSearchResults(); \ No newline at end of file +moduleSearchIndex = [{"l":"lv.id.jc.algorithm"}];updateSearchResults(); \ No newline at end of file diff --git a/docs/api/overview-tree.html b/docs/api/overview-tree.html index b796418..ddffc1c 100644 --- a/docs/api/overview-tree.html +++ b/docs/api/overview-tree.html @@ -1,11 +1,11 @@ - + Class Hierarchy - + @@ -28,6 +28,7 @@
    @@ -59,13 +60,8 @@

    Class Hierarchy

    @@ -73,7 +69,8 @@

    Class Hierarchy

    Interface Hierarchy

    diff --git a/docs/api/package-search-index.js b/docs/api/package-search-index.js index c2cd73a..6b48c9b 100644 --- a/docs/api/package-search-index.js +++ b/docs/api/package-search-index.js @@ -1 +1 @@ -packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"l":"lv.id.jc.algorithm.graph"}];updateSearchResults(); \ No newline at end of file +packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"m":"lv.id.jc.algorithm","l":"lv.id.jc.algorithm.graph"}];updateSearchResults(); \ No newline at end of file diff --git a/docs/coverage/index.html b/docs/coverage/index.html index efed1ba..06dd3a2 100644 --- a/docs/coverage/index.html +++ b/docs/coverage/index.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,34 +85,7 @@

    Coverage Breakdown

    - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% - - - (0/23) - - - - - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -131,10 +104,10 @@

    Coverage Breakdown

    - 97.7% + 100% - (43/44) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_BLOCK.html b/docs/coverage/index_SORT_BY_BLOCK.html index db88271..65b8b59 100644 --- a/docs/coverage/index_SORT_BY_BLOCK.html +++ b/docs/coverage/index_SORT_BY_BLOCK.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,34 +85,7 @@

    Coverage Breakdown

    - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% - - - (0/23) - - - - - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -131,10 +104,10 @@

    Coverage Breakdown

    - 97.7% + 100% - (43/44) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_BLOCK_DESC.html b/docs/coverage/index_SORT_BY_BLOCK_DESC.html index 354eab1..c1282e8 100644 --- a/docs/coverage/index_SORT_BY_BLOCK_DESC.html +++ b/docs/coverage/index_SORT_BY_BLOCK_DESC.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,7 +85,7 @@

    Coverage Breakdown

    - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -104,37 +104,10 @@

    Coverage Breakdown

    - 97.7% - - - (43/44) - - - - - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% + 100% - (0/23) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_CLASS.html b/docs/coverage/index_SORT_BY_CLASS.html index 79db42a..30051bc 100644 --- a/docs/coverage/index_SORT_BY_CLASS.html +++ b/docs/coverage/index_SORT_BY_CLASS.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,34 +85,7 @@

    Coverage Breakdown

    - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% - - - (0/23) - - - - - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -131,10 +104,10 @@

    Coverage Breakdown

    - 97.7% + 100% - (43/44) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_CLASS_DESC.html b/docs/coverage/index_SORT_BY_CLASS_DESC.html index 4a3904a..cb18574 100644 --- a/docs/coverage/index_SORT_BY_CLASS_DESC.html +++ b/docs/coverage/index_SORT_BY_CLASS_DESC.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,7 +85,7 @@

    Coverage Breakdown

    - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -104,37 +104,10 @@

    Coverage Breakdown

    - 97.7% - - - (43/44) - - - - - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% + 100% - (0/23) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_LINE.html b/docs/coverage/index_SORT_BY_LINE.html index 3e4aa08..4ba5659 100644 --- a/docs/coverage/index_SORT_BY_LINE.html +++ b/docs/coverage/index_SORT_BY_LINE.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,34 +85,7 @@

    Coverage Breakdown

    - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% - - - (0/23) - - - - - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -131,10 +104,10 @@

    Coverage Breakdown

    - 97.7% + 100% - (43/44) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_LINE_DESC.html b/docs/coverage/index_SORT_BY_LINE_DESC.html index ea6c673..bcf7204 100644 --- a/docs/coverage/index_SORT_BY_LINE_DESC.html +++ b/docs/coverage/index_SORT_BY_LINE_DESC.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,7 +85,7 @@

    Coverage Breakdown

    - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -104,37 +104,10 @@

    Coverage Breakdown

    - 97.7% - - - (43/44) - - - - - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% + 100% - (0/23) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_METHOD.html b/docs/coverage/index_SORT_BY_METHOD.html index 438fee7..73fc829 100644 --- a/docs/coverage/index_SORT_BY_METHOD.html +++ b/docs/coverage/index_SORT_BY_METHOD.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,34 +85,7 @@

    Coverage Breakdown

    - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% - - - (0/23) - - - - - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -131,10 +104,10 @@

    Coverage Breakdown

    - 97.7% + 100% - (43/44) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_METHOD_DESC.html b/docs/coverage/index_SORT_BY_METHOD_DESC.html index 562dafb..e5a2942 100644 --- a/docs/coverage/index_SORT_BY_METHOD_DESC.html +++ b/docs/coverage/index_SORT_BY_METHOD_DESC.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,7 +85,7 @@

    Coverage Breakdown

    - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -104,37 +104,10 @@

    Coverage Breakdown

    - 97.7% - - - (43/44) - - - - - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% + 100% - (0/23) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/index_SORT_BY_NAME_DESC.html b/docs/coverage/index_SORT_BY_NAME_DESC.html index 7467fdd..41f4e66 100644 --- a/docs/coverage/index_SORT_BY_NAME_DESC.html +++ b/docs/coverage/index_SORT_BY_NAME_DESC.html @@ -38,26 +38,26 @@

    Overall Coverage Summary

    all classes - 75% + 100% - (3/4) + (3/3) - 69.2% + 100% - (9/13) + (9/9) - 64.2% + 100% - (43/67) + (46/46) @@ -85,7 +85,7 @@

    Coverage Breakdown

    - lv.id.jc.algorithm.graph + lv.id.jc.algorithm.graph 100% @@ -104,37 +104,10 @@

    Coverage Breakdown

    - 97.7% - - - (43/44) - - - - - lv.id.jc - - - 0% - - - (0/1) - - - - - 0% - - - (0/4) - - - - - 0% + 100% - (0/23) + (46/46) @@ -163,7 +136,7 @@

    Coverage Breakdown

    diff --git a/docs/coverage/ns-1/index.html b/docs/coverage/ns-1/index.html index 7922325..d7ef189 100644 --- a/docs/coverage/ns-1/index.html +++ b/docs/coverage/ns-1/index.html @@ -2,7 +2,7 @@ - Coverage Report > lv.id.jc + Coverage Report > lv.id.jc.algorithm.graph + + + + +
    + + +

    Coverage Summary for Class: DijkstrasAlgorithm (lv.id.jc.algorithm.graph)

    + + + + + + + + + + + + + + + +
    Class + Class, % + + Method, % + + Line, % +
    DijkstrasAlgorithm + + 100% + + + (1/1) + + + + 100% + + + (3/3) + + + + 100% + + + (20/20) + +
    + +
    +
    + + +
    +
    1 package lv.id.jc.algorithm.graph; +2  +3 import java.util.HashMap; +4 import java.util.LinkedList; +5 import java.util.List; +6 import java.util.Objects; +7  +8 import static java.util.stream.Stream.iterate; +9  +10 /** +11  * Algorithm for finding the fastest paths between nodes in a graph. +12  * <p> +13  * The algorithm uses information about edge's distance to find the fastest path. +14  * +15  * @param <T> type of vertex id +16  */ +17 public class DijkstrasAlgorithm<T> implements SearchAlgorithm<T> { +18  +19  @Override +20  public List<T> findPath(Graph<T> graph, T source, T target) { +21  final var queue = new LinkedList<T>(); +22  final var distances = new HashMap<T, Double>(); +23  final var previous = new HashMap<T, T>(); +24  queue.add(source); +25  distances.put(source, .0); +26  +27  while (!queue.isEmpty()) { +28  final var prev = queue.removeFirst(); +29  graph.edges(prev).forEach((node, time) -> { +30  final var distance = distances.get(prev) + time.doubleValue(); +31  if (distance < distances.getOrDefault(node, Double.MAX_VALUE)) { +32  previous.put(node, prev); +33  distances.put(node, distance); +34  queue.addLast(node); +35  } +36  }); +37  } +38  if (previous.containsKey(target) || source.equals(target)) { +39  final var path = new LinkedList<T>(); +40  iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst); +41  return path; +42  } +43  return List.of(); +44  } +45  +46 } +
    +
    +
    + + + + + + diff --git a/docs/coverage/ns-1/sources/source-3.html b/docs/coverage/ns-1/sources/source-3.html new file mode 100644 index 0000000..56deda3 --- /dev/null +++ b/docs/coverage/ns-1/sources/source-3.html @@ -0,0 +1,153 @@ + + + + + + + Coverage Report > Graph + + + + + +
    + + +

    Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)

    + + + + + + + + + + + + + + + + + + + + + +
    Class + Method, % + + Line, % +
    Graph + + 100% + + + (3/3) + + + + 100% + + + (7/7) + +
    Graph$getDistance
    Total + + 100% + + + (3/3) + + + + 100% + + + (7/7) + +
    + +
    +
    + + +
    +
    1 package lv.id.jc.algorithm.graph; +2  +3 import java.util.List; +4 import java.util.Map; +5 import java.util.stream.IntStream; +6  +7 /** +8  * A generic graph representation +9  * +10  * @param <T> type of vertex id +11  */ +12 public record Graph<T>(Map<T, Map<T, Number>> nodes) { +13  +14  /** +15  * Edges of the given vertex +16  * +17  * @param id vertex (node) +18  * @return all connections for the given vertex id +19  */ +20  public Map<T, Number> edges(T id) { +21  return nodes().get(id); +22  } +23  +24  /** +25  * Returns the calculated distance for the given path +26  * +27  * @param path the list of vertex ids representing the path +28  * @return distance for the given path as double +29  * @throws NullPointerException if path is incorrect and contains more than one vertex +30  */ +31  public double getDistance(final List<T> path) { +32  return IntStream +33  .range(1, path.size()) +34  .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i))) +35  .mapToDouble(Number::doubleValue) +36  .sum(); +37  } +38 } +
    +
    +
    + + + + + + diff --git a/docs/coverage/ns-1/sources/source-4.html b/docs/coverage/ns-1/sources/source-4.html new file mode 100644 index 0000000..fcce85a --- /dev/null +++ b/docs/coverage/ns-1/sources/source-4.html @@ -0,0 +1,93 @@ + + + + + + + Coverage Report > SearchAlgorithm + + + + + +
    + + +

    Coverage Summary for Class: SearchAlgorithm (lv.id.jc.algorithm.graph)

    + + + + + + + + + + + + +
    Class
    SearchAlgorithm$findPath
    Total
    + +
    +
    + + +
    +
    1 package lv.id.jc.algorithm.graph; +2  +3 import java.util.List; +4  +5 /** +6  * A functional interface for graph search algorithm +7  * +8  * @param <T> type of vertex id +9  */ +10 @FunctionalInterface +11 public interface SearchAlgorithm<T> { +12  /** +13  * Find the path from the source node to the target +14  * +15  * @param graph The graph in which we search for the path +16  * @param source Search starting point identifier +17  * @param target Search finish point identifier +18  * @return Path found or empty list if path cannot be found +19  */ +20  List<T> findPath(Graph<T> graph, T source, T target); +21 } +
    +
    +
    + + + + + + From 596a6546f21288a822eb53320df89f8ae5fd1147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 17:14:48 +0200 Subject: [PATCH 047/118] Update index.md --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 026bd02..97debb6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ You can also see the [specifications](spock-reports) for the classes generated w ## How to use the classes in your program -The first step is create a graph structure. The [Graph class](https://algorithms.jc.id.lv/api/lv/id/jc/algorithm/graph/Graph.html) is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. +The first step is create a graph structure. The [Graph](https://algorithms.jc.id.lv/api/lv.id.jc.algorithm/lv/id/jc/algorithm/graph/Graph.html) interface is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. ### Example In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). From b26377e084461641435b2606f65159d4316e2b8d Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 21:18:40 +0200 Subject: [PATCH 048/118] Updated API documentation --- docs/api/allclasses-index.html | 14 +- docs/api/allpackages-index.html | 8 +- docs/api/element-list | 2 +- docs/api/help-doc.html | 6 +- docs/api/index-files/index-1.html | 10 +- docs/api/index-files/index-10.html | 65 ----- docs/api/index-files/index-2.html | 10 +- docs/api/index-files/index-3.html | 11 +- docs/api/index-files/index-4.html | 12 +- docs/api/index-files/index-5.html | 10 +- docs/api/index-files/index-6.html | 14 +- docs/api/index-files/index-7.html | 10 +- docs/api/index-files/index-8.html | 12 +- docs/api/index-files/index-9.html | 65 ----- docs/api/index.html | 10 +- .../algorithm/graph/BreadthFirstSearch.html | 8 +- .../algorithm/graph/DijkstrasAlgorithm.html | 8 +- .../lv/id/jc/algorithm/graph/Graph.html | 43 ++- .../jc/algorithm/graph/SearchAlgorithm.html | 8 +- .../graph/class-use/BreadthFirstSearch.html | 4 +- .../graph/class-use/DijkstrasAlgorithm.html | 4 +- .../jc/algorithm/graph/class-use/Graph.html | 6 +- .../graph/class-use/SearchAlgorithm.html | 4 +- .../jc/algorithm/graph/package-summary.html | 6 +- .../id/jc/algorithm/graph/package-tree.html | 4 +- .../lv/id/jc/algorithm/graph/package-use.html | 4 +- .../module-summary.html | 18 +- .../algorithm/graph/BreadthFirstSearch.html | 188 ------------ .../algorithm/graph/DijkstrasAlgorithm.html | 188 ------------ docs/api/lv/id/jc/algorithm/graph/Graph.html | 273 ------------------ .../jc/algorithm/graph/SearchAlgorithm.html | 153 ---------- .../graph/class-use/BreadthFirstSearch.html | 57 ---- .../graph/class-use/DijkstrasAlgorithm.html | 57 ---- .../jc/algorithm/graph/class-use/Graph.html | 89 ------ .../graph/class-use/SearchAlgorithm.html | 82 ------ .../jc/algorithm/graph/package-summary.html | 105 ------- .../id/jc/algorithm/graph/package-tree.html | 79 ----- .../lv/id/jc/algorithm/graph/package-use.html | 78 ----- docs/api/module-search-index.js | 2 +- docs/api/overview-tree.html | 12 +- docs/api/package-search-index.js | 2 +- docs/coverage/index.html | 2 +- docs/coverage/index_SORT_BY_BLOCK.html | 2 +- docs/coverage/index_SORT_BY_BLOCK_DESC.html | 2 +- docs/coverage/index_SORT_BY_CLASS.html | 2 +- docs/coverage/index_SORT_BY_CLASS_DESC.html | 2 +- docs/coverage/index_SORT_BY_LINE.html | 2 +- docs/coverage/index_SORT_BY_LINE_DESC.html | 2 +- docs/coverage/index_SORT_BY_METHOD.html | 2 +- docs/coverage/index_SORT_BY_METHOD_DESC.html | 2 +- docs/coverage/index_SORT_BY_NAME_DESC.html | 2 +- docs/coverage/ns-1/index.html | 2 +- docs/coverage/ns-1/index_SORT_BY_BLOCK.html | 2 +- .../ns-1/index_SORT_BY_BLOCK_DESC.html | 2 +- docs/coverage/ns-1/index_SORT_BY_CLASS.html | 2 +- .../ns-1/index_SORT_BY_CLASS_DESC.html | 2 +- docs/coverage/ns-1/index_SORT_BY_LINE.html | 2 +- .../ns-1/index_SORT_BY_LINE_DESC.html | 2 +- docs/coverage/ns-1/index_SORT_BY_METHOD.html | 2 +- .../ns-1/index_SORT_BY_METHOD_DESC.html | 2 +- .../ns-1/index_SORT_BY_NAME_DESC.html | 2 +- docs/coverage/ns-1/sources/source-1.html | 64 ++-- docs/coverage/ns-1/sources/source-2.html | 68 ++--- docs/coverage/ns-1/sources/source-3.html | 99 +++++-- docs/coverage/ns-1/sources/source-4.html | 32 +- docs/coverage/ns-2/index.html | 198 ------------- docs/coverage/ns-2/index_SORT_BY_BLOCK.html | 198 ------------- .../ns-2/index_SORT_BY_BLOCK_DESC.html | 198 ------------- docs/coverage/ns-2/index_SORT_BY_CLASS.html | 198 ------------- .../ns-2/index_SORT_BY_CLASS_DESC.html | 198 ------------- docs/coverage/ns-2/index_SORT_BY_LINE.html | 198 ------------- .../ns-2/index_SORT_BY_LINE_DESC.html | 198 ------------- docs/coverage/ns-2/index_SORT_BY_METHOD.html | 198 ------------- .../ns-2/index_SORT_BY_METHOD_DESC.html | 198 ------------- .../ns-2/index_SORT_BY_NAME_DESC.html | 198 ------------- docs/coverage/ns-2/sources/source-1.html | 151 ---------- docs/coverage/ns-2/sources/source-2.html | 149 ---------- docs/coverage/ns-2/sources/source-3.html | 153 ---------- docs/coverage/ns-2/sources/source-4.html | 93 ------ docs/inspection/index.html | 1 + docs/inspection/script.js | 23 ++ docs/inspection/styles.css | 98 +++++++ docs/spock-reports/aggregated_report.json | 2 +- .../graph.BreadthFirstSearchSpec.html | 63 +++- .../graph.DijkstrasAlgorithmSpec.html | 14 +- docs/spock-reports/graph.GraphSpec.html | 4 +- .../graph.SearchAlgorithmSpec.html | 4 +- docs/spock-reports/index.html | 20 +- .../algorithm/graph/BreadthFirstSearch.java | 2 +- .../algorithm/graph/DijkstrasAlgorithm.java | 2 +- .../java/lv/id/jc/algorithm/graph/Graph.java | 34 ++- .../jc/algorithm/graph/SearchAlgorithm.java | 2 +- src/main/java/module-info.java | 7 +- .../graph/BreadthFirstSearchSpec.groovy | 11 + .../graph/DijkstrasAlgorithmSpec.groovy | 8 +- .../groovy/graph/SearchAlgorithmSpec.groovy | 4 +- src/test/resources/SpockConfig.groovy | 6 - 97 files changed, 565 insertions(+), 4310 deletions(-) delete mode 100644 docs/api/index-files/index-10.html delete mode 100644 docs/api/index-files/index-9.html rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/BreadthFirstSearch.html (98%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.html (98%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/Graph.html (90%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/SearchAlgorithm.html (97%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/class-use/BreadthFirstSearch.html (95%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/class-use/DijkstrasAlgorithm.html (95%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/class-use/Graph.html (97%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/class-use/SearchAlgorithm.html (96%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/package-summary.html (97%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/package-tree.html (97%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/lv/id/jc/algorithm/graph/package-use.html (96%) rename docs/api/{lv.id.jc.algorithm => lv.id.jc.algorithm.graph}/module-summary.html (82%) delete mode 100644 docs/api/lv/id/jc/algorithm/graph/BreadthFirstSearch.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/Graph.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/SearchAlgorithm.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/class-use/BreadthFirstSearch.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/class-use/DijkstrasAlgorithm.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/class-use/Graph.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/class-use/SearchAlgorithm.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/package-summary.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/package-tree.html delete mode 100644 docs/api/lv/id/jc/algorithm/graph/package-use.html delete mode 100644 docs/coverage/ns-2/index.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_BLOCK.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_BLOCK_DESC.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_CLASS.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_CLASS_DESC.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_LINE.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_LINE_DESC.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_METHOD.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_METHOD_DESC.html delete mode 100644 docs/coverage/ns-2/index_SORT_BY_NAME_DESC.html delete mode 100644 docs/coverage/ns-2/sources/source-1.html delete mode 100644 docs/coverage/ns-2/sources/source-2.html delete mode 100644 docs/coverage/ns-2/sources/source-3.html delete mode 100644 docs/coverage/ns-2/sources/source-4.html create mode 100644 docs/inspection/index.html create mode 100644 docs/inspection/script.js create mode 100644 docs/inspection/styles.css diff --git a/docs/api/allclasses-index.html b/docs/api/allclasses-index.html index ff93b95..81b40a4 100644 --- a/docs/api/allclasses-index.html +++ b/docs/api/allclasses-index.html @@ -1,7 +1,7 @@ - + All Classes and Interfaces @@ -32,8 +32,8 @@ @@ -87,7 +89,7 @@

    Coverage Summary for Class: SearchAlgorithm (lv.id.jc.algorithm.graph)

    diff --git a/docs/coverage/ns-2/index.html b/docs/coverage/ns-2/index.html deleted file mode 100644 index d2b2ff2..0000000 --- a/docs/coverage/ns-2/index.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_BLOCK.html b/docs/coverage/ns-2/index_SORT_BY_BLOCK.html deleted file mode 100644 index 52e49c1..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_BLOCK_DESC.html b/docs/coverage/ns-2/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index f15f4cf..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_CLASS.html b/docs/coverage/ns-2/index_SORT_BY_CLASS.html deleted file mode 100644 index 6bf2c02..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_CLASS_DESC.html b/docs/coverage/ns-2/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index b965ac1..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_LINE.html b/docs/coverage/ns-2/index_SORT_BY_LINE.html deleted file mode 100644 index 77eefd6..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_LINE.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_LINE_DESC.html b/docs/coverage/ns-2/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 0d498e6..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_METHOD.html b/docs/coverage/ns-2/index_SORT_BY_METHOD.html deleted file mode 100644 index e84360b..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_METHOD_DESC.html b/docs/coverage/ns-2/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 52e8a69..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/index_SORT_BY_NAME_DESC.html b/docs/coverage/ns-2/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 5e35dc6..0000000 --- a/docs/coverage/ns-2/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Coverage Report > lv.id.jc.algorithm.graph - - - - - -
    - - - -

    Coverage Summary for Package: lv.id.jc.algorithm.graph

    - - - - - - - - - - - - - -
    Package - Class, % - - Method, % - - Line, % -
    lv.id.jc.algorithm.graph - - 100% - - - (3/3) - - - - 100% - - - (9/9) - - - - 97.7% - - - (43/44) - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -Class - Class, % - - Method, % - - Line, % -
    Graph - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    - -
    - - - - - - diff --git a/docs/coverage/ns-2/sources/source-1.html b/docs/coverage/ns-2/sources/source-1.html deleted file mode 100644 index fb6312a..0000000 --- a/docs/coverage/ns-2/sources/source-1.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - Coverage Report > BreadthFirstSearch - - - - - -
    - - -

    Coverage Summary for Class: BreadthFirstSearch (lv.id.jc.algorithm.graph)

    - - - - - - - - - - - - - - - -
    Class - Class, % - - Method, % - - Line, % -
    BreadthFirstSearch - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 94.7% - - - (18/19) - -
    - -
    -
    - - -
    -
    1 package lv.id.jc.algorithm.graph; -2  -3 import java.util.HashMap; -4 import java.util.HashSet; -5 import java.util.LinkedList; -6 import java.util.List; -7 import java.util.Objects; -8  -9 import static java.util.function.Predicate.not; -10 import static java.util.stream.Stream.iterate; -11  -12 /** -13  * Algorithm for finding the shortest paths between nodes in a graph. -14  * -15  * The algorithm doesn't take into account the distance between nodes. -16  * -17  * @param <T> type of vertex id -18  */ -19 public class BreadthFirstSearch<T> implements SearchAlgorithm<T> { -20  -21  @Override -22  public List<T> findPath(Graph<T> graph, T source, T target) { -23  final var queue = new LinkedList<T>(); -24  final var visited = new HashSet<T>(); -25  final var previous = new HashMap<T, T>(); -26  queue.add(source); -27  -28  while (!queue.isEmpty()) { -29  final var node = queue.removeFirst(); -30  if (target.equals(node)) { -31  final var path = new LinkedList<T>(); -32  iterate(node, Objects::nonNull, previous::get).forEach(path::addFirst); -33  return path; -34  } -35  visited.add(node); -36  graph.edges(node).keySet().stream() -37  .filter(not(visited::contains)) -38  .forEach(it -> { -39  previous.computeIfAbsent(it, x -> node); -40  queue.addLast(it); -41  }); -42  } -43  return List.of(); -44  } -45  -46 } -
    -
    -
    - - - - - - diff --git a/docs/coverage/ns-2/sources/source-2.html b/docs/coverage/ns-2/sources/source-2.html deleted file mode 100644 index dd5a3ec..0000000 --- a/docs/coverage/ns-2/sources/source-2.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - Coverage Report > DijkstrasAlgorithm - - - - - -
    - - -

    Coverage Summary for Class: DijkstrasAlgorithm (lv.id.jc.algorithm.graph)

    - - - - - - - - - - - - - - - -
    Class - Class, % - - Method, % - - Line, % -
    DijkstrasAlgorithm - - 100% - - - (1/1) - - - - 100% - - - (3/3) - - - - 100% - - - (18/18) - -
    - -
    -
    - - -
    -
    1 package lv.id.jc.algorithm.graph; -2  -3 import java.util.HashMap; -4 import java.util.LinkedList; -5 import java.util.List; -6 import java.util.Objects; -7  -8 import static java.util.stream.Stream.iterate; -9  -10 /** -11  * Algorithm for finding the fastest paths between nodes in a graph. -12  * -13  * The algorithm uses information about edge's distance to find the fastest path. -14  * -15  * @param <T> type of vertex id -16  */ -17 public class DijkstrasAlgorithm<T> implements SearchAlgorithm<T> { -18  -19  @Override -20  public List<T> findPath(Graph<T> graph, T source, T target) { -21  final var queue = new LinkedList<T>(); -22  final var distances = new HashMap<T, Double>(); -23  final var previous = new HashMap<T, T>(); -24  queue.add(source); -25  distances.put(source, .0); -26  -27  while (!queue.isEmpty()) { -28  final var prev = queue.removeFirst(); -29  graph.edges(prev).forEach((node, time) -> { -30  final var distance = distances.get(prev) + time.doubleValue(); -31  if (distance < distances.getOrDefault(node, Double.MAX_VALUE)) { -32  previous.put(node, prev); -33  distances.put(node, distance); -34  queue.addLast(node); -35  } -36  }); -37  } -38  -39  final var path = new LinkedList<T>(); -40  iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst); -41  return path; -42  } -43  -44 } -
    -
    -
    - - - - - - diff --git a/docs/coverage/ns-2/sources/source-3.html b/docs/coverage/ns-2/sources/source-3.html deleted file mode 100644 index 5807c89..0000000 --- a/docs/coverage/ns-2/sources/source-3.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - Coverage Report > Graph - - - - - -
    - - -

    Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)

    - - - - - - - - - - - - - - - - - - - - - -
    Class - Method, % - - Line, % -
    Graph - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    Graph$getDistance
    Total - - 100% - - - (3/3) - - - - 100% - - - (7/7) - -
    - -
    -
    - - -
    -
    1 package lv.id.jc.algorithm.graph; -2  -3 import java.util.List; -4 import java.util.Map; -5 import java.util.stream.IntStream; -6  -7 /** -8  * A generic graph representation -9  * -10  * @param <T> type of vertex id -11  */ -12 public record Graph<T>(Map<T, Map<T, Number>> nodes) { -13  -14  /** -15  * Edges of the given vertex -16  * -17  * @param id vertex (node) -18  * @return all connections for the given vertex id -19  */ -20  public Map<T, Number> edges(T id) { -21  return nodes().get(id); -22  } -23  -24  /** -25  * Returns the calculated distance for the given path -26  * -27  * @param path the list of vertex ids representing the path -28  * @return distance for the given path as double -29  * @throws NullPointerException if path is incorrect and contains more than one vertex -30  */ -31  public double getDistance(final List<T> path) { -32  return IntStream -33  .range(1, path.size()) -34  .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i))) -35  .mapToDouble(Number::doubleValue) -36  .sum(); -37  } -38 } -
    -
    -
    - - - - - - diff --git a/docs/coverage/ns-2/sources/source-4.html b/docs/coverage/ns-2/sources/source-4.html deleted file mode 100644 index 1643f7f..0000000 --- a/docs/coverage/ns-2/sources/source-4.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - Coverage Report > SearchAlgorithm - - - - - -
    - - -

    Coverage Summary for Class: SearchAlgorithm (lv.id.jc.algorithm.graph)

    - - - - - - - - - - - - -
    Class
    SearchAlgorithm$findPath
    Total
    - -
    -
    - - -
    -
    1 package lv.id.jc.algorithm.graph; -2  -3 import java.util.List; -4  -5 /** -6  * A functional interface for graph search algorithm -7  * -8  * @param <T> type of vertex id -9  */ -10 @FunctionalInterface -11 public interface SearchAlgorithm<T> { -12  /** -13  * Find the path from the source node to the target -14  * -15  * @param graph The graph in which we search for the path -16  * @param source Search starting point identifier -17  * @param target Search finish point identifier -18  * @return Path found or empty list if path cannot be found -19  */ -20  List<T> findPath(Graph<T> graph, T source, T target); -21 } -
    -
    -
    - - - - - - diff --git a/docs/inspection/index.html b/docs/inspection/index.html new file mode 100644 index 0000000..f1d6f94 --- /dev/null +++ b/docs/inspection/index.html @@ -0,0 +1 @@ +IntelliJ IDEA inspection report

    IntelliJ IDEA inspection report:

    Inspection tree:

                            1. Problem description:

                              Select a problem element in tree
                              \ No newline at end of file diff --git a/docs/inspection/script.js b/docs/inspection/script.js new file mode 100644 index 0000000..9a267ef --- /dev/null +++ b/docs/inspection/script.js @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @author: Dmitry Batkovich + */ +function navigate(an_id) { + problem_div = document.getElementById("d" + an_id); + preview_div = document.getElementById("preview"); + preview_div.innerHTML = problem_div != null ? problem_div.innerHTML : "Select a problem element in tree"; +} \ No newline at end of file diff --git a/docs/inspection/styles.css b/docs/inspection/styles.css new file mode 100644 index 0000000..41cc324 --- /dev/null +++ b/docs/inspection/styles.css @@ -0,0 +1,98 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +html { + font-family: \Helvetica Neue\, Helvetica, Arial, \Lucida Grande\, sans-serif; +} + +body { + color: #4C4C4C; + margin: 60px 60px 0 60px; +} + +p { + font-size: 1em; + margin: 0 0 1em 0; +} + +.grayout { + opacity: 0.6; +} + +body, input, select, textarea, th, td { + font-size: 1em; +} + +li { + position: relative; + list-style: none; +} + +label:hover { + color: #0C479D; + text-decoration: underline; +} + +li::before { + content: "\23FA"; + margin: 0; +} + +li input { + position: absolute; + left: 0; + margin-left: 0; + background: none; + opacity: 0; + z-index: 2; + cursor: pointer; + height: 1em; + width: 1em; + top: 0; +} + +li input + ol { + margin: -15px 0 0 -44px; + height: 1em; +} + +li input + ol > li { + display: none; + margin-left: -14px !important; + padding-left: 1px; +} + +li label { + padding-left: 5px; +} + +li input:checked + ol { + margin: -20px 0 0 -44px; + padding: 25px 0 0 80px; + height: auto; +} + +li input:checked + ol > li { + display: block; + margin: 0 0 2px; +} + +li input:checked + ol > li:last-child { + margin: 0 0 1px; +} + +div.location { + margin-left: 40px; +} \ No newline at end of file diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index 321faf7..1419c96 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file +{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file diff --git a/docs/spock-reports/graph.BreadthFirstSearchSpec.html b/docs/spock-reports/graph.BreadthFirstSearchSpec.html index 56a1b1f..eb40416 100644 --- a/docs/spock-reports/graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

                              Report for graph.BreadthFirstSearchSpec

                              Summary:

                              -
                              Created on Mon Jan 03 14:12:34 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              @@ -266,13 +266,13 @@

                              Summary:

                              - - + + - +
                              3344 0 0 0 100.0%0.068 seconds0.069 seconds
                              @@ -302,6 +302,9 @@

                              Features:

                              should find a route for complex graph
                            2. +should thrown NPE path for an empty graph +
                            3. +
                            4. should return an empty path if can't find a route
                            5. @@ -582,6 +585,58 @@

                              Features:

                              +
                              +should thrown NPE path for an empty graph + +Return + +
                              + + + + +
                              Given:
                              + + +
                              an empty graph
                              + + + + + +
                              def graph = Graph.of([:])
                              + + + + +
                              When:
                              + + +
                              we use Dijkstra's algorithm to find a path
                              + + + + + +
                              algorithm.findPath(graph, 'A', 'B')
                              + + + + +
                              Then:
                              + + +
                              the exception was thrown
                              + + + + + +
                              thrown NullPointerException
                              + + + +
                              should return an empty path if can't find a route diff --git a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html index 6170b0d..6125802 100644 --- a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.DijkstrasAlgorithmSpec

                              Summary:

                              -
                              Created on Mon Jan 03 14:12:35 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.017 seconds0.022 seconds
                              @@ -305,7 +305,7 @@

                              Features:

                              should find a route for a complex graph
                            6. -should throw NPE for an empty graph +should thrown NPE for an empty graph
                            7. should return an empty path if can't find a route @@ -756,8 +756,8 @@

                              Features:

                              -
                              -should throw NPE for an empty graph +
                              +should thrown NPE for an empty graph Return @@ -789,7 +789,7 @@

                              Features:

                              -
                              algorithm.findPath(graph, _, _)
                              +
                              algorithm.findPath(graph, 'A', 'B')
                              @@ -797,7 +797,7 @@

                              Features:

                              Then:
                              -
                              the exception thrown
                              +
                              the exception was thrown
                              diff --git a/docs/spock-reports/graph.GraphSpec.html b/docs/spock-reports/graph.GraphSpec.html index 5adf5d3..04717ad 100644 --- a/docs/spock-reports/graph.GraphSpec.html +++ b/docs/spock-reports/graph.GraphSpec.html @@ -251,7 +251,7 @@

                              Report for graph.GraphSpec

                              Summary:

                              -
                              Created on Mon Jan 03 14:12:35 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.054 seconds0.037 seconds
                              diff --git a/docs/spock-reports/graph.SearchAlgorithmSpec.html b/docs/spock-reports/graph.SearchAlgorithmSpec.html index bc05ec7..2065f75 100644 --- a/docs/spock-reports/graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/graph.SearchAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.SearchAlgorithmSpec

                              Summary:

                              -
                              Created on Mon Jan 03 14:12:35 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.015 seconds0.003 seconds
                              diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index ddb4004..164c039 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

                              Specification run results

                              Specifications summary:

                              -
                              Created on Mon Jan 03 14:12:35 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:16:52 EET 2022 by jegors.cemisovs
                              @@ -106,12 +106,12 @@

                              Specifications summary:

                              - - + + - +
                              4 0 014141515 0 0 100.0%0.154 seconds0.131 seconds
                              @@ -136,13 +136,13 @@

                              Specifications:

                              graph.BreadthFirstSearchSpec
                              Breadth First Search Algorithm
                              -3 -3 +4 +4 0 0 0 100.0% -0.068 seconds +0.069 seconds @@ -155,7 +155,7 @@

                              Specifications:

                              0 0 100.0% -0.017 seconds +0.022 seconds @@ -168,7 +168,7 @@

                              Specifications:

                              0 0 100.0% -0.054 seconds +0.037 seconds @@ -181,7 +181,7 @@

                              Specifications:

                              0 0 100.0% -0.015 seconds +0.003 seconds diff --git a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java index 0f08f94..6c6cfa2 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java +++ b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -15,7 +15,7 @@ * The algorithm doesn't take into account the distance between nodes. * * @author Jegors Čemisovs - * @param the type of vertex id + * @param the type of vertex * @since 1.0 */ public class BreadthFirstSearch implements SearchAlgorithm { diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index b0c5858..c6769c7 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -13,7 +13,7 @@ * The algorithm uses information about edge's distance to find the fastest path. * * @author Jegors Čemisovs - * @param the type of vertex id + * @param the type of vertex * @since 1.0 */ public class DijkstrasAlgorithm implements SearchAlgorithm { diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java index b715ea0..0fa674d 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ b/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -7,27 +7,36 @@ /** * An interface for weighted directed graph (network) * - * @author Jegors Čemisovs * @param the type of vertex in this graph - * @since 1.0 + * @author Jegors Čemisovs + * @since 1.1 */ @FunctionalInterface public interface Graph { /** - * Schema of the graph + * Schema of the graph. + * + * * @return the graph scheme */ Map> schema(); /** - * Edges of the given vertex + * Returns the edges of the given vertex, + * or {@code null} if this graph contains no given vertex. + * + *

                              A return value of {@code null} does not necessarily + * indicate that the specified vertex is not present in the graph; + * it's also possible that in the graph schema, {@code null} was specified + * for the edges of this vertex instead of an empty map. * - * @param id vertex + * @param vertex vertex * @return all links for the given vertex + * or null if no such vertex in the graph */ - default Map edges(T id) { - return schema().get(id); + default Map edges(T vertex) { + return schema().get(vertex); } /** @@ -35,7 +44,7 @@ default Map edges(T id) { * * @param path the list of vertices representing the path * @return distance for the given path as double - * @throws NullPointerException if path is incorrect and contains more than one vertex + * @throws NullPointerException if {@code path} is incorrect and contains more than one vertex */ default double getDistance(List path) { return IntStream @@ -46,11 +55,14 @@ default double getDistance(List path) { } /** - * Creates a Graph object by given schema + * Creates a Graph object by given schema. + * + * In a graph schema, each vertex is assigned an edge map. + * If the vertex has no edges, then it should be assigned an empty map. * * @param schema of the graph - * @param the type of vertex in this graph - * @return graph with given schema + * @param the type of vertex in this graph + * @return graph object with given schema */ static Graph of(Map> schema) { return () -> schema; diff --git a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java index 7048c50..79692d7 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java +++ b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java @@ -6,7 +6,7 @@ * A functional interface for graph search algorithm * * @author Jegors Čemisovs - * @param the type of vertex id + * @param the type of vertex * @since 1.0 */ @FunctionalInterface diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index bfbbd92..941d8df 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -1,3 +1,8 @@ -module lv.id.jc.algorithm { +/** + * The module contains an interface for a graph and an interface for a graph search algorithm. + * There is an implementation of two search algorithms: + * Dijkstra's algorithm and Breadth First Search algorithm. + */ +module lv.id.jc.algorithm.graph { exports lv.id.jc.algorithm.graph; } \ No newline at end of file diff --git a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy b/src/test/groovy/graph/BreadthFirstSearchSpec.groovy index 5d7eb3a..1d76485 100644 --- a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy +++ b/src/test/groovy/graph/BreadthFirstSearchSpec.groovy @@ -71,6 +71,17 @@ class BreadthFirstSearchSpec extends Specification { time = shortest.size() - 1 } + def 'should thrown NPE path for an empty graph'() { + given: 'an empty graph' + def graph = Graph.of([:]) + + when: "we use Dijkstra's algorithm to find a path" + algorithm.findPath(graph, 'A', 'B') + + then: 'the exception was thrown' + thrown NullPointerException + } + def "should return an empty path if can't find a route"() { given: 'a simple graph with no edge between nodes' def graph = Graph.of([A: [:], B: [:]]) diff --git a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy b/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy index a90e0f4..9ba35d4 100644 --- a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy +++ b/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy @@ -9,7 +9,7 @@ import spock.lang.* @Narrative("Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph") class DijkstrasAlgorithmSpec extends Specification { @Subject - def algorithm = new DijkstrasAlgorithm() + def algorithm = new DijkstrasAlgorithm() def 'should find a route for a simple graph'() { given: 'A simple graph' @@ -103,14 +103,14 @@ class DijkstrasAlgorithmSpec extends Specification { 'D' | 'H' || 33 | ['D', 'E', 'F', 'G', 'C', 'B', 'A', 'H'] } - def 'should throw NPE for an empty graph'() { + def 'should thrown NPE for an empty graph'() { given: 'an empty graph' def graph = Graph.of([:]) when: "we use Dijkstra's algorithm to find a path" - algorithm.findPath(graph, _, _) + algorithm.findPath(graph, 'A', 'B') - then: 'the exception thrown' + then: 'the exception was thrown' thrown NullPointerException } diff --git a/src/test/groovy/graph/SearchAlgorithmSpec.groovy b/src/test/groovy/graph/SearchAlgorithmSpec.groovy index 64cb16f..337841f 100644 --- a/src/test/groovy/graph/SearchAlgorithmSpec.groovy +++ b/src/test/groovy/graph/SearchAlgorithmSpec.groovy @@ -10,10 +10,10 @@ import spock.lang.Title @Title("Comparison of two algorithms") class SearchAlgorithmSpec extends Specification { @Subject - def bfsAlgorithm = new BreadthFirstSearch() + def bfsAlgorithm = new BreadthFirstSearch() @Subject - def dijkstras = new DijkstrasAlgorithm() + def dijkstras = new DijkstrasAlgorithm() def 'should find a route for a complex graph'() { given: 'A complex graph sample' diff --git a/src/test/resources/SpockConfig.groovy b/src/test/resources/SpockConfig.groovy index af9c48c..887390e 100644 --- a/src/test/resources/SpockConfig.groovy +++ b/src/test/resources/SpockConfig.groovy @@ -3,10 +3,4 @@ spockReports { set 'com.athaydes.spockframework.report.outputDir': 'docs/spock-reports' set 'com.athaydes.spockframework.report.projectName': 'Graph search algorithms' set 'com.athaydes.spockframework.report.projectVersion': 1.0 - - set "com.athaydes.spockframework.report.template.TemplateReportCreator.specTemplateFile": "/templateReportCreator/spec-template.md" - set "com.athaydes.spockframework.report.template.TemplateReportCreator.reportFileExtension": "md" - set "com.athaydes.spockframework.report.template.TemplateReportCreator.summaryTemplateFile": "/templateReportCreator/summary-template.md" - set "com.athaydes.spockframework.report.template.TemplateReportCreator.summaryFileName": "summary.md" - set "com.athaydes.spockframework.report.template.TemplateReportCreator.enabled": true } \ No newline at end of file From 290543be1c5984c2b9a07d299a40a205e61ad967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 21:20:48 +0200 Subject: [PATCH 049/118] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 70 +++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..661b4b2 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,70 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '15 16 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://git.io/codeql-language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 8a4c4629672c6bb2c0aac368a6a83f7169c4a030 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 21:29:03 +0200 Subject: [PATCH 050/118] Updated build.gradle --- build.gradle | 6 ++---- docs/spock-reports/aggregated_report.json | 2 +- docs/spock-reports/graph.BreadthFirstSearchSpec.html | 4 ++-- docs/spock-reports/graph.DijkstrasAlgorithmSpec.html | 4 ++-- docs/spock-reports/graph.GraphSpec.html | 4 ++-- docs/spock-reports/graph.SearchAlgorithmSpec.html | 4 ++-- docs/spock-reports/index.html | 12 ++++++------ src/test/groovy/graph/GraphSpec.groovy | 1 - 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index be9a153..f27459d 100644 --- a/build.gradle +++ b/build.gradle @@ -4,22 +4,20 @@ plugins { } group 'lv.id.jc' -version '1.0' +version '1.1' repositories { mavenCentral() } dependencies { - implementation 'org.codehaus.groovy:groovy-all:3.0.9' - // Spock Framework testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' testImplementation 'org.codehaus.groovy:groovy-all:3.0.9' // Spock Reports testRuntimeClasspath( "com.athaydes:spock-reports:2.1.1-groovy-3.0" ) { -// transitive = false // this avoids affecting your version of Groovy/Spock + transitive = false // this avoids affecting your version of Groovy/Spock } // Required for spock-reports testImplementation 'org.slf4j:slf4j-api:1.7.32' diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index 1419c96..5fe1e2c 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file +{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":71},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":45},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":11},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file diff --git a/docs/spock-reports/graph.BreadthFirstSearchSpec.html b/docs/spock-reports/graph.BreadthFirstSearchSpec.html index eb40416..72fc493 100644 --- a/docs/spock-reports/graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

                              Report for graph.BreadthFirstSearchSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:28:27 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.069 seconds0.071 seconds
                              diff --git a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html index 6125802..d26af3e 100644 --- a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.DijkstrasAlgorithmSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:28:27 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.022 seconds0.023 seconds
                              diff --git a/docs/spock-reports/graph.GraphSpec.html b/docs/spock-reports/graph.GraphSpec.html index 04717ad..cf37495 100644 --- a/docs/spock-reports/graph.GraphSpec.html +++ b/docs/spock-reports/graph.GraphSpec.html @@ -251,7 +251,7 @@

                              Report for graph.GraphSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:28:28 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.037 seconds0.045 seconds
                              diff --git a/docs/spock-reports/graph.SearchAlgorithmSpec.html b/docs/spock-reports/graph.SearchAlgorithmSpec.html index 2065f75..c796b02 100644 --- a/docs/spock-reports/graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/graph.SearchAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.SearchAlgorithmSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:28:28 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.003 seconds0.011 seconds
                              diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index 164c039..40a9694 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

                              Specification run results

                              Specifications summary:

                              -
                              Created on Mon Jan 03 21:16:52 EET 2022 by jegors.cemisovs
                              +
                              Created on Mon Jan 03 21:28:28 EET 2022 by jegors.cemisovs
                              @@ -111,7 +111,7 @@

                              Specifications summary:

                              - +
                              0 0 100.0%0.131 seconds0.150 seconds
                              @@ -142,7 +142,7 @@

                              Specifications:

                              0 0 100.0% -0.069 seconds +0.071 seconds @@ -155,7 +155,7 @@

                              Specifications:

                              0 0 100.0% -0.022 seconds +0.023 seconds @@ -168,7 +168,7 @@

                              Specifications:

                              0 0 100.0% -0.037 seconds +0.045 seconds @@ -181,7 +181,7 @@

                              Specifications:

                              0 0 100.0% -0.003 seconds +0.011 seconds diff --git a/src/test/groovy/graph/GraphSpec.groovy b/src/test/groovy/graph/GraphSpec.groovy index ff3f328..7264018 100644 --- a/src/test/groovy/graph/GraphSpec.groovy +++ b/src/test/groovy/graph/GraphSpec.groovy @@ -10,7 +10,6 @@ import spock.lang.Title class GraphSpec extends Specification { def "should return edges for a given node"() { - given: 'a simple graph with three nodes' def graph = Graph.of([ A: [B: 7, C: 2], From 707b54ab6a6b3568c13d0776ec1a6f8e63181dcc Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Mon, 3 Jan 2022 21:39:16 +0200 Subject: [PATCH 051/118] Added UML schema --- docs/assets/uml/graph.png | Bin 0 -> 42051 bytes docs/assets/uml/graph.uml | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 docs/assets/uml/graph.png create mode 100644 docs/assets/uml/graph.uml diff --git a/docs/assets/uml/graph.png b/docs/assets/uml/graph.png new file mode 100644 index 0000000000000000000000000000000000000000..cea38d7b05af83323e7b9fb25e7b1ae2b1a3cdb3 GIT binary patch literal 42051 zcmd?R1ys}T|2R4WQ9&^X1px)=5)qIV0g)cvAShi@k^==17y=?Cxk=|xx~FuHp0sp> zz(#Gb`yPJu`}y7f@1A?lz31HebIw>j@#=bB&qBef@|P~sUIc+amlU4LYJfmzD?y+$ zA?Hs6pBT_iF@Zp@K?<_cTAn6r6aHW5Js?y5WdpJs4-S}9dNNXaUWleFm!>RBC5X-D zTCTjs(0zK%7*#uJNu&nZ$o}2a>;xJjlB*kx_8!i zr0to0Tv3pl1x|5S;@RA7neWJelxIFj*o1@?YH@L6aV@f>1_qI|lxJR#L>)iONBNjq zp+-uWiO_)_70WQ5BEGmG6ac^pd>{=zOMGTO4<$Z)#}8;D3Gl3SFUQa+pO*^)?aRGI%)w}(C{ze3k-%Ypc_AgwD`Dc_s| zgzF92eRk-Y$82b1LVK@ZNJ3~B2pk^*KTi&lzIxv1ne^5gvmtD%^85P$$v{0YH=^P^ z=##oE`0TmY@bhPRGvJXGZ}naS1xs@5d@;P@7#mN`b>WFjhIY zrc(3>6)+4LN;5IBpFZ;leD*ZWBXF(7b7TT0k0MPUqTUO$xOA0&}#yKDxUQyS38q$t-GRIa|^TWc1wR%mltZ_EaqkDNi zrb$NUA*K0SF|X2RbB29>)G*g{S3Y7*mixnd1X{Xp=he)Nq2Ey^A3^P8!^A+8O7ny3 z9nV!$CZ5Vqx=pdoZS6cbx@D$Evk_#g%-x^OPot|#_EF;N~{g!37DJh4-3(&@JhnIiNI*pJ1!|4Axl~v-<-Tc+r)_}%iHi- zx*`2l69CIaHHMG?16_a~ma2|UN){7R;_F@gzY`+#17}|KFI^pDt0QIkyW|ucp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Hdt*?3K^f^mO$cq< + + JAVA + lv.id.jc.algorithm.graph + + lv.id.jc.algorithm.graph.SearchAlgorithm + lv.id.jc.algorithm.graph.DijkstrasAlgorithm + lv.id.jc.algorithm.graph.BreadthFirstSearch + lv.id.jc.algorithm.graph.Graph + + + + + + + + + + + + + + + + + + + lv.id.jc.algorithm.graph.Graph + + + Fields + Inner Classes + Methods + Properties + + All + private + + From b78dd97be3af31dc470f0d83c22068d3cd688bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 22:21:29 +0200 Subject: [PATCH 052/118] Update index.md --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 97debb6..b3ae022 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,7 +12,7 @@ You can also see the [specifications](spock-reports) for the classes generated w ## How to use the classes in your program -The first step is create a graph structure. The [Graph](https://algorithms.jc.id.lv/api/lv.id.jc.algorithm/lv/id/jc/algorithm/graph/Graph.html) interface is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. +The first step is create a graph structure. The Graph interface is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. ### Example In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). From c00b6e9e8ffd2d23491f26ce3104ec0675715554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 22:24:02 +0200 Subject: [PATCH 053/118] Update index.md --- docs/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/index.md b/docs/index.md index b3ae022..4242431 100644 --- a/docs/index.md +++ b/docs/index.md @@ -65,11 +65,11 @@ Tests are written in groove language. For unit testing, the Spock framework was ### Small Graph Sample ```groovy - def graph = Graph.of([ + def graph = Graph.of [ A: [B: 7, C: 2], B: [A: 3, C: 5], C: [A: 1, B: 3] - ]) + ] ``` ![Small Graph](assets/small.gif) @@ -78,13 +78,13 @@ Tests are written in groove language. For unit testing, the Spock framework was ### Medium Graph Sample ```groovy - def graph = Graph.of([ + def graph = Graph.of [ A: [B: 5], B: [A: 5, C: 10], C: [B: 20, D: 5], D: [E: 5], E: [B: 5] - ]) + ] ``` ![Medium Graph](assets/medium.gif) @@ -92,7 +92,7 @@ Tests are written in groove language. For unit testing, the Spock framework was ### Complex Graph Sample ```groovy - def graph = Graph.of([ + def graph = Graph.of [ A: [B: 5, H: 2], B: [A: 5, C: 7], C: [B: 7, D: 3, G: 4], @@ -101,7 +101,7 @@ Tests are written in groove language. For unit testing, the Spock framework was F: [G: 6], G: [C: 4], H: [G: 3] - ]) + ] ``` ![Complex Graph](assets/complex.gif) From 1f57f6f44d08a32288382535c31456aa1773b075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 22:25:58 +0200 Subject: [PATCH 054/118] Update index.md --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 4242431..a16e24e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -60,7 +60,7 @@ routeTwo == ['D', 'E', 'F', 'G', 'C'] ## Unit Tests -Tests are written in groove language. For unit testing, the Spock framework was used. To test the operation of the algorithms, the following sample graphs were created. +Tests are written in Groove language. For unit testing, the [Spock Framework](https://spockframework.org/) was used. To test the operation of the algorithms, the following sample graphs were created. ### Small Graph Sample From bc8fd572a17bf306bdc67a686c0aea6a898f37d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 22:31:50 +0200 Subject: [PATCH 055/118] Update Graph.java --- src/main/java/lv/id/jc/algorithm/graph/Graph.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java index 0fa674d..76157aa 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ b/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -15,8 +15,6 @@ public interface Graph { /** * Schema of the graph. - * - * * @return the graph scheme */ From c04726ad46094e5b0f981475137cc884e68978e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 22:35:14 +0200 Subject: [PATCH 056/118] Update index.md --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index a16e24e..f61a182 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # Graph search algorithms -The project implements a class for the general structure of the graph, as well as two algorithms for finding a path in the graph. +The project implements an interface for the weighted graph, as well as two algorithms for finding a path in the graph. There are implementations and tests for two algorithms: From ac96e7bf25f62f764753bdc7c517e35d7b72f11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 3 Jan 2022 22:36:22 +0200 Subject: [PATCH 057/118] Update index.md --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index f61a182..ef96e35 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,7 +8,7 @@ There are implementations and tests for two algorithms: - [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) The implementation is written in Java 17. [API documentation](api) is available. -You can also see the [specifications](spock-reports) for the classes generated with the spock-reports. +You can also see the [specifications](spock-reports) generated with the spock-reports. ## How to use the classes in your program From 57048d41601b4a415368c0cff85a3874b51eef76 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 4 Jan 2022 18:39:52 +0200 Subject: [PATCH 058/118] Updated reports --- docs/api/allclasses-index.html | 4 +- docs/api/allpackages-index.html | 4 +- docs/api/help-doc.html | 4 +- docs/api/index-files/index-1.html | 4 +- docs/api/index-files/index-2.html | 4 +- docs/api/index-files/index-3.html | 4 +- docs/api/index-files/index-4.html | 4 +- docs/api/index-files/index-5.html | 4 +- docs/api/index-files/index-6.html | 4 +- docs/api/index-files/index-7.html | 4 +- docs/api/index-files/index-8.html | 6 +- docs/api/index.html | 4 +- .../algorithm/graph/BreadthFirstSearch.html | 4 +- .../algorithm/graph/DijkstrasAlgorithm.html | 4 +- .../lv/id/jc/algorithm/graph/Graph.html | 11 +- .../jc/algorithm/graph/SearchAlgorithm.html | 4 +- .../graph/class-use/BreadthFirstSearch.html | 4 +- .../graph/class-use/DijkstrasAlgorithm.html | 4 +- .../jc/algorithm/graph/class-use/Graph.html | 4 +- .../graph/class-use/SearchAlgorithm.html | 4 +- .../jc/algorithm/graph/package-summary.html | 4 +- .../id/jc/algorithm/graph/package-tree.html | 4 +- .../lv/id/jc/algorithm/graph/package-use.html | 4 +- .../module-summary.html | 4 +- docs/api/overview-tree.html | 4 +- docs/coverage/index.html | 2 +- docs/coverage/index_SORT_BY_BLOCK.html | 2 +- docs/coverage/index_SORT_BY_BLOCK_DESC.html | 2 +- docs/coverage/index_SORT_BY_CLASS.html | 2 +- docs/coverage/index_SORT_BY_CLASS_DESC.html | 2 +- docs/coverage/index_SORT_BY_LINE.html | 2 +- docs/coverage/index_SORT_BY_LINE_DESC.html | 2 +- docs/coverage/index_SORT_BY_METHOD.html | 2 +- docs/coverage/index_SORT_BY_METHOD_DESC.html | 2 +- docs/coverage/index_SORT_BY_NAME_DESC.html | 2 +- docs/coverage/ns-1/index.html | 2 +- docs/coverage/ns-1/index_SORT_BY_BLOCK.html | 2 +- .../ns-1/index_SORT_BY_BLOCK_DESC.html | 2 +- docs/coverage/ns-1/index_SORT_BY_CLASS.html | 2 +- .../ns-1/index_SORT_BY_CLASS_DESC.html | 2 +- docs/coverage/ns-1/index_SORT_BY_LINE.html | 2 +- .../ns-1/index_SORT_BY_LINE_DESC.html | 2 +- docs/coverage/ns-1/index_SORT_BY_METHOD.html | 2 +- .../ns-1/index_SORT_BY_METHOD_DESC.html | 2 +- .../ns-1/index_SORT_BY_NAME_DESC.html | 2 +- docs/coverage/ns-1/sources/source-1.html | 2 +- docs/coverage/ns-1/sources/source-2.html | 2 +- docs/coverage/ns-1/sources/source-3.html | 104 +++++++++--------- docs/coverage/ns-1/sources/source-4.html | 2 +- docs/index.md | 12 +- docs/spock-reports/aggregated_report.json | 2 +- .../graph.BreadthFirstSearchSpec.html | 4 +- .../graph.DijkstrasAlgorithmSpec.html | 4 +- docs/spock-reports/graph.GraphSpec.html | 4 +- .../graph.SearchAlgorithmSpec.html | 4 +- docs/spock-reports/index.html | 14 +-- docs/spock-reports/summary.md | 23 ++++ .../java/lv/id/jc/algorithm/graph/Graph.java | 5 +- src/test/resources/SpockConfig.groovy | 6 +- 59 files changed, 184 insertions(+), 153 deletions(-) create mode 100644 docs/spock-reports/summary.md diff --git a/docs/api/allclasses-index.html b/docs/api/allclasses-index.html index 81b40a4..55a7bac 100644 --- a/docs/api/allclasses-index.html +++ b/docs/api/allclasses-index.html @@ -1,11 +1,11 @@ - + All Classes and Interfaces - + diff --git a/docs/api/allpackages-index.html b/docs/api/allpackages-index.html index ef84aa8..199c752 100644 --- a/docs/api/allpackages-index.html +++ b/docs/api/allpackages-index.html @@ -1,11 +1,11 @@ - + All Packages - + diff --git a/docs/api/help-doc.html b/docs/api/help-doc.html index 9c8f74d..2a1d43d 100644 --- a/docs/api/help-doc.html +++ b/docs/api/help-doc.html @@ -1,11 +1,11 @@ - + API Help - + diff --git a/docs/api/index-files/index-1.html b/docs/api/index-files/index-1.html index 2e97f53..daa6c34 100644 --- a/docs/api/index-files/index-1.html +++ b/docs/api/index-files/index-1.html @@ -1,11 +1,11 @@ - + B-Index - + diff --git a/docs/api/index-files/index-2.html b/docs/api/index-files/index-2.html index 021b398..81a6b1e 100644 --- a/docs/api/index-files/index-2.html +++ b/docs/api/index-files/index-2.html @@ -1,11 +1,11 @@ - + D-Index - + diff --git a/docs/api/index-files/index-3.html b/docs/api/index-files/index-3.html index 97d6f78..3ccac3b 100644 --- a/docs/api/index-files/index-3.html +++ b/docs/api/index-files/index-3.html @@ -1,11 +1,11 @@ - + E-Index - + diff --git a/docs/api/index-files/index-4.html b/docs/api/index-files/index-4.html index edbb765..883eb9c 100644 --- a/docs/api/index-files/index-4.html +++ b/docs/api/index-files/index-4.html @@ -1,11 +1,11 @@ - + F-Index - + diff --git a/docs/api/index-files/index-5.html b/docs/api/index-files/index-5.html index 756ab16..8a10798 100644 --- a/docs/api/index-files/index-5.html +++ b/docs/api/index-files/index-5.html @@ -1,11 +1,11 @@ - + G-Index - + diff --git a/docs/api/index-files/index-6.html b/docs/api/index-files/index-6.html index 8c79cff..692cd3a 100644 --- a/docs/api/index-files/index-6.html +++ b/docs/api/index-files/index-6.html @@ -1,11 +1,11 @@ - + L-Index - + diff --git a/docs/api/index-files/index-7.html b/docs/api/index-files/index-7.html index 9c68a87..7eb8e27 100644 --- a/docs/api/index-files/index-7.html +++ b/docs/api/index-files/index-7.html @@ -1,11 +1,11 @@ - + O-Index - + diff --git a/docs/api/index-files/index-8.html b/docs/api/index-files/index-8.html index a43e6da..9182987 100644 --- a/docs/api/index-files/index-8.html +++ b/docs/api/index-files/index-8.html @@ -1,11 +1,11 @@ - + S-Index - + @@ -56,7 +56,7 @@

                              S

                              schema() - Method in interface lv.id.jc.algorithm.graph.Graph
                              -
                              Schema of the graph.
                              +
                              The schema of this graph.
                              SearchAlgorithm<T> - Interface in lv.id.jc.algorithm.graph
                              diff --git a/docs/api/index.html b/docs/api/index.html index 25a9d87..ab284f5 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -1,11 +1,11 @@ - + Generated Documentation (Untitled) - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/BreadthFirstSearch.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/BreadthFirstSearch.html index 03d0c83..9786ad2 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/BreadthFirstSearch.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/BreadthFirstSearch.html @@ -1,11 +1,11 @@ - + BreadthFirstSearch - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.html index f60a416..9f18cd7 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.html @@ -1,11 +1,11 @@ - + DijkstrasAlgorithm - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/Graph.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/Graph.html index 9fa0c51..6a70d92 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/Graph.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/Graph.html @@ -1,11 +1,11 @@ - + Graph - + @@ -123,7 +123,7 @@

                              Method Summary

                              -
                              Schema of the graph.
                              +
                              The schema of this graph.
                              @@ -143,7 +143,10 @@

                              Method Details

                              schema

                              Map<T,Map<T,Number>> schema()
                              -
                              Schema of the graph.
                              +
                              The schema of this graph. + + In a graph schema, each vertex is assigned an edge map. + If the vertex has no edges, then it should be assigned an empty map.
                              Returns:
                              the graph scheme
                              diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/SearchAlgorithm.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/SearchAlgorithm.html index 370347e..388faf7 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/SearchAlgorithm.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/SearchAlgorithm.html @@ -1,11 +1,11 @@ - + SearchAlgorithm - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/BreadthFirstSearch.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/BreadthFirstSearch.html index 0901bff..851c94d 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/BreadthFirstSearch.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/BreadthFirstSearch.html @@ -1,11 +1,11 @@ - + Uses of Class lv.id.jc.algorithm.graph.BreadthFirstSearch - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/DijkstrasAlgorithm.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/DijkstrasAlgorithm.html index 14f76a9..aceb338 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/DijkstrasAlgorithm.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/DijkstrasAlgorithm.html @@ -1,11 +1,11 @@ - + Uses of Class lv.id.jc.algorithm.graph.DijkstrasAlgorithm - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/Graph.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/Graph.html index 0a4c388..9518eb0 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/Graph.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/Graph.html @@ -1,11 +1,11 @@ - + Uses of Interface lv.id.jc.algorithm.graph.Graph - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/SearchAlgorithm.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/SearchAlgorithm.html index 432f1a0..943c11b 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/SearchAlgorithm.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/class-use/SearchAlgorithm.html @@ -1,11 +1,11 @@ - + Uses of Interface lv.id.jc.algorithm.graph.SearchAlgorithm - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-summary.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-summary.html index c55de47..10bc727 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-summary.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-summary.html @@ -1,11 +1,11 @@ - + lv.id.jc.algorithm.graph - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-tree.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-tree.html index 0e73990..2ba5abe 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-tree.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-tree.html @@ -1,11 +1,11 @@ - + lv.id.jc.algorithm.graph Class Hierarchy - + diff --git a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-use.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-use.html index 0c9a9b8..96fb0db 100644 --- a/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-use.html +++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/package-use.html @@ -1,11 +1,11 @@ - + Uses of Package lv.id.jc.algorithm.graph - + diff --git a/docs/api/lv.id.jc.algorithm.graph/module-summary.html b/docs/api/lv.id.jc.algorithm.graph/module-summary.html index 710587c..56d0c28 100644 --- a/docs/api/lv.id.jc.algorithm.graph/module-summary.html +++ b/docs/api/lv.id.jc.algorithm.graph/module-summary.html @@ -1,11 +1,11 @@ - + lv.id.jc.algorithm.graph - + diff --git a/docs/api/overview-tree.html b/docs/api/overview-tree.html index f96c0ac..6e58db4 100644 --- a/docs/api/overview-tree.html +++ b/docs/api/overview-tree.html @@ -1,11 +1,11 @@ - + Class Hierarchy - + diff --git a/docs/coverage/index.html b/docs/coverage/index.html index 7274b19..356b158 100644 --- a/docs/coverage/index.html +++ b/docs/coverage/index.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_BLOCK.html b/docs/coverage/index_SORT_BY_BLOCK.html index e872da6..2bb220c 100644 --- a/docs/coverage/index_SORT_BY_BLOCK.html +++ b/docs/coverage/index_SORT_BY_BLOCK.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_BLOCK_DESC.html b/docs/coverage/index_SORT_BY_BLOCK_DESC.html index 3a88aea..f4e0eb6 100644 --- a/docs/coverage/index_SORT_BY_BLOCK_DESC.html +++ b/docs/coverage/index_SORT_BY_BLOCK_DESC.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_CLASS.html b/docs/coverage/index_SORT_BY_CLASS.html index 80a5f4a..e4b1f20 100644 --- a/docs/coverage/index_SORT_BY_CLASS.html +++ b/docs/coverage/index_SORT_BY_CLASS.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_CLASS_DESC.html b/docs/coverage/index_SORT_BY_CLASS_DESC.html index 8d9dfe3..479c3f3 100644 --- a/docs/coverage/index_SORT_BY_CLASS_DESC.html +++ b/docs/coverage/index_SORT_BY_CLASS_DESC.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_LINE.html b/docs/coverage/index_SORT_BY_LINE.html index e5c862e..8e8079c 100644 --- a/docs/coverage/index_SORT_BY_LINE.html +++ b/docs/coverage/index_SORT_BY_LINE.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_LINE_DESC.html b/docs/coverage/index_SORT_BY_LINE_DESC.html index d009edb..417cb2d 100644 --- a/docs/coverage/index_SORT_BY_LINE_DESC.html +++ b/docs/coverage/index_SORT_BY_LINE_DESC.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_METHOD.html b/docs/coverage/index_SORT_BY_METHOD.html index c480d1d..b7b1443 100644 --- a/docs/coverage/index_SORT_BY_METHOD.html +++ b/docs/coverage/index_SORT_BY_METHOD.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_METHOD_DESC.html b/docs/coverage/index_SORT_BY_METHOD_DESC.html index 80e7db5..3cb8fd7 100644 --- a/docs/coverage/index_SORT_BY_METHOD_DESC.html +++ b/docs/coverage/index_SORT_BY_METHOD_DESC.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/index_SORT_BY_NAME_DESC.html b/docs/coverage/index_SORT_BY_NAME_DESC.html index fbd61ec..bd45b4e 100644 --- a/docs/coverage/index_SORT_BY_NAME_DESC.html +++ b/docs/coverage/index_SORT_BY_NAME_DESC.html @@ -136,7 +136,7 @@

                              Coverage Breakdown

                              diff --git a/docs/coverage/ns-1/index.html b/docs/coverage/ns-1/index.html index e89a602..fcdd0df 100644 --- a/docs/coverage/ns-1/index.html +++ b/docs/coverage/ns-1/index.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_BLOCK.html b/docs/coverage/ns-1/index_SORT_BY_BLOCK.html index f03c23e..0372b35 100644 --- a/docs/coverage/ns-1/index_SORT_BY_BLOCK.html +++ b/docs/coverage/ns-1/index_SORT_BY_BLOCK.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_BLOCK_DESC.html b/docs/coverage/ns-1/index_SORT_BY_BLOCK_DESC.html index e97d088..7f00dd5 100644 --- a/docs/coverage/ns-1/index_SORT_BY_BLOCK_DESC.html +++ b/docs/coverage/ns-1/index_SORT_BY_BLOCK_DESC.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_CLASS.html b/docs/coverage/ns-1/index_SORT_BY_CLASS.html index 8d130b9..177cfc3 100644 --- a/docs/coverage/ns-1/index_SORT_BY_CLASS.html +++ b/docs/coverage/ns-1/index_SORT_BY_CLASS.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_CLASS_DESC.html b/docs/coverage/ns-1/index_SORT_BY_CLASS_DESC.html index a7ed941..b324c6e 100644 --- a/docs/coverage/ns-1/index_SORT_BY_CLASS_DESC.html +++ b/docs/coverage/ns-1/index_SORT_BY_CLASS_DESC.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_LINE.html b/docs/coverage/ns-1/index_SORT_BY_LINE.html index 4c2d16f..aeaa32d 100644 --- a/docs/coverage/ns-1/index_SORT_BY_LINE.html +++ b/docs/coverage/ns-1/index_SORT_BY_LINE.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_LINE_DESC.html b/docs/coverage/ns-1/index_SORT_BY_LINE_DESC.html index d550fe6..e987992 100644 --- a/docs/coverage/ns-1/index_SORT_BY_LINE_DESC.html +++ b/docs/coverage/ns-1/index_SORT_BY_LINE_DESC.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_METHOD.html b/docs/coverage/ns-1/index_SORT_BY_METHOD.html index 2c8c2fb..717428c 100644 --- a/docs/coverage/ns-1/index_SORT_BY_METHOD.html +++ b/docs/coverage/ns-1/index_SORT_BY_METHOD.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_METHOD_DESC.html b/docs/coverage/ns-1/index_SORT_BY_METHOD_DESC.html index 14c3bd5..412bebc 100644 --- a/docs/coverage/ns-1/index_SORT_BY_METHOD_DESC.html +++ b/docs/coverage/ns-1/index_SORT_BY_METHOD_DESC.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/index_SORT_BY_NAME_DESC.html b/docs/coverage/ns-1/index_SORT_BY_NAME_DESC.html index e4947dd..bfea1c0 100644 --- a/docs/coverage/ns-1/index_SORT_BY_NAME_DESC.html +++ b/docs/coverage/ns-1/index_SORT_BY_NAME_DESC.html @@ -192,7 +192,7 @@

                              Coverage Summary for Package: lv.id.jc.algorithm.graph

                              diff --git a/docs/coverage/ns-1/sources/source-1.html b/docs/coverage/ns-1/sources/source-1.html index b31c15b..b805217 100644 --- a/docs/coverage/ns-1/sources/source-1.html +++ b/docs/coverage/ns-1/sources/source-1.html @@ -147,7 +147,7 @@

                              Coverage Summary for Class: BreadthFirstSearch (lv.id.jc.algorithm.graph) -
                              generated on 2022-01-03 21:07
                              +
                              generated on 2022-01-04 18:33

                            8. diff --git a/docs/coverage/ns-1/sources/source-2.html b/docs/coverage/ns-1/sources/source-2.html index e05f805..1659e05 100644 --- a/docs/coverage/ns-1/sources/source-2.html +++ b/docs/coverage/ns-1/sources/source-2.html @@ -147,7 +147,7 @@

                              Coverage Summary for Class: DijkstrasAlgorithm (lv.id.jc.algorithm.graph) -
                              generated on 2022-01-03 21:07
                              +
                              generated on 2022-01-04 18:33

                              diff --git a/docs/coverage/ns-1/sources/source-3.html b/docs/coverage/ns-1/sources/source-3.html index 54380b1..9cdcae1 100644 --- a/docs/coverage/ns-1/sources/source-3.html +++ b/docs/coverage/ns-1/sources/source-3.html @@ -104,58 +104,56 @@

                              Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)

                              16  /** 17  * Schema of the graph. 18  * -19  -20  * -21  * @return the graph scheme -22  */ -23  Map<T, Map<T, Number>> schema(); -24  -25  /** -26  * Returns the edges of the given vertex, -27  * or {@code null} if this graph contains no given vertex. -28  * -29  * <p>A return value of {@code null} does not <i>necessarily</i> -30  * indicate that the specified vertex is not present in the graph; -31  * it's also possible that in the graph schema, {@code null} was specified -32  * for the edges of this vertex instead of an empty map. -33  * -34  * @param vertex vertex -35  * @return all links for the given vertex -36  * or null if no such vertex in the graph -37  */ -38  default Map<T, Number> edges(T vertex) { -39  return schema().get(vertex); -40  } -41  -42  /** -43  * Calculate the distance for the given path -44  * -45  * @param path the list of vertices representing the path -46  * @return distance for the given path as double -47  * @throws NullPointerException if {@code path} is incorrect and contains more than one vertex -48  */ -49  default double getDistance(List<T> path) { -50  return IntStream -51  .range(1, path.size()) -52  .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i))) -53  .mapToDouble(Number::doubleValue) -54  .sum(); -55  } -56  -57  /** -58  * Creates a Graph object by given schema. -59  * -60  * In a graph schema, each vertex is assigned an edge map. -61  * If the vertex has no edges, then it should be assigned an empty map. -62  * -63  * @param schema of the graph -64  * @param <T> the type of vertex in this graph -65  * @return graph object with given schema -66  */ -67  static <T> Graph<T> of(Map<T, Map<T, Number>> schema) { -68  return () -> schema; -69  } -70 } +19  * @return the graph scheme +20  */ +21  Map<T, Map<T, Number>> schema(); +22  +23  /** +24  * Returns the edges of the given vertex, +25  * or {@code null} if this graph contains no given vertex. +26  * +27  * <p>A return value of {@code null} does not <i>necessarily</i> +28  * indicate that the specified vertex is not present in the graph; +29  * it's also possible that in the graph schema, {@code null} was specified +30  * for the edges of this vertex instead of an empty map. +31  * +32  * @param vertex vertex +33  * @return all links for the given vertex +34  * or null if no such vertex in the graph +35  */ +36  default Map<T, Number> edges(T vertex) { +37  return schema().get(vertex); +38  } +39  +40  /** +41  * Calculate the distance for the given path +42  * +43  * @param path the list of vertices representing the path +44  * @return distance for the given path as double +45  * @throws NullPointerException if {@code path} is incorrect and contains more than one vertex +46  */ +47  default double getDistance(List<T> path) { +48  return IntStream +49  .range(1, path.size()) +50  .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i))) +51  .mapToDouble(Number::doubleValue) +52  .sum(); +53  } +54  +55  /** +56  * Creates a Graph object by given schema. +57  * +58  * In a graph schema, each vertex is assigned an edge map. +59  * If the vertex has no edges, then it should be assigned an empty map. +60  * +61  * @param schema of the graph +62  * @param <T> the type of vertex in this graph +63  * @return graph object with given schema +64  */ +65  static <T> Graph<T> of(Map<T, Map<T, Number>> schema) { +66  return () -> schema; +67  } +68 }
                              @@ -182,7 +180,7 @@

                              Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)

                              diff --git a/docs/coverage/ns-1/sources/source-4.html b/docs/coverage/ns-1/sources/source-4.html index ac9c105..790b89a 100644 --- a/docs/coverage/ns-1/sources/source-4.html +++ b/docs/coverage/ns-1/sources/source-4.html @@ -89,7 +89,7 @@

                              Coverage Summary for Class: SearchAlgorithm (lv.id.jc.algorithm.graph)

                              diff --git a/docs/index.md b/docs/index.md index ef96e35..d12273c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -65,11 +65,11 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ### Small Graph Sample ```groovy - def graph = Graph.of [ + def graph = Graph.of([ A: [B: 7, C: 2], B: [A: 3, C: 5], C: [A: 1, B: 3] - ] + ]) ``` ![Small Graph](assets/small.gif) @@ -78,13 +78,13 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ### Medium Graph Sample ```groovy - def graph = Graph.of [ + def graph = Graph.of([ A: [B: 5], B: [A: 5, C: 10], C: [B: 20, D: 5], D: [E: 5], E: [B: 5] - ] + ]) ``` ![Medium Graph](assets/medium.gif) @@ -92,7 +92,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ### Complex Graph Sample ```groovy - def graph = Graph.of [ + def graph = Graph.of([ A: [B: 5, H: 2], B: [A: 5, C: 7], C: [B: 7, D: 3, G: 4], @@ -101,7 +101,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht F: [G: 6], G: [C: 4], H: [G: 3] - ] + ]) ``` ![Complex Graph](assets/complex.gif) diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index 5fe1e2c..cba2236 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":71},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":45},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":11},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file +{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":71},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":45},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":11},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":54},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":47},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file diff --git a/docs/spock-reports/graph.BreadthFirstSearchSpec.html b/docs/spock-reports/graph.BreadthFirstSearchSpec.html index 72fc493..cc2244e 100644 --- a/docs/spock-reports/graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

                              Report for graph.BreadthFirstSearchSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:28:27 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.071 seconds0.047 seconds
                              diff --git a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html index d26af3e..70acb81 100644 --- a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.DijkstrasAlgorithmSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:28:27 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.023 seconds0.016 seconds
                              diff --git a/docs/spock-reports/graph.GraphSpec.html b/docs/spock-reports/graph.GraphSpec.html index cf37495..bebb5fa 100644 --- a/docs/spock-reports/graph.GraphSpec.html +++ b/docs/spock-reports/graph.GraphSpec.html @@ -251,7 +251,7 @@

                              Report for graph.GraphSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:28:28 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.045 seconds0.047 seconds
                              diff --git a/docs/spock-reports/graph.SearchAlgorithmSpec.html b/docs/spock-reports/graph.SearchAlgorithmSpec.html index c796b02..8ccb394 100644 --- a/docs/spock-reports/graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/graph.SearchAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.SearchAlgorithmSpec

                              Summary:

                              -
                              Created on Mon Jan 03 21:28:28 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.011 seconds0.016 seconds
                              diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index 40a9694..85a52a9 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -80,11 +80,11 @@

                              Specification run results


                              Project: Graph search algorithms -Version: 1.0 +Version: 1.1

                              Specifications summary:

                              -
                              Created on Mon Jan 03 21:28:28 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              @@ -111,7 +111,7 @@

                              Specifications summary:

                              - +
                              0 0 100.0%0.150 seconds0.126 seconds
                              @@ -142,7 +142,7 @@

                              Specifications:

                              0 0 100.0% -0.071 seconds +0.047 seconds @@ -155,7 +155,7 @@

                              Specifications:

                              0 0 100.0% -0.023 seconds +0.016 seconds @@ -168,7 +168,7 @@

                              Specifications:

                              0 0 100.0% -0.045 seconds +0.047 seconds @@ -181,7 +181,7 @@

                              Specifications:

                              0 0 100.0% -0.011 seconds +0.016 seconds diff --git a/docs/spock-reports/summary.md b/docs/spock-reports/summary.md new file mode 100644 index 0000000..12d9308 --- /dev/null +++ b/docs/spock-reports/summary.md @@ -0,0 +1,23 @@ +# Specification run results + +## Project: Graph search algorithms, Version: 1.1 + +## Specifications summary + +Created on Tue Jan 04 18:35:06 EET 2022 by jegors.cemisovs + +| Total | Passed | Failed | Feature failures | Feature errors | Success rate | Total time (ms) | +|----------------|-----------------|-----------------|------------------|------------------|---------------------|-----------------| +| 4 | 4 | 0 | 0 | 0 | 1.0| 138.0 | + +## Specifications + +|Name | Features | Failed | Errors | Skipped | Success rate | Time | +|------|----------|--------|--------|---------|--------------|------| +| graph.BreadthFirstSearchSpec | 4 | 0 | 0 | 0 | 1.0 | 54 | +| graph.SearchAlgorithmSpec | 1 | 0 | 0 | 0 | 1.0 | 15 | +| graph.DijkstrasAlgorithmSpec | 5 | 0 | 0 | 0 | 1.0 | 16 | +| graph.GraphSpec | 5 | 0 | 0 | 0 | 1.0 | 53 | + + +Generated by Athaydes Spock Reports \ No newline at end of file diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java index 76157aa..6ed2e9c 100644 --- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ b/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -14,7 +14,10 @@ @FunctionalInterface public interface Graph { /** - * Schema of the graph. + * The schema of this graph. + * + * In a graph schema, each vertex is assigned an edge map. + * If the vertex has no edges, then it should be assigned an empty map. * * @return the graph scheme */ diff --git a/src/test/resources/SpockConfig.groovy b/src/test/resources/SpockConfig.groovy index 887390e..c21511c 100644 --- a/src/test/resources/SpockConfig.groovy +++ b/src/test/resources/SpockConfig.groovy @@ -2,5 +2,9 @@ spockReports { set 'com.athaydes.spockframework.report.showCodeBlocks': true set 'com.athaydes.spockframework.report.outputDir': 'docs/spock-reports' set 'com.athaydes.spockframework.report.projectName': 'Graph search algorithms' - set 'com.athaydes.spockframework.report.projectVersion': 1.0 + set 'com.athaydes.spockframework.report.projectVersion': 1.1 + set 'com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled': true + set 'com.athaydes.spockframework.report.IReportCreator': 'com.athaydes.spockframework.report.internal.HtmlReportCreator' + // com.athaydes.spockframework.report.template.TemplateReportCreator + // com.athaydes.spockframework.report.internal.HtmlReportCreator } \ No newline at end of file From ed238147b364baf4c76fb62faee53c56248c7c57 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 4 Jan 2022 19:57:40 +0200 Subject: [PATCH 059/118] Updated reports --- docs/spock-reports/aggregated_report.json | 2 +- .../graph.BreadthFirstSearchSpec.html | 4 ++-- .../graph.DijkstrasAlgorithmSpec.html | 4 ++-- docs/spock-reports/graph.GraphSpec.html | 4 ++-- docs/spock-reports/graph.SearchAlgorithmSpec.html | 4 ++-- docs/spock-reports/index.html | 12 ++++++------ src/test/resources/SpockConfig.groovy | 14 ++++++++------ 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index cba2236..4672826 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":71},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":45},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":11},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":54},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":47},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file +{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":71},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":45},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":11},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":54},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":47},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":53},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file diff --git a/docs/spock-reports/graph.BreadthFirstSearchSpec.html b/docs/spock-reports/graph.BreadthFirstSearchSpec.html index cc2244e..92935ec 100644 --- a/docs/spock-reports/graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

                              Report for graph.BreadthFirstSearchSpec

                              Summary:

                              -
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 19:56:48 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.047 seconds0.053 seconds
                              diff --git a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html index 70acb81..a697c9d 100644 --- a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.DijkstrasAlgorithmSpec

                              Summary:

                              -
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.016 seconds0.037 seconds
                              diff --git a/docs/spock-reports/graph.GraphSpec.html b/docs/spock-reports/graph.GraphSpec.html index bebb5fa..9bd33e6 100644 --- a/docs/spock-reports/graph.GraphSpec.html +++ b/docs/spock-reports/graph.GraphSpec.html @@ -251,7 +251,7 @@

                              Report for graph.GraphSpec

                              Summary:

                              -
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.047 seconds0.053 seconds
                              diff --git a/docs/spock-reports/graph.SearchAlgorithmSpec.html b/docs/spock-reports/graph.SearchAlgorithmSpec.html index 8ccb394..b3f1b1a 100644 --- a/docs/spock-reports/graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/graph.SearchAlgorithmSpec.html @@ -251,7 +251,7 @@

                              Report for graph.SearchAlgorithmSpec

                              Summary:

                              -
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                              @@ -272,7 +272,7 @@

                              Summary:

                              - +
                              0 0 100.0%0.016 seconds0.015 seconds
                              diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index 85a52a9..2de51b9 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

                              Specification run results

                              Specifications summary:

                              -
                              Created on Tue Jan 04 18:35:45 EET 2022 by jegors.cemisovs
                              +
                              Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                              @@ -111,7 +111,7 @@

                              Specifications summary:

                              - +
                              0 0 100.0%0.126 seconds0.158 seconds
                              @@ -142,7 +142,7 @@

                              Specifications:

                              0 0 100.0% -0.047 seconds +0.053 seconds @@ -155,7 +155,7 @@

                              Specifications:

                              0 0 100.0% -0.016 seconds +0.037 seconds @@ -168,7 +168,7 @@

                              Specifications:

                              0 0 100.0% -0.047 seconds +0.053 seconds @@ -181,7 +181,7 @@

                              Specifications:

                              0 0 100.0% -0.016 seconds +0.015 seconds diff --git a/src/test/resources/SpockConfig.groovy b/src/test/resources/SpockConfig.groovy index c21511c..55671ba 100644 --- a/src/test/resources/SpockConfig.groovy +++ b/src/test/resources/SpockConfig.groovy @@ -1,10 +1,12 @@ spockReports { - set 'com.athaydes.spockframework.report.showCodeBlocks': true - set 'com.athaydes.spockframework.report.outputDir': 'docs/spock-reports' - set 'com.athaydes.spockframework.report.projectName': 'Graph search algorithms' - set 'com.athaydes.spockframework.report.projectVersion': 1.1 - set 'com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled': true - set 'com.athaydes.spockframework.report.IReportCreator': 'com.athaydes.spockframework.report.internal.HtmlReportCreator' + + set(['com.athaydes.spockframework.report.showCodeBlocks' : true, + 'com.athaydes.spockframework.report.outputDir' : 'docs/spock-reports', + 'com.athaydes.spockframework.report.projectName' : 'Graph search algorithms', + 'com.athaydes.spockframework.report.projectVersion' : 1.1, + 'com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled': true, + 'com.athaydes.spockframework.report.IReportCreator' : 'com.athaydes.spockframework.report.internal.HtmlReportCreator' + ]) // com.athaydes.spockframework.report.template.TemplateReportCreator // com.athaydes.spockframework.report.internal.HtmlReportCreator } \ No newline at end of file From 74afa68eaf98ae7390e5cf371bf060b6e5e99154 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 4 Jan 2022 20:54:44 +0200 Subject: [PATCH 060/118] Add subproject --- .gitignore | 3 +- .idea/gradle.xml | 1 + algorithm/build.gradle | 44 ++++++++++++ .../algorithm/graph/BreadthFirstSearch.java | 48 +++++++++++++ .../algorithm/graph/DijkstrasAlgorithm.java | 48 +++++++++++++ .../java/lv/id/jc/algorithm/graph/Graph.java | 71 +++++++++++++++++++ .../jc/algorithm/graph/SearchAlgorithm.java | 23 ++++++ .../id/jc/algorithm/graph/package-info.java | 4 ++ algorithm/src/main/java/module-info.java | 8 +++ settings.gradle | 4 +- 10 files changed, 252 insertions(+), 2 deletions(-) create mode 100644 algorithm/build.gradle create mode 100644 algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java create mode 100644 algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java create mode 100644 algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java create mode 100644 algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java create mode 100644 algorithm/src/main/java/lv/id/jc/algorithm/graph/package-info.java create mode 100644 algorithm/src/main/java/module-info.java diff --git a/.gitignore b/.gitignore index f6119d5..d391d30 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,5 @@ out/ ############################## ## OS X ############################## -.DS_Store \ No newline at end of file +.DS_Store +/algorithm/gradle.properties diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 1b3f3e9..6f52909 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -11,6 +11,7 @@ diff --git a/algorithm/build.gradle b/algorithm/build.gradle new file mode 100644 index 0000000..8c6049f --- /dev/null +++ b/algorithm/build.gradle @@ -0,0 +1,44 @@ +plugins { + id 'java-library' + id 'maven-publish' +} +sourceCompatibility = JavaVersion.VERSION_17 + +group 'lv.id.jc' +version '1.1' + +repositories { + mavenCentral() +} + +// Configures the publishing +publishing { + repositories { + // The target repository + maven { + // Choose whatever name you want + name = "algorithms" + // The url of the repository, where the artifacts will be published + url = "https://maven.pkg.github.com/rabestro/algorithms" + credentials { + // The credentials (described in the next section) + username = project.findProperty("gpr.user") + password = project.findProperty("gpr.key") + } + } + } + publications { + gpr(MavenPublication) { + from(components.java) + // Fixes the error with dynamic versions when using Spring Boot + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } + } + } + } +} \ No newline at end of file diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java new file mode 100644 index 0000000..6c6cfa2 --- /dev/null +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -0,0 +1,48 @@ +package lv.id.jc.algorithm.graph; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; + +import static java.util.function.Predicate.not; +import static java.util.stream.Stream.iterate; + +/** + * Algorithm for finding the shortest paths between nodes in a graph. + * + * The algorithm doesn't take into account the distance between nodes. + * + * @author Jegors Čemisovs + * @param the type of vertex + * @since 1.0 + */ +public class BreadthFirstSearch implements SearchAlgorithm { + + @Override + public List findPath(Graph graph, T source, T target) { + var queue = new LinkedList(); + var visited = new HashSet(); + var previous = new HashMap(); + queue.add(source); + + while (!queue.isEmpty()) { + var node = queue.removeFirst(); + if (target.equals(node)) { + var path = new LinkedList(); + iterate(node, Objects::nonNull, previous::get).forEach(path::addFirst); + return path; + } + visited.add(node); + graph.edges(node).keySet().stream() + .filter(not(visited::contains)) + .forEach(it -> { + previous.computeIfAbsent(it, x -> node); + queue.addLast(it); + }); + } + return List.of(); + } + +} diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java new file mode 100644 index 0000000..c6769c7 --- /dev/null +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -0,0 +1,48 @@ +package lv.id.jc.algorithm.graph; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; + +import static java.util.stream.Stream.iterate; + +/** + * Algorithm for finding the fastest paths between nodes in a graph. + *

                              + * The algorithm uses information about edge's distance to find the fastest path. + * + * @author Jegors Čemisovs + * @param the type of vertex + * @since 1.0 + */ +public class DijkstrasAlgorithm implements SearchAlgorithm { + + @Override + public List findPath(Graph graph, T source, T target) { + var queue = new LinkedList(); + var distances = new HashMap(); + var previous = new HashMap(); + queue.add(source); + distances.put(source, .0); + + while (!queue.isEmpty()) { + var prev = queue.removeFirst(); + graph.edges(prev).forEach((node, time) -> { + var distance = distances.get(prev) + time.doubleValue(); + if (distance < distances.getOrDefault(node, Double.MAX_VALUE)) { + previous.put(node, prev); + distances.put(node, distance); + queue.addLast(node); + } + }); + } + if (previous.containsKey(target) || source.equals(target)) { + var path = new LinkedList(); + iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst); + return path; + } + return List.of(); + } + +} diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java new file mode 100644 index 0000000..6ed2e9c --- /dev/null +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -0,0 +1,71 @@ +package lv.id.jc.algorithm.graph; + +import java.util.List; +import java.util.Map; +import java.util.stream.IntStream; + +/** + * An interface for weighted directed graph (network) + * + * @param the type of vertex in this graph + * @author Jegors Čemisovs + * @since 1.1 + */ +@FunctionalInterface +public interface Graph { + /** + * The schema of this graph. + * + * In a graph schema, each vertex is assigned an edge map. + * If the vertex has no edges, then it should be assigned an empty map. + * + * @return the graph scheme + */ + Map> schema(); + + /** + * Returns the edges of the given vertex, + * or {@code null} if this graph contains no given vertex. + * + *

                              A return value of {@code null} does not necessarily + * indicate that the specified vertex is not present in the graph; + * it's also possible that in the graph schema, {@code null} was specified + * for the edges of this vertex instead of an empty map. + * + * @param vertex vertex + * @return all links for the given vertex + * or null if no such vertex in the graph + */ + default Map edges(T vertex) { + return schema().get(vertex); + } + + /** + * Calculate the distance for the given path + * + * @param path the list of vertices representing the path + * @return distance for the given path as double + * @throws NullPointerException if {@code path} is incorrect and contains more than one vertex + */ + default double getDistance(List path) { + return IntStream + .range(1, path.size()) + .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i))) + .mapToDouble(Number::doubleValue) + .sum(); + } + + /** + * Creates a Graph object by given schema. + * + * In a graph schema, each vertex is assigned an edge map. + * If the vertex has no edges, then it should be assigned an empty map. + * + * @param schema of the graph + * @param the type of vertex in this graph + * @return graph object with given schema + */ + static Graph of(Map> schema) { + return () -> schema; + } +} diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java new file mode 100644 index 0000000..79692d7 --- /dev/null +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java @@ -0,0 +1,23 @@ +package lv.id.jc.algorithm.graph; + +import java.util.List; + +/** + * A functional interface for graph search algorithm + * + * @author Jegors Čemisovs + * @param the type of vertex + * @since 1.0 + */ +@FunctionalInterface +public interface SearchAlgorithm { + /** + * Find the path from the source node to the target + * + * @param graph The graph in which we search for the path + * @param source Search starting point identifier + * @param target Search finish point identifier + * @return Path found or empty list if path cannot be found + */ + List findPath(Graph graph, T source, T target); +} diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/package-info.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/package-info.java new file mode 100644 index 0000000..28436e8 --- /dev/null +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains graph pathfinding algorithms. + */ +package lv.id.jc.algorithm.graph; \ No newline at end of file diff --git a/algorithm/src/main/java/module-info.java b/algorithm/src/main/java/module-info.java new file mode 100644 index 0000000..941d8df --- /dev/null +++ b/algorithm/src/main/java/module-info.java @@ -0,0 +1,8 @@ +/** + * The module contains an interface for a graph and an interface for a graph search algorithm. + * There is an implementation of two search algorithms: + * Dijkstra's algorithm and Breadth First Search algorithm. + */ +module lv.id.jc.algorithm.graph { + exports lv.id.jc.algorithm.graph; +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 89fef3f..9516f98 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ -rootProject.name = 'search-algorithm' +rootProject.name = 'algorithms' +include 'algorithm' + From 81c809e6bc8f78c2d0e1b2bb1573cc309b1e6cb1 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 4 Jan 2022 20:59:08 +0200 Subject: [PATCH 061/118] Add tests for subproject --- algorithm/build.gradle | 21 ++- .../id/jc/graph/BreadthFirstSearchSpec.groovy | 95 +++++++++++++ .../id/jc/graph/DijkstrasAlgorithmSpec.groovy | 127 ++++++++++++++++++ .../groovy/lv/id/jc/graph/GraphSpec.groovy | 100 ++++++++++++++ .../lv/id/jc/graph/SearchAlgorithmSpec.groovy | 63 +++++++++ .../src/test/resources/SpockConfig.groovy | 12 ++ 6 files changed, 417 insertions(+), 1 deletion(-) create mode 100644 algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy create mode 100644 algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy create mode 100644 algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy create mode 100644 algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy create mode 100644 algorithm/src/test/resources/SpockConfig.groovy diff --git a/algorithm/build.gradle b/algorithm/build.gradle index 8c6049f..af5b777 100644 --- a/algorithm/build.gradle +++ b/algorithm/build.gradle @@ -1,4 +1,5 @@ plugins { + id 'groovy' id 'java-library' id 'maven-publish' } @@ -41,4 +42,22 @@ publishing { } } } -} \ No newline at end of file +} + +dependencies { + // Spock Framework + testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' + testImplementation 'org.codehaus.groovy:groovy-all:3.0.9' + + // Spock Reports + testRuntimeClasspath( "com.athaydes:spock-reports:2.1.1-groovy-3.0" ) { + transitive = false // this avoids affecting your version of Groovy/Spock + } + // Required for spock-reports + testImplementation 'org.slf4j:slf4j-api:1.7.32' + testRuntimeClasspath 'org.slf4j:slf4j-simple:1.7.32' +} + +test { + useJUnitPlatform() +} diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy new file mode 100644 index 0000000..7feffbd --- /dev/null +++ b/algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy @@ -0,0 +1,95 @@ +package lv.id.jc.graph + +import lv.id.jc.algorithm.graph.BreadthFirstSearch +import lv.id.jc.algorithm.graph.Graph +import spock.lang.* + +@Title("Breadth First Search Algorithm") +@See("https://en.wikipedia.org/wiki/Breadth-first_search") +@Narrative(""" +Breadth First Search algorithm for finding the shortest paths between nodes in a graph +""") +class BreadthFirstSearchSpec extends Specification { + @Subject + def algorithm = new BreadthFirstSearch() + + def 'should find a route for simple graph'() { + given: 'A simple graph' + def graph = Graph.of([ + A: [B: 7, C: 2], + B: [A: 3, C: 5], + C: [A: 1, B: 3] + ]) + + when: 'we use Breadth First Search algorithm to find a path' + def path = algorithm.findPath(graph, source, target) + + then: 'we get the shortest path' + path == shortest + + and: 'the distance calculated correctly' + graph.getDistance(path) == time as double + + where: + source | target || time | shortest + 'A' | 'A' || 0 | ['A'] + 'A' | 'B' || 7 | ['A', 'B'] + 'B' | 'C' || 5 | ['B', 'C'] + 'C' | 'B' || 3 | ['C', 'B'] + } + + def 'should find a route for complex graph'() { + given: 'A complex graph' + def graph = Graph.of([ + A: [B: 1], + B: [A: 1, D: 1], + C: [A: 1], + D: [C: 1, E: 1], + E: [F: 1], + F: [D: 1, E: 1]]) + + when: 'we use Breadth First Search algorithm to find a path' + def path = algorithm.findPath(graph, source, target) + + then: 'we get the shortest path' + path == shortest + + and: 'the distance calculated correctly' + graph.getDistance(path) == time as double + + where: + source | target || shortest + 'A' | 'A' || ['A'] + 'B' | 'B' || ['B'] + 'A' | 'B' || ['A', 'B'] + 'B' | 'A' || ['B', 'A'] + 'A' | 'C' || ['A', 'B', 'D', 'C'] + 'C' | 'A' || ['C', 'A'] + 'E' | 'B' || ['E', 'F', 'D', 'C', 'A', 'B'] + + and: + time = shortest.size() - 1 + } + + def 'should thrown NPE path for an empty graph'() { + given: 'an empty graph' + def graph = Graph.of([:]) + + when: "we use Dijkstra's algorithm to find a path" + algorithm.findPath(graph, 'A', 'B') + + then: 'the exception was thrown' + thrown NullPointerException + } + + def "should return an empty path if can't find a route"() { + given: 'a simple graph with no edge between nodes' + def graph = Graph.of([A: [:], B: [:]]) + + when: 'we use Breadth First Search algorithm to find a path' + def path = algorithm.findPath(graph, 'A', 'B') + + then: 'we get an empty path' + path == [] + } +} diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy new file mode 100644 index 0000000..db283c6 --- /dev/null +++ b/algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy @@ -0,0 +1,127 @@ +package lv.id.jc.graph + +import lv.id.jc.algorithm.graph.DijkstrasAlgorithm +import lv.id.jc.algorithm.graph.Graph +import spock.lang.* + +@Title("Dijkstra's Algorithm") +@See("https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm") +@Narrative("Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph") +class DijkstrasAlgorithmSpec extends Specification { + @Subject + def algorithm = new DijkstrasAlgorithm() + + def 'should find a route for a simple graph'() { + given: 'A simple graph' + def graph = Graph.of([ + A: [B: 7, C: 2], + B: [A: 3, C: 5], + C: [A: 1, B: 3] + ]) + + when: "we use Dijkstra's algorithm to find a path" + def path = algorithm.findPath(graph, source, target) + + then: 'we get the fastest way' + path == fastest + + and: 'the distance calculated correctly' + graph.getDistance(path) == time as double + + where: + source | target || time | fastest + 'A' | 'A' || 0 | ['A'] + 'B' | 'B' || 0 | ['B'] + 'C' | 'C' || 0 | ['C'] + 'A' | 'B' || 5 | ['A', 'C', 'B'] + } + + def 'should find a route for a medium graph'() { + given: 'A medium graph' + def graph = Graph.of([ + A: [B: 5], + B: [A: 5, C: 10], + C: [B: 20, D: 5], + D: [E: 5], + E: [B: 5] + ]) + + when: "we use Dijkstra's algorithm to find a path" + def path = algorithm.findPath(graph, source, target) + + then: 'we get the fastest way' + path == fastest + + and: 'the distance calculated correctly' + graph.getDistance(path) == time as double + + where: + source | target || time | fastest + 'A' | 'A' || 0 | ['A'] + 'B' | 'B' || 0 | ['B'] + 'A' | 'B' || 5 | ['A', 'B'] + 'B' | 'A' || 5 | ['B', 'A'] + 'A' | 'C' || 15 | ['A', 'B', 'C'] + 'C' | 'A' || 20 | ['C', 'D', 'E', 'B', 'A'] + } + + def 'should find a route for a complex graph'() { + given: 'A complex graph' + def graph = Graph.of([ + A: [B: 5, H: 2], + B: [A: 5, C: 7], + C: [B: 7, D: 3, G: 4], + D: [C: 20, E: 4], + E: [F: 5], + F: [G: 6], + G: [C: 4], + H: [G: 3] + ]) + + when: "we use Dijkstra's algorithm to find a path" + def path = algorithm.findPath(graph, source, target) + + then: 'we get the fastest way' + path == fastest + + and: 'the distance calculated correctly' + graph.getDistance(path) == time as double + + where: + source | target || time | fastest + 'A' | 'A' || 0 | ['A'] + 'B' | 'B' || 0 | ['B'] + 'A' | 'B' || 5 | ['A', 'B'] + 'B' | 'A' || 5 | ['B', 'A'] + 'A' | 'C' || 9 | ['A', 'H', 'G', 'C'] + 'C' | 'A' || 12 | ['C', 'B', 'A'] + 'A' | 'G' || 5 | ['A', 'H', 'G'] + 'C' | 'D' || 3 | ['C', 'D'] + 'D' | 'C' || 19 | ['D', 'E', 'F', 'G', 'C'] + 'B' | 'D' || 10 | ['B', 'C', 'D'] + 'D' | 'B' || 26 | ['D', 'E', 'F', 'G', 'C', 'B'] + 'D' | 'H' || 33 | ['D', 'E', 'F', 'G', 'C', 'B', 'A', 'H'] + } + + def 'should thrown NPE for an empty graph'() { + given: 'an empty graph' + def graph = Graph.of([:]) + + when: "we use Dijkstra's algorithm to find a path" + algorithm.findPath(graph, 'A', 'B') + + then: 'the exception was thrown' + thrown NullPointerException + } + + def "should return an empty path if can't find a route"() { + given: 'a simple graph with no edge between nodes' + def graph = Graph.of([A: [:], B: [:]]) + + when: "we use Dijkstra's algorithm to find a path" + def path = algorithm.findPath(graph, 'A', 'B') + + then: 'we get an empty path' + path == [] + } +} diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy new file mode 100644 index 0000000..5d87b77 --- /dev/null +++ b/algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy @@ -0,0 +1,100 @@ +package lv.id.jc.graph + +import lv.id.jc.algorithm.graph.Graph +import spock.lang.Narrative +import spock.lang.Specification +import spock.lang.Title + +@Title("Generic Graph") +@Narrative("A generic implementation of Graph structure") +class GraphSpec extends Specification { + + def "should return edges for a given node"() { + given: 'a simple graph with three nodes' + def graph = Graph.of([ + A: [B: 7, C: 2], + B: [A: 3, C: 5], + C: [A: 1, B: 3] + ]) + + expect: 'The method returns expected edges for given node' + graph.edges(node) == expected + + where: + node | expected + 'A' | [B: 7, C: 2] + 'B' | [A: 3, C: 5] + 'C' | [A: 1, B: 3] + } + + def 'should calculate distance for a path'() { + given: "a complex graph with eight nodes" + def graph = Graph.of([ + A: [B: 5, H: 2], + B: [A: 5, C: 7], + C: [B: 7, D: 3, G: 4], + D: [C: 20, E: 4], + E: [F: 5], + F: [G: 6], + G: [C: 4], + H: [G: 3] + ]) + + expect: 'the distance for a path correctly calculated' + graph.getDistance(path) == distance as double + + where: 'path and expected distance' + path | distance + ['A'] | 0 + ['A', 'B'] | 5 + ['B', 'A'] | 5 + ['A', 'B', 'A'] | 10 + ['A', 'B', 'A', 'B'] | 15 + ['C', 'D'] | 3 + ['D', 'C'] | 20 + ['D', 'E', 'F', 'G', 'C'] | 19 + } + + def 'should be zero distance for an empty path'() { + given: 'any graph' + def graph = Graph.of(_ as Map) + + expect: 'the distance is zero for an empty path' + graph.getDistance([]) == 0 + } + + def 'should be zero distance for any one node path'() { + given: 'any graph' + def graph = Graph.of(_ as Map) + + expect: 'the zero distance for any one-node path' + graph.getDistance(oneNodePath) == 0 + + where: 'the node may be of any type and even non-existent' + oneNodePath << [ + ['A'], ['B'], [2], ['X' as char], [12.56] + ] + } + + def 'should throw NPE for incorrect path'() { + given: "a medium graph with five nodes" + def graph = Graph.of([ + A: [B: 5], + B: [A: 5, C: 10], + C: [B: 20, D: 5], + D: [E: 5], + E: [B: 5] + ]) + + when: 'we call the method with incorrect path' + graph.getDistance(incorrectPath) + + then: 'the NPE thrown' + thrown NullPointerException + + where: 'path is more then one node' + incorrectPath << [ + ['E', 'D'], ['A', 'C'], ['A', 'B', 'D'] + ] + } +} \ No newline at end of file diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy new file mode 100644 index 0000000..e3b51a2 --- /dev/null +++ b/algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy @@ -0,0 +1,63 @@ +package lv.id.jc.graph + +import lv.id.jc.algorithm.graph.BreadthFirstSearch +import lv.id.jc.algorithm.graph.DijkstrasAlgorithm +import lv.id.jc.algorithm.graph.Graph +import spock.lang.Specification +import spock.lang.Subject +import spock.lang.Title + +@Title("Comparison of two algorithms") +class SearchAlgorithmSpec extends Specification { + @Subject + def bfsAlgorithm = new BreadthFirstSearch() + + @Subject + def dijkstras = new DijkstrasAlgorithm() + + def 'should find a route for a complex graph'() { + given: 'A complex graph sample' + def graph = Graph.of([ + A: [B: 5, H: 2], + B: [A: 5, C: 7], + C: [B: 7, D: 3, G: 4], + D: [C: 20, E: 4], + E: [F: 5], + F: [G: 6], + G: [C: 4], + H: [G: 3] + ]) + + when: 'we use Breadth First Search algorithm for the first route' + def routeOne = bfsAlgorithm.findPath(graph, source, target) + + and: 'we use Dijkstras algorithm for the second route' + def routeTwo = dijkstras.findPath(graph, source, target) + + then: "the first route is the shortest" + routeOne == shortest + + and: 'the second route is the fastest' + routeTwo == fastest + + and: 'the distance calculated correctly' + graph.getDistance(routeOne) == d1 as double + graph.getDistance(routeTwo) == d2 as double + + where: + source | target || d1 | shortest | d2 | fastest + 'A' | 'A' || 0 | ['A'] | 0 | ['A'] + 'B' | 'B' || 0 | ['B'] | 0 | ['B'] + 'A' | 'B' || 5 | ['A', 'B'] | 5 | ['A', 'B'] + 'B' | 'A' || 5 | ['B', 'A'] | 5 | ['B', 'A'] + 'A' | 'C' || 12 | ['A', 'B', 'C'] | 9 | ['A', 'H', 'G', 'C'] + 'C' | 'A' || 12 | ['C', 'B', 'A'] | 12 | ['C', 'B', 'A'] + 'A' | 'G' || 5 | ['A', 'H', 'G'] | 5 | ['A', 'H', 'G'] + 'C' | 'D' || 3 | ['C', 'D'] | 3 | ['C', 'D'] + 'D' | 'C' || 20 | ['D', 'C'] | 19 | ['D', 'E', 'F', 'G', 'C'] + 'B' | 'D' || 10 | ['B', 'C', 'D'] | 10 | ['B', 'C', 'D'] + 'D' | 'B' || 27 | ['D', 'C', 'B'] | 26 | ['D', 'E', 'F', 'G', 'C', 'B'] + 'D' | 'H' || 34 | ['D', 'C', 'B', 'A', 'H'] | 33 | ['D', 'E', 'F', 'G', 'C', 'B', 'A', 'H'] + } + +} diff --git a/algorithm/src/test/resources/SpockConfig.groovy b/algorithm/src/test/resources/SpockConfig.groovy new file mode 100644 index 0000000..55671ba --- /dev/null +++ b/algorithm/src/test/resources/SpockConfig.groovy @@ -0,0 +1,12 @@ +spockReports { + + set(['com.athaydes.spockframework.report.showCodeBlocks' : true, + 'com.athaydes.spockframework.report.outputDir' : 'docs/spock-reports', + 'com.athaydes.spockframework.report.projectName' : 'Graph search algorithms', + 'com.athaydes.spockframework.report.projectVersion' : 1.1, + 'com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled': true, + 'com.athaydes.spockframework.report.IReportCreator' : 'com.athaydes.spockframework.report.internal.HtmlReportCreator' + ]) + // com.athaydes.spockframework.report.template.TemplateReportCreator + // com.athaydes.spockframework.report.internal.HtmlReportCreator +} \ No newline at end of file From ff580845c75112aa9225ea2b8738474d411a472f Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 4 Jan 2022 21:02:20 +0200 Subject: [PATCH 062/118] Add subproject sample --- .idea/gradle.xml | 1 + sample/build.gradle | 15 +++++++++++++++ settings.gradle | 1 + 3 files changed, 17 insertions(+) create mode 100644 sample/build.gradle diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 6f52909..dc522cc 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,6 +12,7 @@ diff --git a/sample/build.gradle b/sample/build.gradle new file mode 100644 index 0000000..bff2cf3 --- /dev/null +++ b/sample/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'groovy' + id 'java' +} + +group 'lv.id.jc' +version '1.1' + +repositories { + mavenCentral() +} + +dependencies { + implementation 'org.codehaus.groovy:groovy-all:3.0.9' +} diff --git a/settings.gradle b/settings.gradle index 9516f98..710d931 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,4 @@ rootProject.name = 'algorithms' include 'algorithm' +include 'sample' From cd64289c67cc531c9b6e722714da481018b3f3d1 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 4 Jan 2022 21:25:18 +0200 Subject: [PATCH 063/118] Add subproject sample --- .gitignore | 1 + .idea/jarRepositories.xml | 5 + algorithm/build.gradle | 2 +- build.gradle | 26 ---- sample/build.gradle | 16 +++ .../main/java/lv/id/jc/sample/GraphApp.java | 51 +++++++ .../algorithm/graph/BreadthFirstSearch.java | 48 ------- .../algorithm/graph/DijkstrasAlgorithm.java | 48 ------- .../java/lv/id/jc/algorithm/graph/Graph.java | 71 ---------- .../jc/algorithm/graph/SearchAlgorithm.java | 23 ---- .../id/jc/algorithm/graph/package-info.java | 4 - src/main/java/module-info.java | 8 -- .../graph/BreadthFirstSearchSpec.groovy | 95 ------------- .../graph/DijkstrasAlgorithmSpec.groovy | 127 ------------------ src/test/groovy/graph/GraphSpec.groovy | 100 -------------- .../groovy/graph/SearchAlgorithmSpec.groovy | 63 --------- src/test/resources/SpockConfig.groovy | 12 -- 17 files changed, 74 insertions(+), 626 deletions(-) create mode 100644 sample/src/main/java/lv/id/jc/sample/GraphApp.java delete mode 100644 src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java delete mode 100644 src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java delete mode 100644 src/main/java/lv/id/jc/algorithm/graph/Graph.java delete mode 100644 src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java delete mode 100644 src/main/java/lv/id/jc/algorithm/graph/package-info.java delete mode 100644 src/main/java/module-info.java delete mode 100644 src/test/groovy/graph/BreadthFirstSearchSpec.groovy delete mode 100644 src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy delete mode 100644 src/test/groovy/graph/GraphSpec.groovy delete mode 100644 src/test/groovy/graph/SearchAlgorithmSpec.groovy delete mode 100644 src/test/resources/SpockConfig.groovy diff --git a/.gitignore b/.gitignore index d391d30..b1b10da 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ out/ ############################## .DS_Store /algorithm/gradle.properties +/sample/gradle.properties diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index fdc392f..73a34ad 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -16,5 +16,10 @@

                              - * The algorithm uses information about edge's distance to find the fastest path. - * - * @author Jegors Čemisovs - * @param the type of vertex - * @since 1.0 - */ -public class DijkstrasAlgorithm implements SearchAlgorithm { - - @Override - public List findPath(Graph graph, T source, T target) { - var queue = new LinkedList(); - var distances = new HashMap(); - var previous = new HashMap(); - queue.add(source); - distances.put(source, .0); - - while (!queue.isEmpty()) { - var prev = queue.removeFirst(); - graph.edges(prev).forEach((node, time) -> { - var distance = distances.get(prev) + time.doubleValue(); - if (distance < distances.getOrDefault(node, Double.MAX_VALUE)) { - previous.put(node, prev); - distances.put(node, distance); - queue.addLast(node); - } - }); - } - if (previous.containsKey(target) || source.equals(target)) { - var path = new LinkedList(); - iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst); - return path; - } - return List.of(); - } - -} diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java deleted file mode 100644 index 6ed2e9c..0000000 --- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ /dev/null @@ -1,71 +0,0 @@ -package lv.id.jc.algorithm.graph; - -import java.util.List; -import java.util.Map; -import java.util.stream.IntStream; - -/** - * An interface for weighted directed graph (network) - * - * @param the type of vertex in this graph - * @author Jegors Čemisovs - * @since 1.1 - */ -@FunctionalInterface -public interface Graph { - /** - * The schema of this graph. - * - * In a graph schema, each vertex is assigned an edge map. - * If the vertex has no edges, then it should be assigned an empty map. - * - * @return the graph scheme - */ - Map> schema(); - - /** - * Returns the edges of the given vertex, - * or {@code null} if this graph contains no given vertex. - * - *

                              A return value of {@code null} does not necessarily - * indicate that the specified vertex is not present in the graph; - * it's also possible that in the graph schema, {@code null} was specified - * for the edges of this vertex instead of an empty map. - * - * @param vertex vertex - * @return all links for the given vertex - * or null if no such vertex in the graph - */ - default Map edges(T vertex) { - return schema().get(vertex); - } - - /** - * Calculate the distance for the given path - * - * @param path the list of vertices representing the path - * @return distance for the given path as double - * @throws NullPointerException if {@code path} is incorrect and contains more than one vertex - */ - default double getDistance(List path) { - return IntStream - .range(1, path.size()) - .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i))) - .mapToDouble(Number::doubleValue) - .sum(); - } - - /** - * Creates a Graph object by given schema. - * - * In a graph schema, each vertex is assigned an edge map. - * If the vertex has no edges, then it should be assigned an empty map. - * - * @param schema of the graph - * @param the type of vertex in this graph - * @return graph object with given schema - */ - static Graph of(Map> schema) { - return () -> schema; - } -} diff --git a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java deleted file mode 100644 index 79692d7..0000000 --- a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java +++ /dev/null @@ -1,23 +0,0 @@ -package lv.id.jc.algorithm.graph; - -import java.util.List; - -/** - * A functional interface for graph search algorithm - * - * @author Jegors Čemisovs - * @param the type of vertex - * @since 1.0 - */ -@FunctionalInterface -public interface SearchAlgorithm { - /** - * Find the path from the source node to the target - * - * @param graph The graph in which we search for the path - * @param source Search starting point identifier - * @param target Search finish point identifier - * @return Path found or empty list if path cannot be found - */ - List findPath(Graph graph, T source, T target); -} diff --git a/src/main/java/lv/id/jc/algorithm/graph/package-info.java b/src/main/java/lv/id/jc/algorithm/graph/package-info.java deleted file mode 100644 index 28436e8..0000000 --- a/src/main/java/lv/id/jc/algorithm/graph/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * This package contains graph pathfinding algorithms. - */ -package lv.id.jc.algorithm.graph; \ No newline at end of file diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java deleted file mode 100644 index 941d8df..0000000 --- a/src/main/java/module-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * The module contains an interface for a graph and an interface for a graph search algorithm. - * There is an implementation of two search algorithms: - * Dijkstra's algorithm and Breadth First Search algorithm. - */ -module lv.id.jc.algorithm.graph { - exports lv.id.jc.algorithm.graph; -} \ No newline at end of file diff --git a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy b/src/test/groovy/graph/BreadthFirstSearchSpec.groovy deleted file mode 100644 index 1d76485..0000000 --- a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy +++ /dev/null @@ -1,95 +0,0 @@ -package graph - -import lv.id.jc.algorithm.graph.BreadthFirstSearch -import lv.id.jc.algorithm.graph.Graph -import spock.lang.* - -@Title("Breadth First Search Algorithm") -@See("https://en.wikipedia.org/wiki/Breadth-first_search") -@Narrative(""" -Breadth First Search algorithm for finding the shortest paths between nodes in a graph -""") -class BreadthFirstSearchSpec extends Specification { - @Subject - def algorithm = new BreadthFirstSearch() - - def 'should find a route for simple graph'() { - given: 'A simple graph' - def graph = Graph.of([ - A: [B: 7, C: 2], - B: [A: 3, C: 5], - C: [A: 1, B: 3] - ]) - - when: 'we use Breadth First Search algorithm to find a path' - def path = algorithm.findPath(graph, source, target) - - then: 'we get the shortest path' - path == shortest - - and: 'the distance calculated correctly' - graph.getDistance(path) == time as double - - where: - source | target || time | shortest - 'A' | 'A' || 0 | ['A'] - 'A' | 'B' || 7 | ['A', 'B'] - 'B' | 'C' || 5 | ['B', 'C'] - 'C' | 'B' || 3 | ['C', 'B'] - } - - def 'should find a route for complex graph'() { - given: 'A complex graph' - def graph = Graph.of([ - A: [B: 1], - B: [A: 1, D: 1], - C: [A: 1], - D: [C: 1, E: 1], - E: [F: 1], - F: [D: 1, E: 1]]) - - when: 'we use Breadth First Search algorithm to find a path' - def path = algorithm.findPath(graph, source, target) - - then: 'we get the shortest path' - path == shortest - - and: 'the distance calculated correctly' - graph.getDistance(path) == time as double - - where: - source | target || shortest - 'A' | 'A' || ['A'] - 'B' | 'B' || ['B'] - 'A' | 'B' || ['A', 'B'] - 'B' | 'A' || ['B', 'A'] - 'A' | 'C' || ['A', 'B', 'D', 'C'] - 'C' | 'A' || ['C', 'A'] - 'E' | 'B' || ['E', 'F', 'D', 'C', 'A', 'B'] - - and: - time = shortest.size() - 1 - } - - def 'should thrown NPE path for an empty graph'() { - given: 'an empty graph' - def graph = Graph.of([:]) - - when: "we use Dijkstra's algorithm to find a path" - algorithm.findPath(graph, 'A', 'B') - - then: 'the exception was thrown' - thrown NullPointerException - } - - def "should return an empty path if can't find a route"() { - given: 'a simple graph with no edge between nodes' - def graph = Graph.of([A: [:], B: [:]]) - - when: 'we use Breadth First Search algorithm to find a path' - def path = algorithm.findPath(graph, 'A', 'B') - - then: 'we get an empty path' - path == [] - } -} diff --git a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy b/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy deleted file mode 100644 index 9ba35d4..0000000 --- a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy +++ /dev/null @@ -1,127 +0,0 @@ -package graph - -import lv.id.jc.algorithm.graph.DijkstrasAlgorithm -import lv.id.jc.algorithm.graph.Graph -import spock.lang.* - -@Title("Dijkstra's Algorithm") -@See("https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm") -@Narrative("Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph") -class DijkstrasAlgorithmSpec extends Specification { - @Subject - def algorithm = new DijkstrasAlgorithm() - - def 'should find a route for a simple graph'() { - given: 'A simple graph' - def graph = Graph.of([ - A: [B: 7, C: 2], - B: [A: 3, C: 5], - C: [A: 1, B: 3] - ]) - - when: "we use Dijkstra's algorithm to find a path" - def path = algorithm.findPath(graph, source, target) - - then: 'we get the fastest way' - path == fastest - - and: 'the distance calculated correctly' - graph.getDistance(path) == time as double - - where: - source | target || time | fastest - 'A' | 'A' || 0 | ['A'] - 'B' | 'B' || 0 | ['B'] - 'C' | 'C' || 0 | ['C'] - 'A' | 'B' || 5 | ['A', 'C', 'B'] - } - - def 'should find a route for a medium graph'() { - given: 'A medium graph' - def graph = Graph.of([ - A: [B: 5], - B: [A: 5, C: 10], - C: [B: 20, D: 5], - D: [E: 5], - E: [B: 5] - ]) - - when: "we use Dijkstra's algorithm to find a path" - def path = algorithm.findPath(graph, source, target) - - then: 'we get the fastest way' - path == fastest - - and: 'the distance calculated correctly' - graph.getDistance(path) == time as double - - where: - source | target || time | fastest - 'A' | 'A' || 0 | ['A'] - 'B' | 'B' || 0 | ['B'] - 'A' | 'B' || 5 | ['A', 'B'] - 'B' | 'A' || 5 | ['B', 'A'] - 'A' | 'C' || 15 | ['A', 'B', 'C'] - 'C' | 'A' || 20 | ['C', 'D', 'E', 'B', 'A'] - } - - def 'should find a route for a complex graph'() { - given: 'A complex graph' - def graph = Graph.of([ - A: [B: 5, H: 2], - B: [A: 5, C: 7], - C: [B: 7, D: 3, G: 4], - D: [C: 20, E: 4], - E: [F: 5], - F: [G: 6], - G: [C: 4], - H: [G: 3] - ]) - - when: "we use Dijkstra's algorithm to find a path" - def path = algorithm.findPath(graph, source, target) - - then: 'we get the fastest way' - path == fastest - - and: 'the distance calculated correctly' - graph.getDistance(path) == time as double - - where: - source | target || time | fastest - 'A' | 'A' || 0 | ['A'] - 'B' | 'B' || 0 | ['B'] - 'A' | 'B' || 5 | ['A', 'B'] - 'B' | 'A' || 5 | ['B', 'A'] - 'A' | 'C' || 9 | ['A', 'H', 'G', 'C'] - 'C' | 'A' || 12 | ['C', 'B', 'A'] - 'A' | 'G' || 5 | ['A', 'H', 'G'] - 'C' | 'D' || 3 | ['C', 'D'] - 'D' | 'C' || 19 | ['D', 'E', 'F', 'G', 'C'] - 'B' | 'D' || 10 | ['B', 'C', 'D'] - 'D' | 'B' || 26 | ['D', 'E', 'F', 'G', 'C', 'B'] - 'D' | 'H' || 33 | ['D', 'E', 'F', 'G', 'C', 'B', 'A', 'H'] - } - - def 'should thrown NPE for an empty graph'() { - given: 'an empty graph' - def graph = Graph.of([:]) - - when: "we use Dijkstra's algorithm to find a path" - algorithm.findPath(graph, 'A', 'B') - - then: 'the exception was thrown' - thrown NullPointerException - } - - def "should return an empty path if can't find a route"() { - given: 'a simple graph with no edge between nodes' - def graph = Graph.of([A: [:], B: [:]]) - - when: "we use Dijkstra's algorithm to find a path" - def path = algorithm.findPath(graph, 'A', 'B') - - then: 'we get an empty path' - path == [] - } -} diff --git a/src/test/groovy/graph/GraphSpec.groovy b/src/test/groovy/graph/GraphSpec.groovy deleted file mode 100644 index 7264018..0000000 --- a/src/test/groovy/graph/GraphSpec.groovy +++ /dev/null @@ -1,100 +0,0 @@ -package graph - -import lv.id.jc.algorithm.graph.Graph -import spock.lang.Narrative -import spock.lang.Specification -import spock.lang.Title - -@Title("Generic Graph") -@Narrative("A generic implementation of Graph structure") -class GraphSpec extends Specification { - - def "should return edges for a given node"() { - given: 'a simple graph with three nodes' - def graph = Graph.of([ - A: [B: 7, C: 2], - B: [A: 3, C: 5], - C: [A: 1, B: 3] - ]) - - expect: 'The method returns expected edges for given node' - graph.edges(node) == expected - - where: - node | expected - 'A' | [B: 7, C: 2] - 'B' | [A: 3, C: 5] - 'C' | [A: 1, B: 3] - } - - def 'should calculate distance for a path'() { - given: "a complex graph with eight nodes" - def graph = Graph.of([ - A: [B: 5, H: 2], - B: [A: 5, C: 7], - C: [B: 7, D: 3, G: 4], - D: [C: 20, E: 4], - E: [F: 5], - F: [G: 6], - G: [C: 4], - H: [G: 3] - ]) - - expect: 'the distance for a path correctly calculated' - graph.getDistance(path) == distance as double - - where: 'path and expected distance' - path | distance - ['A'] | 0 - ['A', 'B'] | 5 - ['B', 'A'] | 5 - ['A', 'B', 'A'] | 10 - ['A', 'B', 'A', 'B'] | 15 - ['C', 'D'] | 3 - ['D', 'C'] | 20 - ['D', 'E', 'F', 'G', 'C'] | 19 - } - - def 'should be zero distance for an empty path'() { - given: 'any graph' - def graph = Graph.of(_ as Map) - - expect: 'the distance is zero for an empty path' - graph.getDistance([]) == 0 - } - - def 'should be zero distance for any one node path'() { - given: 'any graph' - def graph = Graph.of(_ as Map) - - expect: 'the zero distance for any one-node path' - graph.getDistance(oneNodePath) == 0 - - where: 'the node may be of any type and even non-existent' - oneNodePath << [ - ['A'], ['B'], [2], ['X' as char], [12.56] - ] - } - - def 'should throw NPE for incorrect path'() { - given: "a medium graph with five nodes" - def graph = Graph.of([ - A: [B: 5], - B: [A: 5, C: 10], - C: [B: 20, D: 5], - D: [E: 5], - E: [B: 5] - ]) - - when: 'we call the method with incorrect path' - graph.getDistance(incorrectPath) - - then: 'the NPE thrown' - thrown NullPointerException - - where: 'path is more then one node' - incorrectPath << [ - ['E', 'D'], ['A', 'C'], ['A', 'B', 'D'] - ] - } -} \ No newline at end of file diff --git a/src/test/groovy/graph/SearchAlgorithmSpec.groovy b/src/test/groovy/graph/SearchAlgorithmSpec.groovy deleted file mode 100644 index 337841f..0000000 --- a/src/test/groovy/graph/SearchAlgorithmSpec.groovy +++ /dev/null @@ -1,63 +0,0 @@ -package graph - -import lv.id.jc.algorithm.graph.BreadthFirstSearch -import lv.id.jc.algorithm.graph.DijkstrasAlgorithm -import lv.id.jc.algorithm.graph.Graph -import spock.lang.Specification -import spock.lang.Subject -import spock.lang.Title - -@Title("Comparison of two algorithms") -class SearchAlgorithmSpec extends Specification { - @Subject - def bfsAlgorithm = new BreadthFirstSearch() - - @Subject - def dijkstras = new DijkstrasAlgorithm() - - def 'should find a route for a complex graph'() { - given: 'A complex graph sample' - def graph = Graph.of([ - A: [B: 5, H: 2], - B: [A: 5, C: 7], - C: [B: 7, D: 3, G: 4], - D: [C: 20, E: 4], - E: [F: 5], - F: [G: 6], - G: [C: 4], - H: [G: 3] - ]) - - when: 'we use Breadth First Search algorithm for the first route' - def routeOne = bfsAlgorithm.findPath(graph, source, target) - - and: 'we use Dijkstras algorithm for the second route' - def routeTwo = dijkstras.findPath(graph, source, target) - - then: "the first route is the shortest" - routeOne == shortest - - and: 'the second route is the fastest' - routeTwo == fastest - - and: 'the distance calculated correctly' - graph.getDistance(routeOne) == d1 as double - graph.getDistance(routeTwo) == d2 as double - - where: - source | target || d1 | shortest | d2 | fastest - 'A' | 'A' || 0 | ['A'] | 0 | ['A'] - 'B' | 'B' || 0 | ['B'] | 0 | ['B'] - 'A' | 'B' || 5 | ['A', 'B'] | 5 | ['A', 'B'] - 'B' | 'A' || 5 | ['B', 'A'] | 5 | ['B', 'A'] - 'A' | 'C' || 12 | ['A', 'B', 'C'] | 9 | ['A', 'H', 'G', 'C'] - 'C' | 'A' || 12 | ['C', 'B', 'A'] | 12 | ['C', 'B', 'A'] - 'A' | 'G' || 5 | ['A', 'H', 'G'] | 5 | ['A', 'H', 'G'] - 'C' | 'D' || 3 | ['C', 'D'] | 3 | ['C', 'D'] - 'D' | 'C' || 20 | ['D', 'C'] | 19 | ['D', 'E', 'F', 'G', 'C'] - 'B' | 'D' || 10 | ['B', 'C', 'D'] | 10 | ['B', 'C', 'D'] - 'D' | 'B' || 27 | ['D', 'C', 'B'] | 26 | ['D', 'E', 'F', 'G', 'C', 'B'] - 'D' | 'H' || 34 | ['D', 'C', 'B', 'A', 'H'] | 33 | ['D', 'E', 'F', 'G', 'C', 'B', 'A', 'H'] - } - -} diff --git a/src/test/resources/SpockConfig.groovy b/src/test/resources/SpockConfig.groovy deleted file mode 100644 index 55671ba..0000000 --- a/src/test/resources/SpockConfig.groovy +++ /dev/null @@ -1,12 +0,0 @@ -spockReports { - - set(['com.athaydes.spockframework.report.showCodeBlocks' : true, - 'com.athaydes.spockframework.report.outputDir' : 'docs/spock-reports', - 'com.athaydes.spockframework.report.projectName' : 'Graph search algorithms', - 'com.athaydes.spockframework.report.projectVersion' : 1.1, - 'com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled': true, - 'com.athaydes.spockframework.report.IReportCreator' : 'com.athaydes.spockframework.report.internal.HtmlReportCreator' - ]) - // com.athaydes.spockframework.report.template.TemplateReportCreator - // com.athaydes.spockframework.report.internal.HtmlReportCreator -} \ No newline at end of file From fe73858eda7b5ae2e31ed3c204c9fb4d3230447c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 5 Jan 2022 22:07:01 +0200 Subject: [PATCH 064/118] Update _config.yml --- docs/_config.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 2f7efbe..d6fcfde 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1,12 @@ -theme: jekyll-theme-minimal \ No newline at end of file +theme: jekyll-theme-minimal + +title: Search Algorithms +author: Jegors Čemisovs +email: jegors.cemisovs@outlook.lv +description: > # this means to ignore newlines until "baseurl:" + This repository contains an implementation of two graphs search algorithms. +# social links +twitter_username: rabestro # DO NOT include the @ character, or else the build will fail! +github_username: rabestro # DO NOT include the @ character, or else the build will fail! + +show_excerpts: true # set to false to remove excerpts on the homepage From e7c853ca6232258c41900fa0a9fcdfc7c6703f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 5 Jan 2022 22:32:16 +0200 Subject: [PATCH 065/118] Update _config.yml --- docs/_config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index d6fcfde..112b89d 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,10 +1,10 @@ theme: jekyll-theme-minimal - -title: Search Algorithms +title: Algorithms author: Jegors Čemisovs email: jegors.cemisovs@outlook.lv description: > # this means to ignore newlines until "baseurl:" - This repository contains an implementation of two graphs search algorithms. + Graph pathfinding algorithms. + # social links twitter_username: rabestro # DO NOT include the @ character, or else the build will fail! github_username: rabestro # DO NOT include the @ character, or else the build will fail! From 16cd028606ef6daf3b211e8bbc5611f445b67b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 6 Jan 2022 11:12:07 +0200 Subject: [PATCH 066/118] Create CODEOWNERS --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..1c48460 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @rabestro From 2e988b6b853fdb1dab17eb189269d4a980e8f99d Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Thu, 6 Jan 2022 18:57:20 +0200 Subject: [PATCH 067/118] Fixed gradle files --- .idea/gradle.xml | 2 +- algorithm/build.gradle | 1 - algorithm/src/main/java/module-info.java | 5 --- application/build.gradle | 13 ++++++++ .../java/lv/id/jc/application}/GraphApp.java | 27 +++++++--------- application/src/main/java/module-info.java | 4 +++ build.gradle | 3 -- sample/build.gradle | 31 ------------------- settings.gradle | 6 ++-- 9 files changed, 31 insertions(+), 61 deletions(-) create mode 100644 application/build.gradle rename {sample/src/main/java/lv/id/jc/sample => application/src/main/java/lv/id/jc/application}/GraphApp.java (63%) create mode 100644 application/src/main/java/module-info.java delete mode 100644 build.gradle delete mode 100644 sample/build.gradle diff --git a/.idea/gradle.xml b/.idea/gradle.xml index dc522cc..7e20a16 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,7 +12,7 @@ diff --git a/algorithm/build.gradle b/algorithm/build.gradle index 4e6f088..828691e 100644 --- a/algorithm/build.gradle +++ b/algorithm/build.gradle @@ -3,7 +3,6 @@ plugins { id 'java-library' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_17 group 'lv.id.jc' version '1.1' diff --git a/algorithm/src/main/java/module-info.java b/algorithm/src/main/java/module-info.java index 941d8df..8a8fdf6 100644 --- a/algorithm/src/main/java/module-info.java +++ b/algorithm/src/main/java/module-info.java @@ -1,8 +1,3 @@ -/** - * The module contains an interface for a graph and an interface for a graph search algorithm. - * There is an implementation of two search algorithms: - * Dijkstra's algorithm and Breadth First Search algorithm. - */ module lv.id.jc.algorithm.graph { exports lv.id.jc.algorithm.graph; } \ No newline at end of file diff --git a/application/build.gradle b/application/build.gradle new file mode 100644 index 0000000..7d38e08 --- /dev/null +++ b/application/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'application' +} + +dependencies { + implementation project(':algorithm') +} + +application { + mainModule = 'lv.id.jc.application' + mainClass = 'lv.id.jc.application.GraphApp' + applicationDefaultJvmArgs = ['-Dgreeting.language=en'] +} diff --git a/sample/src/main/java/lv/id/jc/sample/GraphApp.java b/application/src/main/java/lv/id/jc/application/GraphApp.java similarity index 63% rename from sample/src/main/java/lv/id/jc/sample/GraphApp.java rename to application/src/main/java/lv/id/jc/application/GraphApp.java index 8b6956f..a6c90b3 100644 --- a/sample/src/main/java/lv/id/jc/sample/GraphApp.java +++ b/application/src/main/java/lv/id/jc/application/GraphApp.java @@ -1,4 +1,4 @@ -package lv.id.jc.sample; +package lv.id.jc.application; import lv.id.jc.algorithm.graph.BreadthFirstSearch; import lv.id.jc.algorithm.graph.DijkstrasAlgorithm; @@ -7,10 +7,8 @@ import java.util.Map; -import static java.lang.System.*; - public class GraphApp { - private static final Graph COMPLEX_GRAPH = Graph.of(Map.of( + private static final Graph graph = Graph.of(Map.of( 'A', Map.of('B', 5, 'H', 2), 'B', Map.of('A', 5, 'C', 7), 'C', Map.of('B', 7, 'D', 3, 'G', 4), @@ -24,19 +22,16 @@ public class GraphApp { private static final SearchAlgorithm shortest = new BreadthFirstSearch<>(); public static void main(String[] args) { - out.println(COMPLEX_GRAPH); - - printRoute(COMPLEX_GRAPH, 'D', 'C'); - printRoute(COMPLEX_GRAPH, 'A', 'G'); - printRoute(COMPLEX_GRAPH, 'D', 'H'); + printRoute('D', 'C'); + printRoute('A', 'G'); + printRoute('D', 'H'); } - private static void printRoute(final Graph graph, - final Character source, - final Character target) { - final var routeOne = shortest.findPath(graph, source, target); - final var routeTwo = fastest.findPath(graph, source, target); - final var message = """ + @SuppressWarnings("squid:S106") + private static void printRoute(Character source, Character target) { + var routeOne = shortest.findPath(graph, source, target); + var routeTwo = fastest.findPath(graph, source, target); + var message = """ Find the path from %s to %s - the shortest take %.0f min and the path is %s @@ -46,6 +41,6 @@ private static void printRoute(final Graph graph, graph.getDistance(routeOne), routeOne, graph.getDistance(routeTwo), routeTwo); - out.println(message); + System.out.println(message); } } diff --git a/application/src/main/java/module-info.java b/application/src/main/java/module-info.java new file mode 100644 index 0000000..1ffe06e --- /dev/null +++ b/application/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module lv.id.jc.application { + requires lv.id.jc.algorithm.graph; + exports lv.id.jc.application; +} \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index b4ff6b1..0000000 --- a/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -group 'lv.id.jc' -version '1.1' - diff --git a/sample/build.gradle b/sample/build.gradle deleted file mode 100644 index 44bec47..0000000 --- a/sample/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -plugins { - id 'groovy' - id 'java' -} - -group 'lv.id.jc' -version '1.1' - -sourceCompatibility = JavaVersion.VERSION_17 - -repositories { - mavenCentral() - - maven { - // Choose whatever name you like - name = "Algorithms" - // The url of the repository that contains the published artifacts - url = "https://maven.pkg.github.com/rabestro/algorithms" - credentials { - // The credentials (described in the next section) - username = project.findProperty("gpr.user") - password = project.findProperty("gpr.key") - } - } -} - -dependencies { - implementation 'org.codehaus.groovy:groovy-all:3.0.9' - - compileOnly 'lv.id.jc:algorithm:1.1' -} diff --git a/settings.gradle b/settings.gradle index 710d931..b469ed7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,2 @@ -rootProject.name = 'algorithms' -include 'algorithm' -include 'sample' - +rootProject.name = 'graphs-algorithms' +include 'algorithm', 'application' From ea5a251b188f4d37dae4e1cb760b337377c2ff70 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Thu, 6 Jan 2022 19:02:24 +0200 Subject: [PATCH 068/118] Fixed issue #13 --- .../java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java | 7 ++++--- .../java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java | 5 +++-- algorithm/src/main/java/module-info.java | 5 +++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java index 6c6cfa2..b7e927d 100644 --- a/algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java @@ -1,5 +1,6 @@ package lv.id.jc.algorithm.graph; +import java.util.ArrayDeque; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; @@ -11,18 +12,18 @@ /** * Algorithm for finding the shortest paths between nodes in a graph. - * + *

                              * The algorithm doesn't take into account the distance between nodes. * - * @author Jegors Čemisovs * @param the type of vertex + * @author Jegors Čemisovs * @since 1.0 */ public class BreadthFirstSearch implements SearchAlgorithm { @Override public List findPath(Graph graph, T source, T target) { - var queue = new LinkedList(); + var queue = new ArrayDeque(); var visited = new HashSet(); var previous = new HashMap(); queue.add(source); diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java index c6769c7..41f7817 100644 --- a/algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java @@ -1,5 +1,6 @@ package lv.id.jc.algorithm.graph; +import java.util.ArrayDeque; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -12,15 +13,15 @@ *

                              * The algorithm uses information about edge's distance to find the fastest path. * - * @author Jegors Čemisovs * @param the type of vertex + * @author Jegors Čemisovs * @since 1.0 */ public class DijkstrasAlgorithm implements SearchAlgorithm { @Override public List findPath(Graph graph, T source, T target) { - var queue = new LinkedList(); + var queue = new ArrayDeque(); var distances = new HashMap(); var previous = new HashMap(); queue.add(source); diff --git a/algorithm/src/main/java/module-info.java b/algorithm/src/main/java/module-info.java index 8a8fdf6..941d8df 100644 --- a/algorithm/src/main/java/module-info.java +++ b/algorithm/src/main/java/module-info.java @@ -1,3 +1,8 @@ +/** + * The module contains an interface for a graph and an interface for a graph search algorithm. + * There is an implementation of two search algorithms: + * Dijkstra's algorithm and Breadth First Search algorithm. + */ module lv.id.jc.algorithm.graph { exports lv.id.jc.algorithm.graph; } \ No newline at end of file From f1e39cc64dd81fce77c4cf6cfcb2ce114d529e1c Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Thu, 6 Jan 2022 22:18:46 +0200 Subject: [PATCH 069/118] Added gradle bat file --- algorithm/build.gradle | 4 +- application/build.gradle | 4 + gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 234 +++++++++++++++++++++++ gradlew.bat | 89 +++++++++ 5 files changed, 330 insertions(+), 3 deletions(-) create mode 100644 gradlew create mode 100644 gradlew.bat diff --git a/algorithm/build.gradle b/algorithm/build.gradle index 828691e..af89ce1 100644 --- a/algorithm/build.gradle +++ b/algorithm/build.gradle @@ -1,11 +1,11 @@ plugins { - id 'groovy' +// id 'groovy' id 'java-library' id 'maven-publish' } group 'lv.id.jc' -version '1.1' +version '1.1-SNAPSHOT' repositories { mavenCentral() diff --git a/application/build.gradle b/application/build.gradle index 7d38e08..7201dcf 100644 --- a/application/build.gradle +++ b/application/build.gradle @@ -2,6 +2,10 @@ plugins { id 'application' } +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + dependencies { implementation project(':algorithm') } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a2..2e6e589 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..c53aefa --- /dev/null +++ b/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions $var, ${var}, ${var:-default}, ${var+SET}, +# ${var#prefix}, ${var%suffix}, and $( cmd ); +# * compound commands having a testable exit status, especially case; +# * various built-in commands including command, set, and ulimit. +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega From 7293280ef5ff9a9462ffa5529218d77a3e83e076 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Thu, 6 Jan 2022 23:08:08 +0200 Subject: [PATCH 070/118] Add sample Groovy application --- .idea/gradle.xml | 3 +- algorithm/build.gradle | 2 +- .../java/lv/id/jc/algorithm/graph/Graph.java | 30 ++++++------- .../jc/algorithm/graph/SearchAlgorithm.java | 4 +- .../graph => }/BreadthFirstSearchSpec.groovy | 28 ++++++------ .../graph => }/DijkstrasAlgorithmSpec.groovy | 36 ++++++++-------- .../{lv/id/jc/graph => }/GraphSpec.groovy | 2 - .../jc/graph => }/SearchAlgorithmSpec.groovy | 14 +++--- application/src/main/java/module-info.java | 4 -- sample-groovy/build.gradle | 17 ++++++++ .../main/groovy/lv/id/jc/sample/Sample.groovy | 43 +++++++++++++++++++ {application => sample-java}/build.gradle | 5 +-- .../main/java/lv/id/jc/sample}/GraphApp.java | 2 +- sample-java/src/main/java/module-info.java | 4 ++ settings.gradle | 4 +- 15 files changed, 125 insertions(+), 73 deletions(-) rename algorithm/src/test/groovy/{lv/id/jc/graph => }/BreadthFirstSearchSpec.groovy (77%) rename algorithm/src/test/groovy/{lv/id/jc/graph => }/DijkstrasAlgorithmSpec.groovy (80%) rename algorithm/src/test/groovy/{lv/id/jc/graph => }/GraphSpec.groovy (99%) rename algorithm/src/test/groovy/{lv/id/jc/graph => }/SearchAlgorithmSpec.groovy (86%) delete mode 100644 application/src/main/java/module-info.java create mode 100644 sample-groovy/build.gradle create mode 100644 sample-groovy/src/main/groovy/lv/id/jc/sample/Sample.groovy rename {application => sample-java}/build.gradle (53%) rename {application/src/main/java/lv/id/jc/application => sample-java/src/main/java/lv/id/jc/sample}/GraphApp.java (98%) create mode 100644 sample-java/src/main/java/module-info.java diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 7e20a16..2f05086 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,7 +12,8 @@ diff --git a/algorithm/build.gradle b/algorithm/build.gradle index af89ce1..fef3784 100644 --- a/algorithm/build.gradle +++ b/algorithm/build.gradle @@ -1,5 +1,5 @@ plugins { -// id 'groovy' + id 'groovy' id 'java-library' id 'maven-publish' } diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java index 6ed2e9c..2b4de63 100644 --- a/algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/Graph.java @@ -14,8 +14,22 @@ @FunctionalInterface public interface Graph { /** - * The schema of this graph. + * Creates a Graph object by given schema. + *

                              + * In a graph schema, each vertex is assigned an edge map. + * If the vertex has no edges, then it should be assigned an empty map. * + * @param schema of the graph + * @param the type of vertex in this graph + * @return graph object with given schema + */ + static Graph of(Map> schema) { + return () -> schema; + } + + /** + * The schema of this graph. + *

                              * In a graph schema, each vertex is assigned an edge map. * If the vertex has no edges, then it should be assigned an empty map. * @@ -54,18 +68,4 @@ default double getDistance(List path) { .mapToDouble(Number::doubleValue) .sum(); } - - /** - * Creates a Graph object by given schema. - * - * In a graph schema, each vertex is assigned an edge map. - * If the vertex has no edges, then it should be assigned an empty map. - * - * @param schema of the graph - * @param the type of vertex in this graph - * @return graph object with given schema - */ - static Graph of(Map> schema) { - return () -> schema; - } } diff --git a/algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java index 79692d7..cf8f54f 100644 --- a/algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java +++ b/algorithm/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java @@ -5,8 +5,8 @@ /** * A functional interface for graph search algorithm * - * @author Jegors Čemisovs * @param the type of vertex + * @author Jegors Čemisovs * @since 1.0 */ @FunctionalInterface @@ -14,7 +14,7 @@ public interface SearchAlgorithm { /** * Find the path from the source node to the target * - * @param graph The graph in which we search for the path + * @param graph The graph in which we search for the path * @param source Search starting point identifier * @param target Search finish point identifier * @return Path found or empty list if path cannot be found diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy b/algorithm/src/test/groovy/BreadthFirstSearchSpec.groovy similarity index 77% rename from algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy rename to algorithm/src/test/groovy/BreadthFirstSearchSpec.groovy index 7feffbd..85a62a1 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy +++ b/algorithm/src/test/groovy/BreadthFirstSearchSpec.groovy @@ -1,5 +1,3 @@ -package lv.id.jc.graph - import lv.id.jc.algorithm.graph.BreadthFirstSearch import lv.id.jc.algorithm.graph.Graph import spock.lang.* @@ -14,20 +12,20 @@ class BreadthFirstSearchSpec extends Specification { def algorithm = new BreadthFirstSearch() def 'should find a route for simple graph'() { - given: 'A simple graph' + given: def graph = Graph.of([ A: [B: 7, C: 2], B: [A: 3, C: 5], C: [A: 1, B: 3] ]) - when: 'we use Breadth First Search algorithm to find a path' + when: def path = algorithm.findPath(graph, source, target) - then: 'we get the shortest path' + then: path == shortest - and: 'the distance calculated correctly' + and: graph.getDistance(path) == time as double where: @@ -39,7 +37,7 @@ class BreadthFirstSearchSpec extends Specification { } def 'should find a route for complex graph'() { - given: 'A complex graph' + given: def graph = Graph.of([ A: [B: 1], B: [A: 1, D: 1], @@ -48,13 +46,13 @@ class BreadthFirstSearchSpec extends Specification { E: [F: 1], F: [D: 1, E: 1]]) - when: 'we use Breadth First Search algorithm to find a path' + when: def path = algorithm.findPath(graph, source, target) - then: 'we get the shortest path' + then: path == shortest - and: 'the distance calculated correctly' + and: graph.getDistance(path) == time as double where: @@ -72,13 +70,13 @@ class BreadthFirstSearchSpec extends Specification { } def 'should thrown NPE path for an empty graph'() { - given: 'an empty graph' + given: def graph = Graph.of([:]) - when: "we use Dijkstra's algorithm to find a path" + when: algorithm.findPath(graph, 'A', 'B') - then: 'the exception was thrown' + then: thrown NullPointerException } @@ -86,10 +84,10 @@ class BreadthFirstSearchSpec extends Specification { given: 'a simple graph with no edge between nodes' def graph = Graph.of([A: [:], B: [:]]) - when: 'we use Breadth First Search algorithm to find a path' + when: def path = algorithm.findPath(graph, 'A', 'B') - then: 'we get an empty path' + then: path == [] } } diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy b/algorithm/src/test/groovy/DijkstrasAlgorithmSpec.groovy similarity index 80% rename from algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy rename to algorithm/src/test/groovy/DijkstrasAlgorithmSpec.groovy index db283c6..2698816 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/DijkstrasAlgorithmSpec.groovy @@ -1,5 +1,3 @@ -package lv.id.jc.graph - import lv.id.jc.algorithm.graph.DijkstrasAlgorithm import lv.id.jc.algorithm.graph.Graph import spock.lang.* @@ -12,20 +10,20 @@ class DijkstrasAlgorithmSpec extends Specification { def algorithm = new DijkstrasAlgorithm() def 'should find a route for a simple graph'() { - given: 'A simple graph' + given: def graph = Graph.of([ A: [B: 7, C: 2], B: [A: 3, C: 5], C: [A: 1, B: 3] ]) - when: "we use Dijkstra's algorithm to find a path" + when: def path = algorithm.findPath(graph, source, target) - then: 'we get the fastest way' + then: path == fastest - and: 'the distance calculated correctly' + and: graph.getDistance(path) == time as double where: @@ -37,7 +35,7 @@ class DijkstrasAlgorithmSpec extends Specification { } def 'should find a route for a medium graph'() { - given: 'A medium graph' + given: def graph = Graph.of([ A: [B: 5], B: [A: 5, C: 10], @@ -46,13 +44,13 @@ class DijkstrasAlgorithmSpec extends Specification { E: [B: 5] ]) - when: "we use Dijkstra's algorithm to find a path" + when: def path = algorithm.findPath(graph, source, target) - then: 'we get the fastest way' + then: path == fastest - and: 'the distance calculated correctly' + and: graph.getDistance(path) == time as double where: @@ -66,7 +64,7 @@ class DijkstrasAlgorithmSpec extends Specification { } def 'should find a route for a complex graph'() { - given: 'A complex graph' + given: def graph = Graph.of([ A: [B: 5, H: 2], B: [A: 5, C: 7], @@ -78,13 +76,13 @@ class DijkstrasAlgorithmSpec extends Specification { H: [G: 3] ]) - when: "we use Dijkstra's algorithm to find a path" + when: def path = algorithm.findPath(graph, source, target) - then: 'we get the fastest way' + then: path == fastest - and: 'the distance calculated correctly' + and: graph.getDistance(path) == time as double where: @@ -104,13 +102,13 @@ class DijkstrasAlgorithmSpec extends Specification { } def 'should thrown NPE for an empty graph'() { - given: 'an empty graph' + given: def graph = Graph.of([:]) - when: "we use Dijkstra's algorithm to find a path" + when: algorithm.findPath(graph, 'A', 'B') - then: 'the exception was thrown' + then: thrown NullPointerException } @@ -118,10 +116,10 @@ class DijkstrasAlgorithmSpec extends Specification { given: 'a simple graph with no edge between nodes' def graph = Graph.of([A: [:], B: [:]]) - when: "we use Dijkstra's algorithm to find a path" + when: def path = algorithm.findPath(graph, 'A', 'B') - then: 'we get an empty path' + then: path == [] } } diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy b/algorithm/src/test/groovy/GraphSpec.groovy similarity index 99% rename from algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy rename to algorithm/src/test/groovy/GraphSpec.groovy index 5d87b77..d0aed78 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy +++ b/algorithm/src/test/groovy/GraphSpec.groovy @@ -1,5 +1,3 @@ -package lv.id.jc.graph - import lv.id.jc.algorithm.graph.Graph import spock.lang.Narrative import spock.lang.Specification diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy b/algorithm/src/test/groovy/SearchAlgorithmSpec.groovy similarity index 86% rename from algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy rename to algorithm/src/test/groovy/SearchAlgorithmSpec.groovy index e3b51a2..fc421f9 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/SearchAlgorithmSpec.groovy @@ -1,5 +1,3 @@ -package lv.id.jc.graph - import lv.id.jc.algorithm.graph.BreadthFirstSearch import lv.id.jc.algorithm.graph.DijkstrasAlgorithm import lv.id.jc.algorithm.graph.Graph @@ -16,7 +14,7 @@ class SearchAlgorithmSpec extends Specification { def dijkstras = new DijkstrasAlgorithm() def 'should find a route for a complex graph'() { - given: 'A complex graph sample' + given: def graph = Graph.of([ A: [B: 5, H: 2], B: [A: 5, C: 7], @@ -28,19 +26,19 @@ class SearchAlgorithmSpec extends Specification { H: [G: 3] ]) - when: 'we use Breadth First Search algorithm for the first route' + when: def routeOne = bfsAlgorithm.findPath(graph, source, target) - and: 'we use Dijkstras algorithm for the second route' + and: def routeTwo = dijkstras.findPath(graph, source, target) - then: "the first route is the shortest" + then: routeOne == shortest - and: 'the second route is the fastest' + and: routeTwo == fastest - and: 'the distance calculated correctly' + and: graph.getDistance(routeOne) == d1 as double graph.getDistance(routeTwo) == d2 as double diff --git a/application/src/main/java/module-info.java b/application/src/main/java/module-info.java deleted file mode 100644 index 1ffe06e..0000000 --- a/application/src/main/java/module-info.java +++ /dev/null @@ -1,4 +0,0 @@ -module lv.id.jc.application { - requires lv.id.jc.algorithm.graph; - exports lv.id.jc.application; -} \ No newline at end of file diff --git a/sample-groovy/build.gradle b/sample-groovy/build.gradle new file mode 100644 index 0000000..a95ad88 --- /dev/null +++ b/sample-groovy/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'groovy' +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + +repositories { + mavenCentral() +} + +dependencies { + implementation 'org.codehaus.groovy:groovy-all:3.0.8' + implementation project(':algorithm') +} + diff --git a/sample-groovy/src/main/groovy/lv/id/jc/sample/Sample.groovy b/sample-groovy/src/main/groovy/lv/id/jc/sample/Sample.groovy new file mode 100644 index 0000000..2c4a058 --- /dev/null +++ b/sample-groovy/src/main/groovy/lv/id/jc/sample/Sample.groovy @@ -0,0 +1,43 @@ +package lv.id.jc.sample + +import lv.id.jc.algorithm.graph.BreadthFirstSearch +import lv.id.jc.algorithm.graph.DijkstrasAlgorithm +import lv.id.jc.algorithm.graph.Graph + +def complexGraph = Graph.of([ + A: [B: 5, H: 2], + B: [A: 5, C: 7], + C: [B: 7, D: 3, G: 4], + D: [C: 20, E: 4], + E: [F: 5], + F: [G: 6], + G: [C: 4], + H: [G: 3] +]) + +def app = new SampleApp(complexGraph) + +app.printRoute('D', 'C'); +app.printRoute('A', 'G'); +app.printRoute('D', 'H'); + +class SampleApp { + final fastest = new DijkstrasAlgorithm(); + final shortest = new BreadthFirstSearch(); + final graph + + SampleApp(graph) { + this.graph = graph + } + + def printRoute(source, target) { + var routeOne = shortest.findPath(graph, source, target); + var routeTwo = fastest.findPath(graph, source, target); + + println """Find the path from $source to $target + - the shortest take ${graph.getDistance(routeOne)} min and the path is ${routeOne} + - the fastest take ${graph.getDistance(routeTwo)} min and the path is ${routeTwo} + """ + } + +} diff --git a/application/build.gradle b/sample-java/build.gradle similarity index 53% rename from application/build.gradle rename to sample-java/build.gradle index 7201dcf..7a1e561 100644 --- a/application/build.gradle +++ b/sample-java/build.gradle @@ -11,7 +11,6 @@ dependencies { } application { - mainModule = 'lv.id.jc.application' - mainClass = 'lv.id.jc.application.GraphApp' - applicationDefaultJvmArgs = ['-Dgreeting.language=en'] + mainModule = 'lv.id.jc.sample' + mainClass = 'lv.id.jc.sample.GraphApp' } diff --git a/application/src/main/java/lv/id/jc/application/GraphApp.java b/sample-java/src/main/java/lv/id/jc/sample/GraphApp.java similarity index 98% rename from application/src/main/java/lv/id/jc/application/GraphApp.java rename to sample-java/src/main/java/lv/id/jc/sample/GraphApp.java index a6c90b3..f0fbd40 100644 --- a/application/src/main/java/lv/id/jc/application/GraphApp.java +++ b/sample-java/src/main/java/lv/id/jc/sample/GraphApp.java @@ -1,4 +1,4 @@ -package lv.id.jc.application; +package lv.id.jc.sample; import lv.id.jc.algorithm.graph.BreadthFirstSearch; import lv.id.jc.algorithm.graph.DijkstrasAlgorithm; diff --git a/sample-java/src/main/java/module-info.java b/sample-java/src/main/java/module-info.java new file mode 100644 index 0000000..b69bc56 --- /dev/null +++ b/sample-java/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module lv.id.jc.sample { + requires lv.id.jc.algorithm.graph; + exports lv.id.jc.sample; +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index b469ed7..3c86329 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -rootProject.name = 'graphs-algorithms' -include 'algorithm', 'application' +rootProject.name = 'algorithms' +include 'algorithm', 'sample-java', 'sample-groovy' From eb5fd1f61d68fd9d29d4807a32747b9ac89addf5 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Thu, 6 Jan 2022 23:13:49 +0200 Subject: [PATCH 071/118] Updated documentation --- .../graph}/BreadthFirstSearchSpec.groovy | 2 + .../graph}/DijkstrasAlgorithmSpec.groovy | 2 + .../id/jc/algorithm/graph}/GraphSpec.groovy | 2 + .../graph}/SearchAlgorithmSpec.groovy | 2 + .../src/test/resources/SpockConfig.groovy | 2 +- docs/inspection/index.html | 2 +- docs/spock-reports/aggregated_report.json | 2 +- docs/spock-reports/index.html | 20 ++-- ...gorithm.graph.BreadthFirstSearchSpec.html} | 84 +------------- ...gorithm.graph.DijkstrasAlgorithmSpec.html} | 108 +----------------- ...> lv.id.jc.algorithm.graph.GraphSpec.html} | 6 +- ....algorithm.graph.SearchAlgorithmSpec.html} | 42 +------ docs/spock-reports/summary.md | 23 ---- 13 files changed, 33 insertions(+), 264 deletions(-) rename algorithm/src/test/groovy/{ => lv/id/jc/algorithm/graph}/BreadthFirstSearchSpec.groovy (98%) rename algorithm/src/test/groovy/{ => lv/id/jc/algorithm/graph}/DijkstrasAlgorithmSpec.groovy (99%) rename algorithm/src/test/groovy/{ => lv/id/jc/algorithm/graph}/GraphSpec.groovy (98%) rename algorithm/src/test/groovy/{ => lv/id/jc/algorithm/graph}/SearchAlgorithmSpec.groovy (98%) rename docs/spock-reports/{graph.BreadthFirstSearchSpec.html => lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html} (88%) rename docs/spock-reports/{graph.DijkstrasAlgorithmSpec.html => lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html} (89%) rename docs/spock-reports/{graph.GraphSpec.html => lv.id.jc.algorithm.graph.GraphSpec.html} (98%) rename docs/spock-reports/{graph.SearchAlgorithmSpec.html => lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html} (92%) delete mode 100644 docs/spock-reports/summary.md diff --git a/algorithm/src/test/groovy/BreadthFirstSearchSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/BreadthFirstSearchSpec.groovy similarity index 98% rename from algorithm/src/test/groovy/BreadthFirstSearchSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/BreadthFirstSearchSpec.groovy index 85a62a1..d1ddaa8 100644 --- a/algorithm/src/test/groovy/BreadthFirstSearchSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/BreadthFirstSearchSpec.groovy @@ -1,3 +1,5 @@ +package lv.id.jc.algorithm.graph + import lv.id.jc.algorithm.graph.BreadthFirstSearch import lv.id.jc.algorithm.graph.Graph import spock.lang.* diff --git a/algorithm/src/test/groovy/DijkstrasAlgorithmSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/DijkstrasAlgorithmSpec.groovy similarity index 99% rename from algorithm/src/test/groovy/DijkstrasAlgorithmSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/DijkstrasAlgorithmSpec.groovy index 2698816..ec6f6a1 100644 --- a/algorithm/src/test/groovy/DijkstrasAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/DijkstrasAlgorithmSpec.groovy @@ -1,3 +1,5 @@ +package lv.id.jc.algorithm.graph + import lv.id.jc.algorithm.graph.DijkstrasAlgorithm import lv.id.jc.algorithm.graph.Graph import spock.lang.* diff --git a/algorithm/src/test/groovy/GraphSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/GraphSpec.groovy similarity index 98% rename from algorithm/src/test/groovy/GraphSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/GraphSpec.groovy index d0aed78..9e2bdb9 100644 --- a/algorithm/src/test/groovy/GraphSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/GraphSpec.groovy @@ -1,3 +1,5 @@ +package lv.id.jc.algorithm.graph + import lv.id.jc.algorithm.graph.Graph import spock.lang.Narrative import spock.lang.Specification diff --git a/algorithm/src/test/groovy/SearchAlgorithmSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy similarity index 98% rename from algorithm/src/test/groovy/SearchAlgorithmSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy index fc421f9..d88ec0f 100644 --- a/algorithm/src/test/groovy/SearchAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy @@ -1,3 +1,5 @@ +package lv.id.jc.algorithm.graph + import lv.id.jc.algorithm.graph.BreadthFirstSearch import lv.id.jc.algorithm.graph.DijkstrasAlgorithm import lv.id.jc.algorithm.graph.Graph diff --git a/algorithm/src/test/resources/SpockConfig.groovy b/algorithm/src/test/resources/SpockConfig.groovy index 55671ba..db42b66 100644 --- a/algorithm/src/test/resources/SpockConfig.groovy +++ b/algorithm/src/test/resources/SpockConfig.groovy @@ -1,7 +1,7 @@ spockReports { set(['com.athaydes.spockframework.report.showCodeBlocks' : true, - 'com.athaydes.spockframework.report.outputDir' : 'docs/spock-reports', + 'com.athaydes.spockframework.report.outputDir' : '../docs/spock-reports', 'com.athaydes.spockframework.report.projectName' : 'Graph search algorithms', 'com.athaydes.spockframework.report.projectVersion' : 1.1, 'com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled': true, diff --git a/docs/inspection/index.html b/docs/inspection/index.html index f1d6f94..f6d64d7 100644 --- a/docs/inspection/index.html +++ b/docs/inspection/index.html @@ -1 +1 @@ -IntelliJ IDEA inspection report

                              IntelliJ IDEA inspection report:

                              Inspection tree:

                                                      1. Problem description:

                                                        Select a problem element in tree
                                                        \ No newline at end of file +IntelliJ IDEA inspection report

                                                        IntelliJ IDEA inspection report:

                                                        Inspection tree:

                                                                                1. Problem description:

                                                                                  Select a problem element in tree
                                                                                  \ No newline at end of file diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index 4672826..42b1f2e 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":71},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":45},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":11},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":54},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":47},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":53},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file +{"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":65},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":24},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":12},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index 2de51b9..de30a53 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

                                                                                  Specification run results

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  @@ -111,7 +111,7 @@

                                                                                  Specifications summary:

                                                                                  - +
                                                                                  0 0 100.0%0.158 seconds0.148 seconds
                                                                                  @@ -133,7 +133,7 @@

                                                                                  Specifications:

                                                                                  -graph.BreadthFirstSearchSpec +lv.id.jc.algorithm.graph.BreadthFirstSearchSpec
                                                                                  Breadth First Search Algorithm
                                                                                  4 @@ -142,11 +142,11 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.053 seconds +0.065 seconds -graph.DijkstrasAlgorithmSpec +lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec
                                                                                  Dijkstra's Algorithm
                                                                                  5 @@ -155,11 +155,11 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.037 seconds +0.024 seconds -graph.GraphSpec +lv.id.jc.algorithm.graph.GraphSpec
                                                                                  Generic Graph
                                                                                  5 @@ -168,11 +168,11 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.053 seconds +0.047 seconds -graph.SearchAlgorithmSpec +lv.id.jc.algorithm.graph.SearchAlgorithmSpec
                                                                                  Comparison of two algorithms
                                                                                  1 @@ -181,7 +181,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.015 seconds +0.012 seconds diff --git a/docs/spock-reports/graph.BreadthFirstSearchSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html similarity index 88% rename from docs/spock-reports/graph.BreadthFirstSearchSpec.html rename to docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html index 92935ec..fbaaff9 100644 --- a/docs/spock-reports/graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html @@ -244,14 +244,14 @@ -

                                                                                  Report for graph.BreadthFirstSearchSpec

                                                                                  +

                                                                                  Report for lv.id.jc.algorithm.graph.BreadthFirstSearchSpec


                                                                                  Summary:

                                                                                  -
                                                                                  Created on Tue Jan 04 19:56:48 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.053 seconds0.065 seconds
                                                                                  @@ -323,12 +323,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  A simple graph
                                                                                  - - - - -
                                                                                  def graph = Graph.of([
                                                                                           A: [B: 7, C: 2],
                                                                                           B: [A: 3, C: 5],
                                                                                  @@ -341,12 +335,6 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Breadth First Search algorithm to find a path
                                                                                  - - - - -
                                                                                  def path = algorithm.findPath(graph, source, target)
                                                                                  @@ -355,12 +343,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  we get the shortest path
                                                                                  - - - - -
                                                                                  path == shortest
                                                                                  @@ -369,12 +351,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  the distance calculated correctly
                                                                                  - - - - -
                                                                                  graph.getDistance(path) == time as double
                                                                                  @@ -445,12 +421,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  A complex graph
                                                                                  - - - - -
                                                                                  def graph = Graph.of([
                                                                                   A: [B: 1],
                                                                                   B: [A: 1, D: 1],
                                                                                  @@ -465,12 +435,6 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Breadth First Search algorithm to find a path
                                                                                  - - - - -
                                                                                  def path = algorithm.findPath(graph, source, target)
                                                                                  @@ -479,12 +443,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  we get the shortest path
                                                                                  - - - - -
                                                                                  path == shortest
                                                                                  @@ -493,12 +451,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  the distance calculated correctly
                                                                                  - - - - -
                                                                                  graph.getDistance(path) == time as double
                                                                                  @@ -598,12 +550,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  an empty graph
                                                                                  - - - - -
                                                                                  def graph = Graph.of([:])
                                                                                  @@ -612,12 +558,6 @@

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Dijkstra's algorithm to find a path
                                                                                  - - - - -
                                                                                  algorithm.findPath(graph, 'A', 'B')
                                                                                  @@ -626,12 +566,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  the exception was thrown
                                                                                  - - - - -
                                                                                  thrown NullPointerException
                                                                                  @@ -664,12 +598,6 @@

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Breadth First Search algorithm to find a path
                                                                                  - - - - -
                                                                                  def path = algorithm.findPath(graph, 'A', 'B')
                                                                                  @@ -678,12 +606,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  we get an empty path
                                                                                  - - - - -
                                                                                  path == []
                                                                                  diff --git a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html similarity index 89% rename from docs/spock-reports/graph.DijkstrasAlgorithmSpec.html rename to docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html index a697c9d..d55b480 100644 --- a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html @@ -244,14 +244,14 @@ -

                                                                                  Report for graph.DijkstrasAlgorithmSpec

                                                                                  +

                                                                                  Report for lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec


                                                                                  Summary:

                                                                                  -
                                                                                  Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.037 seconds0.024 seconds
                                                                                  @@ -326,12 +326,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  A simple graph
                                                                                  - - - - -
                                                                                  def graph = Graph.of([
                                                                                           A: [B: 7, C: 2],
                                                                                           B: [A: 3, C: 5],
                                                                                  @@ -344,12 +338,6 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Dijkstra's algorithm to find a path
                                                                                  - - - - -
                                                                                  def path = algorithm.findPath(graph, source, target)
                                                                                  @@ -358,12 +346,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  we get the fastest way
                                                                                  - - - - -
                                                                                  path == fastest
                                                                                  @@ -372,12 +354,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  the distance calculated correctly
                                                                                  - - - - -
                                                                                  graph.getDistance(path) == time as double
                                                                                  @@ -448,12 +424,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  A medium graph
                                                                                  - - - - -
                                                                                  def graph = Graph.of([
                                                                                           A: [B: 5],
                                                                                           B: [A: 5, C: 10],
                                                                                  @@ -468,12 +438,6 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Dijkstra's algorithm to find a path
                                                                                  - - - - -
                                                                                  def path = algorithm.findPath(graph, source, target)
                                                                                  @@ -482,12 +446,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  we get the fastest way
                                                                                  - - - - -
                                                                                  path == fastest
                                                                                  @@ -496,12 +454,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  the distance calculated correctly
                                                                                  - - - - -
                                                                                  graph.getDistance(path) == time as double
                                                                                  @@ -586,12 +538,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  A complex graph
                                                                                  - - - - -
                                                                                  def graph = Graph.of([
                                                                                           A: [B: 5, H: 2],
                                                                                           B: [A: 5, C: 7],
                                                                                  @@ -609,12 +555,6 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Dijkstra's algorithm to find a path
                                                                                  - - - - -
                                                                                  def path = algorithm.findPath(graph, source, target)
                                                                                  @@ -623,12 +563,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  we get the fastest way
                                                                                  - - - - -
                                                                                  path == fastest
                                                                                  @@ -637,12 +571,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  the distance calculated correctly
                                                                                  - - - - -
                                                                                  graph.getDistance(path) == time as double
                                                                                  @@ -769,12 +697,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  an empty graph
                                                                                  - - - - -
                                                                                  def graph = Graph.of([:])
                                                                                  @@ -783,12 +705,6 @@

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Dijkstra's algorithm to find a path
                                                                                  - - - - -
                                                                                  algorithm.findPath(graph, 'A', 'B')
                                                                                  @@ -797,12 +713,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  the exception was thrown
                                                                                  - - - - -
                                                                                  thrown NullPointerException
                                                                                  @@ -835,12 +745,6 @@

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Dijkstra's algorithm to find a path
                                                                                  - - - - -
                                                                                  def path = algorithm.findPath(graph, 'A', 'B')
                                                                                  @@ -849,12 +753,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  we get an empty path
                                                                                  - - - - -
                                                                                  path == []
                                                                                  diff --git a/docs/spock-reports/graph.GraphSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html similarity index 98% rename from docs/spock-reports/graph.GraphSpec.html rename to docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html index 9bd33e6..0105e4b 100644 --- a/docs/spock-reports/graph.GraphSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html @@ -244,14 +244,14 @@ -

                                                                                  Report for graph.GraphSpec

                                                                                  +

                                                                                  Report for lv.id.jc.algorithm.graph.GraphSpec


                                                                                  Summary:

                                                                                  -
                                                                                  Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.053 seconds0.047 seconds
                                                                                  diff --git a/docs/spock-reports/graph.SearchAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html similarity index 92% rename from docs/spock-reports/graph.SearchAlgorithmSpec.html rename to docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html index b3f1b1a..c36de8c 100644 --- a/docs/spock-reports/graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html @@ -244,14 +244,14 @@ -

                                                                                  Report for graph.SearchAlgorithmSpec

                                                                                  +

                                                                                  Report for lv.id.jc.algorithm.graph.SearchAlgorithmSpec


                                                                                  Summary:

                                                                                  -
                                                                                  Created on Tue Jan 04 19:56:49 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.015 seconds0.012 seconds
                                                                                  @@ -305,12 +305,6 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  A complex graph sample
                                                                                  - - - - -
                                                                                  def graph = Graph.of([
                                                                                           A: [B: 5, H: 2],
                                                                                           B: [A: 5, C: 7],
                                                                                  @@ -328,12 +322,6 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  we use Breadth First Search algorithm for the first route
                                                                                  - - - - -
                                                                                  def routeOne = bfsAlgorithm.findPath(graph, source, target)
                                                                                  @@ -342,12 +330,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  we use Dijkstras algorithm for the second route
                                                                                  - - - - -
                                                                                  def routeTwo = dijkstras.findPath(graph, source, target)
                                                                                  @@ -356,12 +338,6 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  the first route is the shortest
                                                                                  - - - - -
                                                                                  routeOne == shortest
                                                                                  @@ -370,12 +346,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  the second route is the fastest
                                                                                  - - - - -
                                                                                  routeTwo == fastest
                                                                                  @@ -384,12 +354,6 @@

                                                                                  Features:

                                                                                  And:
                                                                                  -
                                                                                  the distance calculated correctly
                                                                                  - - - - -
                                                                                  graph.getDistance(routeOne) == d1 as double
                                                                                   graph.getDistance(routeTwo) == d2 as double
                                                                                  diff --git a/docs/spock-reports/summary.md b/docs/spock-reports/summary.md deleted file mode 100644 index 12d9308..0000000 --- a/docs/spock-reports/summary.md +++ /dev/null @@ -1,23 +0,0 @@ -# Specification run results - -## Project: Graph search algorithms, Version: 1.1 - -## Specifications summary - -Created on Tue Jan 04 18:35:06 EET 2022 by jegors.cemisovs - -| Total | Passed | Failed | Feature failures | Feature errors | Success rate | Total time (ms) | -|----------------|-----------------|-----------------|------------------|------------------|---------------------|-----------------| -| 4 | 4 | 0 | 0 | 0 | 1.0| 138.0 | - -## Specifications - -|Name | Features | Failed | Errors | Skipped | Success rate | Time | -|------|----------|--------|--------|---------|--------------|------| -| graph.BreadthFirstSearchSpec | 4 | 0 | 0 | 0 | 1.0 | 54 | -| graph.SearchAlgorithmSpec | 1 | 0 | 0 | 0 | 1.0 | 15 | -| graph.DijkstrasAlgorithmSpec | 5 | 0 | 0 | 0 | 1.0 | 16 | -| graph.GraphSpec | 5 | 0 | 0 | 0 | 1.0 | 53 | - - -Generated by Athaydes Spock Reports \ No newline at end of file From abcf26b9383ad31871f018a1150205aca45dda50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 10 Jan 2022 19:49:24 +0200 Subject: [PATCH 072/118] Added templates --- .github/ISSUE_TEMPLATE/bug-issue.md | 46 +++++++ .github/ISSUE_TEMPLATE/feature-request.md | 23 ++++ .idea/gradle.xml | 1 + .idea/misc.xml | 2 +- .../graph/BreadthFirstSearchSpec.groovy | 2 - .../graph/DijkstrasAlgorithmSpec.groovy | 2 - .../lv/id/jc/algorithm/graph/GraphSpec.groovy | 1 - .../graph/SearchAlgorithmSpec.groovy | 15 +-- .../graph/DijkstrasAlgorithmTest.java | 113 ++++++++++++++++++ docs/spock-reports/aggregated_report.json | 2 +- docs/spock-reports/index.html | 12 +- ...lgorithm.graph.BreadthFirstSearchSpec.html | 4 +- ...lgorithm.graph.DijkstrasAlgorithmSpec.html | 4 +- .../lv.id.jc.algorithm.graph.GraphSpec.html | 4 +- ...c.algorithm.graph.SearchAlgorithmSpec.html | 40 ++++++- 15 files changed, 241 insertions(+), 30 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug-issue.md create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md create mode 100644 algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java diff --git a/.github/ISSUE_TEMPLATE/bug-issue.md b/.github/ISSUE_TEMPLATE/bug-issue.md new file mode 100644 index 0000000..ab645cc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-issue.md @@ -0,0 +1,46 @@ +--- +name: Bug Issue +about: Use this template for reporting a bug +labels: 'type:bug' + +--- + +Please make sure that this is a bug. As per our +[GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), +we only address code/doc bugs, performance issues, feature requests and +build/installation issues on GitHub. tag:bug_template + +**System information** +- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): +- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): +- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: +- TensorFlow installed from (source or binary): +- TensorFlow version (use command below): +- Python version: +- Bazel version (if compiling from source): +- GCC/Compiler version (if compiling from source): +- CUDA/cuDNN version: +- GPU model and memory: + +You can collect some of this information using our environment capture +[script](https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh) +You can also obtain the TensorFlow version with: +1. TF 1.0: `python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"` +2. TF 2.0: `python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"` + +**Describe the current behavior** + +**Describe the expected behavior** + +**[Contributing](https://www.tensorflow.org/community/contribute)** + +- Do you want to contribute a PR? (yes/no): +- Briefly describe your candidate solution(if contributing): + +**Standalone code to reproduce the issue** +Provide a reproducible test case that is the bare minimum necessary to generate +the problem. If possible, please share a link to Colab/Jupyter/any notebook. + +**Other info / logs** Include any logs or source code that would be helpful to +diagnose the problem. If including tracebacks, please include the full +traceback. Large logs and files should be attached. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..ee4c61b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,23 @@ +--- +name: Feature Request +about: Use this template for raising a feature request +labels: 'type:feature' + +--- + +Please make sure that this is a feature request. As per our [GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template + + +**System information** +- TensorFlow version (you are using): +- Are you willing to contribute it (Yes/No): + + + +**Describe the feature and the current behavior/state.** + +**Will this change the current api? How?** + +**Who will benefit with this feature?** + +**Any Other info.** diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 2f05086..2041773 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -8,6 +8,7 @@

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Mon Jan 10 19:48:42 EET 2022 by jegors
                                                                                  @@ -111,7 +111,7 @@

                                                                                  Specifications summary:

                                                                                  - +
                                                                                  0 0 100.0%0.148 seconds0.325 seconds
                                                                                  @@ -142,7 +142,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.065 seconds +0.086 seconds @@ -155,7 +155,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.024 seconds +0.070 seconds @@ -168,7 +168,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.047 seconds +0.140 seconds @@ -181,7 +181,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.012 seconds +0.029 seconds diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html index fbaaff9..b63f801 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.BreadthFirstSearchSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.065 seconds0.086 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html index d55b480..e19d85e 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.024 seconds0.070 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html index 0105e4b..945506f 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.GraphSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.047 seconds0.140 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html index c36de8c..cd21ce0 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.SearchAlgorithmSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Thu Jan 06 23:11:33 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.012 seconds0.029 seconds
                                                                                  @@ -305,6 +305,12 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  +
                                                                                  a complex graph with eight nodes
                                                                                  + + + + +
                                                                                  def graph = Graph.of([
                                                                                           A: [B: 5, H: 2],
                                                                                           B: [A: 5, C: 7],
                                                                                  @@ -322,6 +328,12 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  +
                                                                                  we use Breadth First Search algorithm for the first route
                                                                                  + + + + +
                                                                                  def routeOne = bfsAlgorithm.findPath(graph, source, target)
                                                                                  @@ -330,6 +342,12 @@

                                                                                  Features:

                                                                                  And:
                                                                                  +
                                                                                  we use Dijkstra's algorithm for the second route
                                                                                  + + + + +
                                                                                  def routeTwo = dijkstras.findPath(graph, source, target)
                                                                                  @@ -338,6 +356,12 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  +
                                                                                  the first route is the shortest
                                                                                  + + + + +
                                                                                  routeOne == shortest
                                                                                  @@ -346,6 +370,12 @@

                                                                                  Features:

                                                                                  And:
                                                                                  +
                                                                                  the second route is the fastest
                                                                                  + + + + +
                                                                                  routeTwo == fastest
                                                                                  @@ -354,6 +384,12 @@

                                                                                  Features:

                                                                                  And:
                                                                                  +
                                                                                  the distance calculated correctly
                                                                                  + + + + +
                                                                                  graph.getDistance(routeOne) == d1 as double
                                                                                   graph.getDistance(routeTwo) == d2 as double
                                                                                  From eb0a53952ba0ac99dbd43947059667b30b38316f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 10 Jan 2022 20:06:50 +0200 Subject: [PATCH 073/118] Updated reports --- .idea/misc.xml | 2 +- .../graph/SearchAlgorithmSpec.groovy | 5 +++++ .../src/test/resources/SpockConfig.groovy | 6 +++++- docs/spock-reports/aggregated_report.json | 2 +- docs/spock-reports/index.html | 12 +++++------ ...lgorithm.graph.BreadthFirstSearchSpec.html | 4 ++-- ...lgorithm.graph.DijkstrasAlgorithmSpec.html | 4 ++-- .../lv.id.jc.algorithm.graph.GraphSpec.html | 4 ++-- ...c.algorithm.graph.SearchAlgorithmSpec.html | 21 +++++++++++++++++-- sample-java/build.gradle | 4 ++++ 10 files changed, 47 insertions(+), 17 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index c41c674..4224c7a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -9,7 +9,7 @@

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 19:48:42 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Mon Jan 10 20:05:39 EET 2022 by jegors
                                                                                  @@ -111,7 +111,7 @@

                                                                                  Specifications summary:

                                                                                  - +
                                                                                  0 0 100.0%0.325 seconds0.212 seconds
                                                                                  @@ -142,7 +142,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.086 seconds +0.075 seconds @@ -155,7 +155,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.070 seconds +0.043 seconds @@ -168,7 +168,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.140 seconds +0.071 seconds @@ -181,7 +181,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.029 seconds +0.023 seconds diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html index b63f801..a51abdd 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.BreadthFirstSearchSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.086 seconds0.075 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html index e19d85e..4185e66 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.070 seconds0.043 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html index 945506f..093da27 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.GraphSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.140 seconds0.071 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html index cd21ce0..75e8993 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.SearchAlgorithmSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 19:48:41 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  @@ -272,12 +272,29 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.029 seconds0.023 seconds
                                                                                  Comparison of two algorithms
                                                                                  +

                                                                                  Features:

                                                                                  diff --git a/sample-java/build.gradle b/sample-java/build.gradle index 7a1e561..55a3b5d 100644 --- a/sample-java/build.gradle +++ b/sample-java/build.gradle @@ -14,3 +14,7 @@ application { mainModule = 'lv.id.jc.sample' mainClass = 'lv.id.jc.sample.GraphApp' } + +run { + standardInput = System.in +} \ No newline at end of file From 7cd7f53300b19996a1712a0869d9e9d359d61ddb Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 11 Jan 2022 09:01:03 +0200 Subject: [PATCH 074/118] Updated tests --- .../graph/DijkstrasAlgorithmTest.java | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java b/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java index c54aa4c..f3b4522 100644 --- a/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java +++ b/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java @@ -5,7 +5,6 @@ import org.junit.jupiter.api.Test; import java.util.ArrayList; -import java.util.Arrays; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -14,7 +13,8 @@ class DijkstrasAlgorithmTest { - private SearchAlgorithm algorithm; + private SearchAlgorithm bfsAlgorithm; + private SearchAlgorithm dijkstras; private Graph graph; @BeforeEach @@ -52,11 +52,15 @@ void setUp() { nodes.put("H", fromH); graph = Graph.of(nodes); - algorithm = new DijkstrasAlgorithm<>(); + dijkstras = new DijkstrasAlgorithm<>(); + bfsAlgorithm = new BreadthFirstSearch<>(); } @AfterEach void tearDown() { + graph = null; + dijkstras = null; + bfsAlgorithm = null; } @Test @@ -66,12 +70,20 @@ void findPathAA() { String source = "A"; String target = "A"; - List expected = new ArrayList<>(); - expected.add("A"); + List shortest = new ArrayList<>(); + shortest.add("A"); - List actual = algorithm.findPath(graph, source, target); + List fastest = new ArrayList<>(); + fastest.add("A"); - assertEquals(expected, actual); + List routeOne = bfsAlgorithm.findPath(graph, source, target); + List routeTwo = dijkstras.findPath(graph, source, target); + + assertEquals(shortest, routeOne); + assertEquals(fastest, routeTwo); + + assertEquals(0, graph.getDistance(shortest)); + assertEquals(0, graph.getDistance(fastest)); } @Test @@ -81,11 +93,19 @@ void findPathBB() { var source = "B"; var target = "B"; - var expected = List.of("B"); + var shortest = List.of("B"); + var fastest = List.of("B"); - var actual = algorithm.findPath(graph, source, target); + var actual = dijkstras.findPath(graph, source, target); - assertEquals(expected, actual); + List routeOne = bfsAlgorithm.findPath(graph, source, target); + List routeTwo = dijkstras.findPath(graph, source, target); + + assertEquals(shortest, routeOne); + assertEquals(fastest, routeTwo); + + assertEquals(0, graph.getDistance(shortest)); + assertEquals(0, graph.getDistance(fastest)); } @Test @@ -94,7 +114,7 @@ void findPathCD() { var target = "D"; var expected = List.of("C", "D"); - var actual = algorithm.findPath(graph, source, target); + var actual = dijkstras.findPath(graph, source, target); assertEquals(expected, actual); } @@ -105,7 +125,7 @@ void findPathDC() { var target = "C"; var expected = List.of("D", "E", "F", "G", "C"); - var actual = algorithm.findPath(graph, source, target); + var actual = dijkstras.findPath(graph, source, target); assertEquals(expected, actual); } From 857294b564eee9617b35f94b61cbe43ff9d46635 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 11 Jan 2022 09:01:38 +0200 Subject: [PATCH 075/118] Updated tests --- .../id/jc/algorithm/graph/SearchAlgorithmSpec.groovy | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy index e156de4..1fb5085 100644 --- a/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy @@ -1,10 +1,6 @@ package lv.id.jc.algorithm.graph -import spock.lang.Issue -import spock.lang.See -import spock.lang.Specification -import spock.lang.Subject -import spock.lang.Title +import spock.lang.* @Issue("30") @Title("Comparison of two algorithms") @@ -43,11 +39,11 @@ class SearchAlgorithmSpec extends Specification { routeTwo == fastest and: 'the distance calculated correctly' - graph.getDistance(routeOne) == d1 as double - graph.getDistance(routeTwo) == d2 as double + graph.getDistance(routeOne) == t1 as double + graph.getDistance(routeTwo) == t2 as double where: - source | target || d1 | shortest | d2 | fastest + source | target || t1 | shortest | t2 | fastest 'A' | 'A' || 0 | ['A'] | 0 | ['A'] 'B' | 'B' || 0 | ['B'] | 0 | ['B'] 'A' | 'B' || 5 | ['A', 'B'] | 5 | ['A', 'B'] From 17b9105c0796f0b811713a5f3573d35aee3877fd Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 11 Jan 2022 09:08:05 +0200 Subject: [PATCH 076/118] Updated DijkstrasAlgorithmTest --- .../graph/DijkstrasAlgorithmTest.java | 39 ++++++++++++------- docs/spock-reports/index.html | 2 +- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java b/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java index f3b4522..6ec7546 100644 --- a/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java +++ b/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java @@ -64,7 +64,7 @@ void tearDown() { } @Test - void findPathAA() { + void testFindPathAA() { // Java 8 String source = "A"; @@ -87,7 +87,7 @@ void findPathAA() { } @Test - void findPathBB() { + void testFindPathBB() { // Java 11 var source = "B"; @@ -96,10 +96,8 @@ void findPathBB() { var shortest = List.of("B"); var fastest = List.of("B"); - var actual = dijkstras.findPath(graph, source, target); - - List routeOne = bfsAlgorithm.findPath(graph, source, target); - List routeTwo = dijkstras.findPath(graph, source, target); + var routeOne = bfsAlgorithm.findPath(graph, source, target); + var routeTwo = dijkstras.findPath(graph, source, target); assertEquals(shortest, routeOne); assertEquals(fastest, routeTwo); @@ -109,25 +107,38 @@ void findPathBB() { } @Test - void findPathCD() { + void testFindPathCD() { var source = "C"; var target = "D"; - var expected = List.of("C", "D"); - var actual = dijkstras.findPath(graph, source, target); + var shortest = List.of("C", "D"); + var fastest = List.of("C", "D"); + + var routeOne = bfsAlgorithm.findPath(graph, source, target); + var routeTwo = dijkstras.findPath(graph, source, target); + + assertEquals(shortest, routeOne); + assertEquals(fastest, routeTwo); - assertEquals(expected, actual); + assertEquals(3, graph.getDistance(shortest)); + assertEquals(3, graph.getDistance(fastest)); } @Test - void findPathDC() { + void testFindPathDC() { var source = "D"; var target = "C"; + var shortest = List.of("D", "C"); + var fastest = List.of("D", "E", "F", "G", "C"); + + var routeOne = bfsAlgorithm.findPath(graph, source, target); + var routeTwo = dijkstras.findPath(graph, source, target); - var expected = List.of("D", "E", "F", "G", "C"); - var actual = dijkstras.findPath(graph, source, target); + assertEquals(shortest, routeOne); + assertEquals(fastest, routeTwo); - assertEquals(expected, actual); + assertEquals(20, graph.getDistance(shortest)); + assertEquals(19, graph.getDistance(fastest)); } } \ No newline at end of file diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index 0479b6c..25be033 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

                                                                                  Specification run results

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 20:05:39 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Tue Jan 11 09:06:35 EET 2022 by jegors.cemisovs
                                                                                  From 9536fef19704fab6aee2f08ecd14fdad56014cb4 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 11 Jan 2022 09:11:51 +0200 Subject: [PATCH 077/118] Refactoring. Tests renamed. --- ...pec.groovy => SearchAlgorithmsSpec.groovy} | 2 +- ...thmTest.java => SearchAlgorithmsTest.java} | 2 +- docs/spock-reports/aggregated_report.json | 2 +- docs/spock-reports/index.html | 27 ++++++++++++++----- 4 files changed, 23 insertions(+), 10 deletions(-) rename algorithm/src/test/groovy/lv/id/jc/algorithm/graph/{SearchAlgorithmSpec.groovy => SearchAlgorithmsSpec.groovy} (97%) rename algorithm/src/test/java/lv/id/jc/algorithm/graph/{DijkstrasAlgorithmTest.java => SearchAlgorithmsTest.java} (99%) diff --git a/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmsSpec.groovy similarity index 97% rename from algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmsSpec.groovy index 1fb5085..4182a97 100644 --- a/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmsSpec.groovy @@ -6,7 +6,7 @@ import spock.lang.* @Title("Comparison of two algorithms") @See("https://en.wikipedia.org/wiki/Breadth-first_search") @See("https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm") -class SearchAlgorithmSpec extends Specification { +class SearchAlgorithmsSpec extends Specification { @Subject def bfsAlgorithm = new BreadthFirstSearch() diff --git a/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java b/algorithm/src/test/java/lv/id/jc/algorithm/graph/SearchAlgorithmsTest.java similarity index 99% rename from algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java rename to algorithm/src/test/java/lv/id/jc/algorithm/graph/SearchAlgorithmsTest.java index 6ec7546..55844a0 100644 --- a/algorithm/src/test/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithmTest.java +++ b/algorithm/src/test/java/lv/id/jc/algorithm/graph/SearchAlgorithmsTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.*; -class DijkstrasAlgorithmTest { +class SearchAlgorithmsTest { private SearchAlgorithm bfsAlgorithm; private SearchAlgorithm dijkstras; diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index 708cdc7..88bb26e 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":65},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":24},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":12},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":90},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":86},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":140},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":29},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":81},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":57},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":103},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":32},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":61},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":43},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":86},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":30},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":82},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":51},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":120},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":53},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":75},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":43},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":71},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":23},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file +{"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":65},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":24},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":12},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":90},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":86},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":140},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":29},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":81},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":57},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":103},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":32},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":61},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":43},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":86},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":30},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":82},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":51},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":120},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":53},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":75},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":43},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":71},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":23},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.SearchAlgorithmsSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":69},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.SearchAlgorithmsSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":85},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index 25be033..60d72a2 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

                                                                                  Specification run results

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Tue Jan 11 09:06:35 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Tue Jan 11 09:10:51 EET 2022 by jegors.cemisovs
                                                                                  @@ -102,16 +102,16 @@

                                                                                  Specifications summary:

                                                                                  + - + - - + + - - - + +
                                                                                  5 441 001516 151 00100.0%0.212 seconds80.0%0.297 seconds
                                                                                  @@ -183,6 +183,19 @@

                                                                                  Specifications:

                                                                                  100.0% 0.023 seconds + + +lv.id.jc.algorithm.graph.SearchAlgorithmsSpec +
                                                                                  Comparison of two algorithms
                                                                                  + +1 +1 +1 +0 +0 +0.0% +0.085 seconds +
                                                                                  From 6d74b871bc6e753bf1944fb8d81e5c757af7a156 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 11 Jan 2022 09:24:09 +0200 Subject: [PATCH 078/118] Updated spock reports --- docs/spock-reports/aggregated_report.json | 2 +- docs/spock-reports/index.html | 37 ++++++------------- ...lgorithm.graph.BreadthFirstSearchSpec.html | 4 +- ...lgorithm.graph.DijkstrasAlgorithmSpec.html | 4 +- .../lv.id.jc.algorithm.graph.GraphSpec.html | 4 +- ...algorithm.graph.SearchAlgorithmsSpec.html} | 14 +++---- 6 files changed, 26 insertions(+), 39 deletions(-) rename docs/spock-reports/{lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html => lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html} (96%) diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json index 88bb26e..9b74f29 100644 --- a/docs/spock-reports/aggregated_report.json +++ b/docs/spock-reports/aggregated_report.json @@ -1 +1 @@ -{"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":65},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":24},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":12},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":90},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":86},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":140},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":29},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":81},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":57},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":103},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":32},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":61},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":43},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":86},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":30},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":82},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":51},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":120},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":53},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":75},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":43},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":71},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"lv.id.jc.algorithm.graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":23},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.SearchAlgorithmsSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":69},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.SearchAlgorithmsSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":85},"title":"Comparison of two algorithms","narrative":""}} \ No newline at end of file +{"lv.id.jc.algorithm.graph.SearchAlgorithmsSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"lv.id.jc.algorithm.graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":16},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":45},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"lv.id.jc.algorithm.graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"}} \ No newline at end of file diff --git a/docs/spock-reports/index.html b/docs/spock-reports/index.html index 60d72a2..a3307bf 100644 --- a/docs/spock-reports/index.html +++ b/docs/spock-reports/index.html @@ -84,7 +84,7 @@

                                                                                  Specification run results

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Tue Jan 11 09:10:51 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  @@ -102,16 +102,16 @@

                                                                                  Specifications summary:

                                                                                  - - + + - - + + - - + +
                                                                                  5 4140 016 151150 080.0%0.297 seconds100.0%0.154 seconds
                                                                                  @@ -142,7 +142,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.075 seconds +0.016 seconds @@ -155,7 +155,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.043 seconds +0.045 seconds @@ -168,11 +168,11 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.071 seconds +0.047 seconds -lv.id.jc.algorithm.graph.SearchAlgorithmSpec +lv.id.jc.algorithm.graph.SearchAlgorithmsSpec
                                                                                  Comparison of two algorithms
                                                                                  1 @@ -181,20 +181,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.023 seconds - - - -lv.id.jc.algorithm.graph.SearchAlgorithmsSpec -
                                                                                  Comparison of two algorithms
                                                                                  - -1 -1 -1 -0 -0 -0.0% -0.085 seconds +0.046 seconds diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html index a51abdd..7ed9e35 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.BreadthFirstSearchSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.075 seconds0.016 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html index 4185e66..2ad5606 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.043 seconds0.045 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html index 093da27..afabb22 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html @@ -251,7 +251,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.GraphSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.071 seconds0.047 seconds
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html similarity index 96% rename from docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html rename to docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html index 75e8993..6456a5d 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html @@ -244,14 +244,14 @@ -

                                                                                  Report for lv.id.jc.algorithm.graph.SearchAlgorithmSpec

                                                                                  +

                                                                                  Report for lv.id.jc.algorithm.graph.SearchAlgorithmsSpec


                                                                                  Summary:

                                                                                  -
                                                                                  Created on Mon Jan 10 20:05:38 EET 2022 by jegors
                                                                                  +
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  @@ -272,7 +272,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.023 seconds0.046 seconds
                                                                                  @@ -407,8 +407,8 @@

                                                                                  Features:

                                                                                  -
                                                                                  graph.getDistance(routeOne) == d1 as double
                                                                                  -graph.getDistance(routeTwo) == d2 as double
                                                                                  +
                                                                                  graph.getDistance(routeOne) == t1 as double
                                                                                  +graph.getDistance(routeTwo) == t2 as double
                                                                                  @@ -422,9 +422,9 @@

                                                                                  Features:

                                                                                  source target -d1 +t1 shortest -d2 +t2 fastest From 51719015d3cfafd16449aa5f4a74bab8e687b229 Mon Sep 17 00:00:00 2001 From: Jegors Cemisovs Date: Tue, 11 Jan 2022 10:12:12 +0200 Subject: [PATCH 079/118] Add gradle test reports --- ...lgorithm.graph.BreadthFirstSearchSpec.html | 156 +++++++++++++ ...lgorithm.graph.DijkstrasAlgorithmSpec.html | 211 ++++++++++++++++++ .../lv.id.jc.algorithm.graph.GraphSpec.html | 191 ++++++++++++++++ ....algorithm.graph.SearchAlgorithmsSpec.html | 151 +++++++++++++ ....algorithm.graph.SearchAlgorithmsTest.html | 111 +++++++++ docs/reports/tests/test/css/base-style.css | 179 +++++++++++++++ docs/reports/tests/test/css/style.css | 84 +++++++ docs/reports/tests/test/index.html | 173 ++++++++++++++ docs/reports/tests/test/js/report.js | 194 ++++++++++++++++ .../packages/lv.id.jc.algorithm.graph.html | 143 ++++++++++++ 10 files changed, 1593 insertions(+) create mode 100644 docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html create mode 100644 docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html create mode 100644 docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.GraphSpec.html create mode 100644 docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html create mode 100644 docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsTest.html create mode 100644 docs/reports/tests/test/css/base-style.css create mode 100644 docs/reports/tests/test/css/style.css create mode 100644 docs/reports/tests/test/index.html create mode 100644 docs/reports/tests/test/js/report.js create mode 100644 docs/reports/tests/test/packages/lv.id.jc.algorithm.graph.html diff --git a/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html new file mode 100644 index 0000000..ea86c69 --- /dev/null +++ b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html @@ -0,0 +1,156 @@ + + + + + +Test results - BreadthFirstSearchSpec + + + + + +
                                                                                  +

                                                                                  BreadthFirstSearchSpec

                                                                                  + +
                                                                                  + + + + + +
                                                                                  +
                                                                                  + + + + + + + +
                                                                                  +
                                                                                  +
                                                                                  13
                                                                                  +

                                                                                  tests

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  failures

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  ignored

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0.010s
                                                                                  +

                                                                                  duration

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  100%
                                                                                  +

                                                                                  successful

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +

                                                                                  Tests

                                                                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                  TestDurationResult
                                                                                  should find a route for complex graph [source: A, target: A, shortest: [A], time: 0, #0]0.001spassed
                                                                                  should find a route for complex graph [source: A, target: B, shortest: [A, B], time: 1, #2]0spassed
                                                                                  should find a route for complex graph [source: A, target: C, shortest: [A, B, D, C], time: 3, #4]0.001spassed
                                                                                  should find a route for complex graph [source: B, target: A, shortest: [B, A], time: 1, #3]0spassed
                                                                                  should find a route for complex graph [source: B, target: B, shortest: [B], time: 0, #1]0.001spassed
                                                                                  should find a route for complex graph [source: C, target: A, shortest: [C, A], time: 1, #5]0.001spassed
                                                                                  should find a route for complex graph [source: E, target: B, shortest: [E, F, D, C, A, B], time: 5, #6]0.001spassed
                                                                                  should find a route for simple graph [source: A, target: A, time: 0, shortest: [A], #0]0.001spassed
                                                                                  should find a route for simple graph [source: A, target: B, time: 7, shortest: [A, B], #1]0.001spassed
                                                                                  should find a route for simple graph [source: B, target: C, time: 5, shortest: [B, C], #2]0spassed
                                                                                  should find a route for simple graph [source: C, target: B, time: 3, shortest: [C, B], #3]0.001spassed
                                                                                  should return an empty path if can't find a route0.001spassed
                                                                                  should thrown NPE path for an empty graph0.001spassed
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + + diff --git a/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html new file mode 100644 index 0000000..f30bad8 --- /dev/null +++ b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html @@ -0,0 +1,211 @@ + + + + + +Test results - DijkstrasAlgorithmSpec + + + + + +
                                                                                  +

                                                                                  DijkstrasAlgorithmSpec

                                                                                  + +
                                                                                  + + + + + +
                                                                                  +
                                                                                  + + + + + + + +
                                                                                  +
                                                                                  +
                                                                                  24
                                                                                  +

                                                                                  tests

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  failures

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  ignored

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0.015s
                                                                                  +

                                                                                  duration

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  100%
                                                                                  +

                                                                                  successful

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +

                                                                                  Tests

                                                                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                  TestDurationResult
                                                                                  should find a route for a complex graph [source: A, target: A, time: 0, fastest: [A], #0]0spassed
                                                                                  should find a route for a complex graph [source: A, target: B, time: 5, fastest: [A, B], #2]0spassed
                                                                                  should find a route for a complex graph [source: A, target: C, time: 9, fastest: [A, H, G, C], #4]0.001spassed
                                                                                  should find a route for a complex graph [source: A, target: G, time: 5, fastest: [A, H, G], #6]0spassed
                                                                                  should find a route for a complex graph [source: B, target: A, time: 5, fastest: [B, A], #3]0spassed
                                                                                  should find a route for a complex graph [source: B, target: B, time: 0, fastest: [B], #1]0spassed
                                                                                  should find a route for a complex graph [source: B, target: D, time: 10, fastest: [B, C, D], #9]0.002spassed
                                                                                  should find a route for a complex graph [source: C, target: A, time: 12, fastest: [C, B, A], #5]0.001spassed
                                                                                  should find a route for a complex graph [source: C, target: D, time: 3, fastest: [C, D], #7]0.001spassed
                                                                                  should find a route for a complex graph [source: D, target: B, time: 26, fastest: [D, E, F, G, C, B], #10]0spassed
                                                                                  should find a route for a complex graph [source: D, target: C, time: 19, fastest: [D, E, F, G, C], #8]0spassed
                                                                                  should find a route for a complex graph [source: D, target: H, time: 33, fastest: [D, E, F, G, C, B, A, H], #11]0.001spassed
                                                                                  should find a route for a medium graph [source: A, target: A, time: 0, fastest: [A], #0]0.001spassed
                                                                                  should find a route for a medium graph [source: A, target: B, time: 5, fastest: [A, B], #2]0.001spassed
                                                                                  should find a route for a medium graph [source: A, target: C, time: 15, fastest: [A, B, C], #4]0.001spassed
                                                                                  should find a route for a medium graph [source: B, target: A, time: 5, fastest: [B, A], #3]0.001spassed
                                                                                  should find a route for a medium graph [source: B, target: B, time: 0, fastest: [B], #1]0.001spassed
                                                                                  should find a route for a medium graph [source: C, target: A, time: 20, fastest: [C, D, E, B, A], #5]0.001spassed
                                                                                  should find a route for a simple graph [source: A, target: A, time: 0, fastest: [A], #0]0spassed
                                                                                  should find a route for a simple graph [source: A, target: B, time: 5, fastest: [A, C, B], #3]0.001spassed
                                                                                  should find a route for a simple graph [source: B, target: B, time: 0, fastest: [B], #1]0spassed
                                                                                  should find a route for a simple graph [source: C, target: C, time: 0, fastest: [C], #2]0spassed
                                                                                  should return an empty path if can't find a route0.001spassed
                                                                                  should thrown NPE for an empty graph0.001spassed
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + + diff --git a/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.GraphSpec.html b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.GraphSpec.html new file mode 100644 index 0000000..fa28987 --- /dev/null +++ b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.GraphSpec.html @@ -0,0 +1,191 @@ + + + + + +Test results - GraphSpec + + + + + +
                                                                                  +

                                                                                  GraphSpec

                                                                                  + +
                                                                                  + + + + + +
                                                                                  +
                                                                                  + + + + + + + +
                                                                                  +
                                                                                  +
                                                                                  20
                                                                                  +

                                                                                  tests

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  failures

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  ignored

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0.050s
                                                                                  +

                                                                                  duration

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  100%
                                                                                  +

                                                                                  successful

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +

                                                                                  Tests

                                                                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                  TestDurationResult
                                                                                  should be zero distance for an empty path0.033spassed
                                                                                  should be zero distance for any one node path [oneNodePath: [12.56], #4]0.001spassed
                                                                                  should be zero distance for any one node path [oneNodePath: [2], #2]0.001spassed
                                                                                  should be zero distance for any one node path [oneNodePath: [A], #0]0.001spassed
                                                                                  should be zero distance for any one node path [oneNodePath: [B], #1]0.001spassed
                                                                                  should be zero distance for any one node path [oneNodePath: [X], #3]0.001spassed
                                                                                  should calculate distance for a path [path: [A, B, A, B], distance: 15, #4]0.001spassed
                                                                                  should calculate distance for a path [path: [A, B, A], distance: 10, #3]0spassed
                                                                                  should calculate distance for a path [path: [A, B], distance: 5, #1]0.001spassed
                                                                                  should calculate distance for a path [path: [A], distance: 0, #0]0.001spassed
                                                                                  should calculate distance for a path [path: [B, A], distance: 5, #2]0spassed
                                                                                  should calculate distance for a path [path: [C, D], distance: 3, #5]0.002spassed
                                                                                  should calculate distance for a path [path: [D, C], distance: 20, #6]0spassed
                                                                                  should calculate distance for a path [path: [D, E, F, G, C], distance: 19, #7]0spassed
                                                                                  should return edges for a given node [node: A, expected: [B:7, C:2], #0]0.001spassed
                                                                                  should return edges for a given node [node: B, expected: [A:3, C:5], #1]0.001spassed
                                                                                  should return edges for a given node [node: C, expected: [A:1, B:3], #2]0spassed
                                                                                  should throw NPE for incorrect path [incorrectPath: [A, B, D], #2]0.001spassed
                                                                                  should throw NPE for incorrect path [incorrectPath: [A, C], #1]0.002spassed
                                                                                  should throw NPE for incorrect path [incorrectPath: [E, D], #0]0.002spassed
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + + diff --git a/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html new file mode 100644 index 0000000..fa9ea3c --- /dev/null +++ b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html @@ -0,0 +1,151 @@ + + + + + +Test results - SearchAlgorithmsSpec + + + + + +
                                                                                  +

                                                                                  SearchAlgorithmsSpec

                                                                                  + +
                                                                                  + + + + + +
                                                                                  +
                                                                                  + + + + + + + +
                                                                                  +
                                                                                  +
                                                                                  12
                                                                                  +

                                                                                  tests

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  failures

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  ignored

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0.028s
                                                                                  +

                                                                                  duration

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  100%
                                                                                  +

                                                                                  successful

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +

                                                                                  Tests

                                                                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                  TestDurationResult
                                                                                  should find a route for a complex graph [source: A, target: A, t1: 0, shortest: [A], t2: 0, fastest: [A], #0]0.022spassed
                                                                                  should find a route for a complex graph [source: A, target: B, t1: 5, shortest: [A, B], t2: 5, fastest: [A, B], #2]0.001spassed
                                                                                  should find a route for a complex graph [source: A, target: C, t1: 12, shortest: [A, B, C], t2: 9, fastest: [A, H, G, C], #4]0spassed
                                                                                  should find a route for a complex graph [source: A, target: G, t1: 5, shortest: [A, H, G], t2: 5, fastest: [A, H, G], #6]0spassed
                                                                                  should find a route for a complex graph [source: B, target: A, t1: 5, shortest: [B, A], t2: 5, fastest: [B, A], #3]0spassed
                                                                                  should find a route for a complex graph [source: B, target: B, t1: 0, shortest: [B], t2: 0, fastest: [B], #1]0.001spassed
                                                                                  should find a route for a complex graph [source: B, target: D, t1: 10, shortest: [B, C, D], t2: 10, fastest: [B, C, D], #9]0spassed
                                                                                  should find a route for a complex graph [source: C, target: A, t1: 12, shortest: [C, B, A], t2: 12, fastest: [C, B, A], #5]0spassed
                                                                                  should find a route for a complex graph [source: C, target: D, t1: 3, shortest: [C, D], t2: 3, fastest: [C, D], #7]0.003spassed
                                                                                  should find a route for a complex graph [source: D, target: B, t1: 27, shortest: [D, C, B], t2: 26, fastest: [D, E, F, G, C, B], #10]0spassed
                                                                                  should find a route for a complex graph [source: D, target: C, t1: 20, shortest: [D, C], t2: 19, fastest: [D, E, F, G, C], #8]0spassed
                                                                                  should find a route for a complex graph [source: D, target: H, t1: 34, shortest: [D, C, B, A, H], t2: 33, fastest: [D, E, F, G, C, B, A, H], #11]0.001spassed
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + + diff --git a/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsTest.html b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsTest.html new file mode 100644 index 0000000..1b76b78 --- /dev/null +++ b/docs/reports/tests/test/classes/lv.id.jc.algorithm.graph.SearchAlgorithmsTest.html @@ -0,0 +1,111 @@ + + + + + +Test results - SearchAlgorithmsTest + + + + + +
                                                                                  +

                                                                                  SearchAlgorithmsTest

                                                                                  + +
                                                                                  + + + + + +
                                                                                  +
                                                                                  + + + + + + + +
                                                                                  +
                                                                                  +
                                                                                  4
                                                                                  +

                                                                                  tests

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  failures

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  ignored

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0.021s
                                                                                  +

                                                                                  duration

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  100%
                                                                                  +

                                                                                  successful

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +

                                                                                  Tests

                                                                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                  TestDurationResult
                                                                                  testFindPathAA()0.018spassed
                                                                                  testFindPathBB()0.001spassed
                                                                                  testFindPathCD()0.001spassed
                                                                                  testFindPathDC()0.001spassed
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + + diff --git a/docs/reports/tests/test/css/base-style.css b/docs/reports/tests/test/css/base-style.css new file mode 100644 index 0000000..4afa73e --- /dev/null +++ b/docs/reports/tests/test/css/base-style.css @@ -0,0 +1,179 @@ + +body { + margin: 0; + padding: 0; + font-family: sans-serif; + font-size: 12pt; +} + +body, a, a:visited { + color: #303030; +} + +#content { + padding-left: 50px; + padding-right: 50px; + padding-top: 30px; + padding-bottom: 30px; +} + +#content h1 { + font-size: 160%; + margin-bottom: 10px; +} + +#footer { + margin-top: 100px; + font-size: 80%; + white-space: nowrap; +} + +#footer, #footer a { + color: #a0a0a0; +} + +#line-wrapping-toggle { + vertical-align: middle; +} + +#label-for-line-wrapping-toggle { + vertical-align: middle; +} + +ul { + margin-left: 0; +} + +h1, h2, h3 { + white-space: nowrap; +} + +h2 { + font-size: 120%; +} + +ul.tabLinks { + padding-left: 0; + padding-top: 10px; + padding-bottom: 10px; + overflow: auto; + min-width: 800px; + width: auto !important; + width: 800px; +} + +ul.tabLinks li { + float: left; + height: 100%; + list-style: none; + padding-left: 10px; + padding-right: 10px; + padding-top: 5px; + padding-bottom: 5px; + margin-bottom: 0; + -moz-border-radius: 7px; + border-radius: 7px; + margin-right: 25px; + border: solid 1px #d4d4d4; + background-color: #f0f0f0; +} + +ul.tabLinks li:hover { + background-color: #fafafa; +} + +ul.tabLinks li.selected { + background-color: #c5f0f5; + border-color: #c5f0f5; +} + +ul.tabLinks a { + font-size: 120%; + display: block; + outline: none; + text-decoration: none; + margin: 0; + padding: 0; +} + +ul.tabLinks li h2 { + margin: 0; + padding: 0; +} + +div.tab { +} + +div.selected { + display: block; +} + +div.deselected { + display: none; +} + +div.tab table { + min-width: 350px; + width: auto !important; + width: 350px; + border-collapse: collapse; +} + +div.tab th, div.tab table { + border-bottom: solid #d0d0d0 1px; +} + +div.tab th { + text-align: left; + white-space: nowrap; + padding-left: 6em; +} + +div.tab th:first-child { + padding-left: 0; +} + +div.tab td { + white-space: nowrap; + padding-left: 6em; + padding-top: 5px; + padding-bottom: 5px; +} + +div.tab td:first-child { + padding-left: 0; +} + +div.tab td.numeric, div.tab th.numeric { + text-align: right; +} + +span.code { + display: inline-block; + margin-top: 0em; + margin-bottom: 1em; +} + +span.code pre { + font-size: 11pt; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + margin: 0; + background-color: #f7f7f7; + border: solid 1px #d0d0d0; + min-width: 700px; + width: auto !important; + width: 700px; +} + +span.wrapped pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: break-all; +} + +label.hidden { + display: none; +} \ No newline at end of file diff --git a/docs/reports/tests/test/css/style.css b/docs/reports/tests/test/css/style.css new file mode 100644 index 0000000..3dc4913 --- /dev/null +++ b/docs/reports/tests/test/css/style.css @@ -0,0 +1,84 @@ + +#summary { + margin-top: 30px; + margin-bottom: 40px; +} + +#summary table { + border-collapse: collapse; +} + +#summary td { + vertical-align: top; +} + +.breadcrumbs, .breadcrumbs a { + color: #606060; +} + +.infoBox { + width: 110px; + padding-top: 15px; + padding-bottom: 15px; + text-align: center; +} + +.infoBox p { + margin: 0; +} + +.counter, .percent { + font-size: 120%; + font-weight: bold; + margin-bottom: 8px; +} + +#duration { + width: 125px; +} + +#successRate, .summaryGroup { + border: solid 2px #d0d0d0; + -moz-border-radius: 10px; + border-radius: 10px; +} + +#successRate { + width: 140px; + margin-left: 35px; +} + +#successRate .percent { + font-size: 180%; +} + +.success, .success a { + color: #008000; +} + +div.success, #successRate.success { + background-color: #bbd9bb; + border-color: #008000; +} + +.failures, .failures a { + color: #b60808; +} + +.skipped, .skipped a { + color: #c09853; +} + +div.failures, #successRate.failures { + background-color: #ecdada; + border-color: #b60808; +} + +ul.linkList { + padding-left: 0; +} + +ul.linkList li { + list-style: none; + margin-bottom: 5px; +} diff --git a/docs/reports/tests/test/index.html b/docs/reports/tests/test/index.html new file mode 100644 index 0000000..62f8620 --- /dev/null +++ b/docs/reports/tests/test/index.html @@ -0,0 +1,173 @@ + + + + + +Test results - Test Summary + + + + + +
                                                                                  +

                                                                                  Test Summary

                                                                                  +
                                                                                  + + + + + +
                                                                                  +
                                                                                  + + + + + + + +
                                                                                  +
                                                                                  +
                                                                                  73
                                                                                  +

                                                                                  tests

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  failures

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  ignored

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0.124s
                                                                                  +

                                                                                  duration

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  100%
                                                                                  +

                                                                                  successful

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +

                                                                                  Packages

                                                                                  + + + + + + + + + + + + + + + + + + + + + +
                                                                                  PackageTestsFailuresIgnoredDurationSuccess rate
                                                                                  +lv.id.jc.algorithm.graph +73000.124s100%
                                                                                  +
                                                                                  +
                                                                                  +

                                                                                  Classes

                                                                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                  ClassTestsFailuresIgnoredDurationSuccess rate
                                                                                  +lv.id.jc.algorithm.graph.BreadthFirstSearchSpec +13000.010s100%
                                                                                  +lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec +24000.015s100%
                                                                                  +lv.id.jc.algorithm.graph.GraphSpec +20000.050s100%
                                                                                  +lv.id.jc.algorithm.graph.SearchAlgorithmsSpec +12000.028s100%
                                                                                  +lv.id.jc.algorithm.graph.SearchAlgorithmsTest +4000.021s100%
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + + diff --git a/docs/reports/tests/test/js/report.js b/docs/reports/tests/test/js/report.js new file mode 100644 index 0000000..83bab4a --- /dev/null +++ b/docs/reports/tests/test/js/report.js @@ -0,0 +1,194 @@ +(function (window, document) { + "use strict"; + + var tabs = {}; + + function changeElementClass(element, classValue) { + if (element.getAttribute("className")) { + element.setAttribute("className", classValue); + } else { + element.setAttribute("class", classValue); + } + } + + function getClassAttribute(element) { + if (element.getAttribute("className")) { + return element.getAttribute("className"); + } else { + return element.getAttribute("class"); + } + } + + function addClass(element, classValue) { + changeElementClass(element, getClassAttribute(element) + " " + classValue); + } + + function removeClass(element, classValue) { + changeElementClass(element, getClassAttribute(element).replace(classValue, "")); + } + + function initTabs() { + var container = document.getElementById("tabs"); + + tabs.tabs = findTabs(container); + tabs.titles = findTitles(tabs.tabs); + tabs.headers = findHeaders(container); + tabs.select = select; + tabs.deselectAll = deselectAll; + tabs.select(0); + + return true; + } + + function getCheckBox() { + return document.getElementById("line-wrapping-toggle"); + } + + function getLabelForCheckBox() { + return document.getElementById("label-for-line-wrapping-toggle"); + } + + function findCodeBlocks() { + var spans = document.getElementById("tabs").getElementsByTagName("span"); + var codeBlocks = []; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].className.indexOf("code") >= 0) { + codeBlocks.push(spans[i]); + } + } + return codeBlocks; + } + + function forAllCodeBlocks(operation) { + var codeBlocks = findCodeBlocks(); + + for (var i = 0; i < codeBlocks.length; ++i) { + operation(codeBlocks[i], "wrapped"); + } + } + + function toggleLineWrapping() { + var checkBox = getCheckBox(); + + if (checkBox.checked) { + forAllCodeBlocks(addClass); + } else { + forAllCodeBlocks(removeClass); + } + } + + function initControls() { + if (findCodeBlocks().length > 0) { + var checkBox = getCheckBox(); + var label = getLabelForCheckBox(); + + checkBox.onclick = toggleLineWrapping; + checkBox.checked = false; + + removeClass(label, "hidden"); + } + } + + function switchTab() { + var id = this.id.substr(1); + + for (var i = 0; i < tabs.tabs.length; i++) { + if (tabs.tabs[i].id === id) { + tabs.select(i); + break; + } + } + + return false; + } + + function select(i) { + this.deselectAll(); + + changeElementClass(this.tabs[i], "tab selected"); + changeElementClass(this.headers[i], "selected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var h2 = document.createElement("H2"); + + h2.appendChild(document.createTextNode(this.titles[i])); + this.headers[i].appendChild(h2); + } + + function deselectAll() { + for (var i = 0; i < this.tabs.length; i++) { + changeElementClass(this.tabs[i], "tab deselected"); + changeElementClass(this.headers[i], "deselected"); + + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + + var a = document.createElement("A"); + + a.setAttribute("id", "ltab" + i); + a.setAttribute("href", "#tab" + i); + a.onclick = switchTab; + a.appendChild(document.createTextNode(this.titles[i])); + + this.headers[i].appendChild(a); + } + } + + function findTabs(container) { + return findChildElements(container, "DIV", "tab"); + } + + function findHeaders(container) { + var owner = findChildElements(container, "UL", "tabLinks"); + return findChildElements(owner[0], "LI", null); + } + + function findTitles(tabs) { + var titles = []; + + for (var i = 0; i < tabs.length; i++) { + var tab = tabs[i]; + var header = findChildElements(tab, "H2", null)[0]; + + header.parentNode.removeChild(header); + + if (header.innerText) { + titles.push(header.innerText); + } else { + titles.push(header.textContent); + } + } + + return titles; + } + + function findChildElements(container, name, targetClass) { + var elements = []; + var children = container.childNodes; + + for (var i = 0; i < children.length; i++) { + var child = children.item(i); + + if (child.nodeType === 1 && child.nodeName === name) { + if (targetClass && child.className.indexOf(targetClass) < 0) { + continue; + } + + elements.push(child); + } + } + + return elements; + } + + // Entry point. + + window.onload = function() { + initTabs(); + initControls(); + }; +} (window, window.document)); \ No newline at end of file diff --git a/docs/reports/tests/test/packages/lv.id.jc.algorithm.graph.html b/docs/reports/tests/test/packages/lv.id.jc.algorithm.graph.html new file mode 100644 index 0000000..af30033 --- /dev/null +++ b/docs/reports/tests/test/packages/lv.id.jc.algorithm.graph.html @@ -0,0 +1,143 @@ + + + + + +Test results - Package lv.id.jc.algorithm.graph + + + + + +
                                                                                  +

                                                                                  Package lv.id.jc.algorithm.graph

                                                                                  + +
                                                                                  + + + + + +
                                                                                  +
                                                                                  + + + + + + + +
                                                                                  +
                                                                                  +
                                                                                  73
                                                                                  +

                                                                                  tests

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  failures

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0
                                                                                  +

                                                                                  ignored

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  0.124s
                                                                                  +

                                                                                  duration

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  100%
                                                                                  +

                                                                                  successful

                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +

                                                                                  Classes

                                                                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                  ClassTestsFailuresIgnoredDurationSuccess rate
                                                                                  +BreadthFirstSearchSpec +13000.010s100%
                                                                                  +DijkstrasAlgorithmSpec +24000.015s100%
                                                                                  +GraphSpec +20000.050s100%
                                                                                  +SearchAlgorithmsSpec +12000.028s100%
                                                                                  +SearchAlgorithmsTest +4000.021s100%
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + + From 40d684532c05193a0c7e70d0862a65bd65e199c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 12 Jan 2022 19:27:50 +0200 Subject: [PATCH 080/118] Updated gradlew --- gradlew | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 gradlew diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 From a310ef3d8680705fe8550c027cbb22a492b4a51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sat, 15 Jan 2022 01:20:44 +0200 Subject: [PATCH 081/118] Update build.gradle --- algorithm/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/algorithm/build.gradle b/algorithm/build.gradle index fef3784..5b269aa 100644 --- a/algorithm/build.gradle +++ b/algorithm/build.gradle @@ -2,6 +2,15 @@ plugins { id 'groovy' id 'java-library' id 'maven-publish' + id 'org.sonarqube' version '3.3' +} + +sonarqube { + properties { + property "sonar.projectKey", "rabestro_algorithms" + property "sonar.organization", "rabestro" + property "sonar.host.url", "https://sonarcloud.io" + } } group 'lv.id.jc' From 5c8550daab30f243f442270e010955233327211e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sat, 15 Jan 2022 01:21:38 +0200 Subject: [PATCH 082/118] Create build.yml --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..72b8671 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew build sonarqube --info From fe9f909c0b497bfc062b692d40f4f0c0bc035497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sat, 15 Jan 2022 11:26:21 +0200 Subject: [PATCH 083/118] Updated website configuration --- .github/ISSUE_TEMPLATE/feature-request.md | 6 -- docs/CNAME => CNAME | 0 README.md | 107 +++++++++++++++++++--- docs/_config.yml => _config.yml | 2 +- docs/index.md | 107 ---------------------- 5 files changed, 96 insertions(+), 126 deletions(-) rename docs/CNAME => CNAME (100%) rename docs/_config.yml => _config.yml (86%) delete mode 100644 docs/index.md diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index ee4c61b..0bc1613 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -8,12 +8,6 @@ labels: 'type:feature' Please make sure that this is a feature request. As per our [GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template -**System information** -- TensorFlow version (you are using): -- Are you willing to contribute it (Yes/No): - - - **Describe the feature and the current behavior/state.** **Will this change the current api? How?** diff --git a/docs/CNAME b/CNAME similarity index 100% rename from docs/CNAME rename to CNAME diff --git a/README.md b/README.md index f049f6c..d12273c 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,107 @@ # Graph search algorithms -This project was created to test graph search algorithms. There are implementations and tests for two algorithms: +The project implements an interface for the weighted graph, as well as two algorithms for finding a path in the graph. -- Breadth-first search -- Dijkstra's Algorithm +There are implementations and tests for two algorithms: -## Technical specifications +- [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) +- [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) -Algorithm code in Java 17. Tests written in Groovy 3 using Spock Framework 2. +The implementation is written in Java 17. [API documentation](api) is available. +You can also see the [specifications](spock-reports) generated with the spock-reports. -## Graph Samples +## How to use the classes in your program -To test the operation of the algorithms, the following sample graphs were created. +The first step is create a graph structure. The Graph interface is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. -![Small Graph](docs/assets/small.gif) +### Example +In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). -### Medium Graph +```java +var graph = Graph.of(Map.of( + 'A', Map.of('B', 5, 'H', 2), + 'B', Map.of('A', 5, 'C', 7), + 'C', Map.of('B', 7, 'D', 3, 'G', 4), + 'D', Map.of('C', 20, 'E', 4), + 'E', Map.of('F', 5), + 'F', Map.of('G', 6), + 'G', Map.of('C', 4), + 'H', Map.of('G', 3) + )); +``` -![Medium Graph](docs/assets/medium.gif) +The second step is creating a search algorithm class. You can choose one of the two algorithms. -### Complex Graph +### Example + +```java +var fastest = new DijkstrasAlgorithm(); +var shortest = new BreadthFirstSearch(); +``` + +Now we can search for the route. + +### Example + +```java +var source = 'D'; +var target = 'C'; + +var routeOne = shortest.findPath(graph, source, target); +var routeTwo = fastest.findPath(graph, source, target); +``` + +As result, you get a list with the path. + +```java +routeOne == ['D', 'C'] +routeTwo == ['D', 'E', 'F', 'G', 'C'] +``` + +## Unit Tests + +Tests are written in Groove language. For unit testing, the [Spock Framework](https://spockframework.org/) was used. To test the operation of the algorithms, the following sample graphs were created. + +### Small Graph Sample + +```groovy + def graph = Graph.of([ + A: [B: 7, C: 2], + B: [A: 3, C: 5], + C: [A: 1, B: 3] + ]) +``` + +![Small Graph](assets/small.gif) + + +### Medium Graph Sample + +```groovy + def graph = Graph.of([ + A: [B: 5], + B: [A: 5, C: 10], + C: [B: 20, D: 5], + D: [E: 5], + E: [B: 5] + ]) +``` + +![Medium Graph](assets/medium.gif) + +### Complex Graph Sample + +```groovy + def graph = Graph.of([ + A: [B: 5, H: 2], + B: [A: 5, C: 7], + C: [B: 7, D: 3, G: 4], + D: [C: 20, E: 4], + E: [F: 5], + F: [G: 6], + G: [C: 4], + H: [G: 3] + ]) +``` +![Complex Graph](assets/complex.gif) -![Complex Graph](docs/assets/complex.gif) diff --git a/docs/_config.yml b/_config.yml similarity index 86% rename from docs/_config.yml rename to _config.yml index 112b89d..e8eb639 100644 --- a/docs/_config.yml +++ b/_config.yml @@ -2,7 +2,7 @@ theme: jekyll-theme-minimal title: Algorithms author: Jegors Čemisovs email: jegors.cemisovs@outlook.lv -description: > # this means to ignore newlines until "baseurl:" +description: > Graph pathfinding algorithms. # social links diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index d12273c..0000000 --- a/docs/index.md +++ /dev/null @@ -1,107 +0,0 @@ -# Graph search algorithms - -The project implements an interface for the weighted graph, as well as two algorithms for finding a path in the graph. - -There are implementations and tests for two algorithms: - -- [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) -- [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) - -The implementation is written in Java 17. [API documentation](api) is available. -You can also see the [specifications](spock-reports) generated with the spock-reports. - -## How to use the classes in your program - -The first step is create a graph structure. The Graph interface is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. - -### Example -In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). - -```java -var graph = Graph.of(Map.of( - 'A', Map.of('B', 5, 'H', 2), - 'B', Map.of('A', 5, 'C', 7), - 'C', Map.of('B', 7, 'D', 3, 'G', 4), - 'D', Map.of('C', 20, 'E', 4), - 'E', Map.of('F', 5), - 'F', Map.of('G', 6), - 'G', Map.of('C', 4), - 'H', Map.of('G', 3) - )); -``` - -The second step is creating a search algorithm class. You can choose one of the two algorithms. - -### Example - -```java -var fastest = new DijkstrasAlgorithm(); -var shortest = new BreadthFirstSearch(); -``` - -Now we can search for the route. - -### Example - -```java -var source = 'D'; -var target = 'C'; - -var routeOne = shortest.findPath(graph, source, target); -var routeTwo = fastest.findPath(graph, source, target); -``` - -As result, you get a list with the path. - -```java -routeOne == ['D', 'C'] -routeTwo == ['D', 'E', 'F', 'G', 'C'] -``` - -## Unit Tests - -Tests are written in Groove language. For unit testing, the [Spock Framework](https://spockframework.org/) was used. To test the operation of the algorithms, the following sample graphs were created. - -### Small Graph Sample - -```groovy - def graph = Graph.of([ - A: [B: 7, C: 2], - B: [A: 3, C: 5], - C: [A: 1, B: 3] - ]) -``` - -![Small Graph](assets/small.gif) - - -### Medium Graph Sample - -```groovy - def graph = Graph.of([ - A: [B: 5], - B: [A: 5, C: 10], - C: [B: 20, D: 5], - D: [E: 5], - E: [B: 5] - ]) -``` - -![Medium Graph](assets/medium.gif) - -### Complex Graph Sample - -```groovy - def graph = Graph.of([ - A: [B: 5, H: 2], - B: [A: 5, C: 7], - C: [B: 7, D: 3, G: 4], - D: [C: 20, E: 4], - E: [F: 5], - F: [G: 6], - G: [C: 4], - H: [G: 3] - ]) -``` -![Complex Graph](assets/complex.gif) - From 09ec7df4b682af87ebe26691f1284f2f703c908c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sat, 15 Jan 2022 11:32:26 +0200 Subject: [PATCH 084/118] Fixed broken links in README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d12273c..0982c8e 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ There are implementations and tests for two algorithms: - [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) - [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) -The implementation is written in Java 17. [API documentation](api) is available. -You can also see the [specifications](spock-reports) generated with the spock-reports. +The implementation is written in Java 17. [API documentation](docs/api) is available. +You can also see the [specifications](docs/spock-reports) generated with the spock-reports. ## How to use the classes in your program @@ -72,7 +72,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ]) ``` -![Small Graph](assets/small.gif) +![Small Graph](docs/assets/small.gif) ### Medium Graph Sample @@ -87,7 +87,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ]) ``` -![Medium Graph](assets/medium.gif) +![Medium Graph](docs/assets/medium.gif) ### Complex Graph Sample @@ -103,5 +103,5 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht H: [G: 3] ]) ``` -![Complex Graph](assets/complex.gif) +![Complex Graph](docs/assets/complex.gif) From 074d8b54c7b29533e0b230f765d027cae23adaf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Sun, 16 Jan 2022 21:58:02 +0200 Subject: [PATCH 085/118] Add jacoco plugin --- algorithm/build.gradle | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/algorithm/build.gradle b/algorithm/build.gradle index 5b269aa..aaa5ff8 100644 --- a/algorithm/build.gradle +++ b/algorithm/build.gradle @@ -2,6 +2,7 @@ plugins { id 'groovy' id 'java-library' id 'maven-publish' + id 'jacoco' id 'org.sonarqube' version '3.3' } @@ -68,4 +69,15 @@ dependencies { test { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + + reports { + xml.required = true + csv.required = false + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } } From 6b2ee639552c916fa1833aa0b2e77a482979ce5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 20 Jan 2022 12:52:44 +0200 Subject: [PATCH 086/118] Update codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 661b4b2..a73edb8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,6 +39,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'temurin' # See 'Supported distributions' for available options + java-version: '17' # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 026fa95782025c05eaf5d661ce7aafeeefdf447e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 12:52:15 +0200 Subject: [PATCH 087/118] Add simple application --- .idea/gradle.xml | 1 + sample-java/build.gradle | 4 ++ sample-yaml/build.gradle | 24 +++++++++++ sample-yaml/src/main/java/GraphCli.java | 31 +++++++++++++ .../main/java/lv/id/jc/sample/Commands.java | 43 +++++++++++++++++++ .../main/java/lv/id/jc/sample/GraphShell.java | 12 ++++++ .../src/main/resources/application.properties | 1 + sample-yaml/src/main/resources/complex.yaml | 8 ++++ sample-yaml/src/main/resources/medium.yaml | 5 +++ sample-yaml/src/main/resources/simple.yaml | 3 ++ settings.gradle | 2 +- 11 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 sample-yaml/build.gradle create mode 100644 sample-yaml/src/main/java/GraphCli.java create mode 100644 sample-yaml/src/main/java/lv/id/jc/sample/Commands.java create mode 100644 sample-yaml/src/main/java/lv/id/jc/sample/GraphShell.java create mode 100644 sample-yaml/src/main/resources/application.properties create mode 100644 sample-yaml/src/main/resources/complex.yaml create mode 100644 sample-yaml/src/main/resources/medium.yaml create mode 100644 sample-yaml/src/main/resources/simple.yaml diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 2041773..61600b1 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -15,6 +15,7 @@ diff --git a/sample-java/build.gradle b/sample-java/build.gradle index 55a3b5d..3fe74e7 100644 --- a/sample-java/build.gradle +++ b/sample-java/build.gradle @@ -6,6 +6,10 @@ java { sourceCompatibility = JavaVersion.VERSION_17 } +repositories { + mavenCentral() +} + dependencies { implementation project(':algorithm') } diff --git a/sample-yaml/build.gradle b/sample-yaml/build.gradle new file mode 100644 index 0000000..90ec070 --- /dev/null +++ b/sample-yaml/build.gradle @@ -0,0 +1,24 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.6.3' + id 'io.spring.dependency-management' version '1.0.11.RELEASE' +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + +repositories { + mavenCentral() +} + +dependencies { + implementation project(':algorithm') + implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' + implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.1' + implementation 'org.springframework.shell:spring-shell-starter:2.0.1.RELEASE' +} + +group 'lv.id.jc' +version '1.0-SNAPSHOT' + diff --git a/sample-yaml/src/main/java/GraphCli.java b/sample-yaml/src/main/java/GraphCli.java new file mode 100644 index 0000000..c566fb8 --- /dev/null +++ b/sample-yaml/src/main/java/GraphCli.java @@ -0,0 +1,31 @@ +import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; +import lv.id.jc.algorithm.graph.BreadthFirstSearch; +import lv.id.jc.algorithm.graph.DijkstrasAlgorithm; +import lv.id.jc.algorithm.graph.Graph; + +import java.io.IOException; +import java.util.Map; +import java.util.Scanner; + +public class GraphCli { + public static void main(String[] args) throws IOException { + var in = GraphCli.class.getClassLoader().getResourceAsStream("complex.yaml"); + var schema = new YAMLMapper().readValue(in, Map.class); + var graph = Graph.of(schema); + + var scanner = new Scanner(System.in); + + System.out.print("Source node: "); + var source = scanner.next().toUpperCase(); + + System.out.print("Target node:"); + var target = scanner.next().toUpperCase(); + + var shortest = new BreadthFirstSearch<>().findPath(graph, source, target); + var fastest = new DijkstrasAlgorithm<>().findPath(graph, source, target); + + System.out.println("The shortest path: " + shortest); + System.out.println("The fastest path: " + fastest); + } + +} diff --git a/sample-yaml/src/main/java/lv/id/jc/sample/Commands.java b/sample-yaml/src/main/java/lv/id/jc/sample/Commands.java new file mode 100644 index 0000000..100d62c --- /dev/null +++ b/sample-yaml/src/main/java/lv/id/jc/sample/Commands.java @@ -0,0 +1,43 @@ +package lv.id.jc.sample; + +import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; +import lv.id.jc.algorithm.graph.BreadthFirstSearch; +import lv.id.jc.algorithm.graph.Graph; +import lv.id.jc.algorithm.graph.SearchAlgorithm; +import org.jline.utils.AttributedString; +import org.jline.utils.AttributedStyle; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.shell.jline.PromptProvider; +import org.springframework.shell.standard.ShellComponent; +import org.springframework.shell.standard.ShellMethod; + +import java.util.List; +import java.util.Map; + +@ShellComponent +public class Commands implements PromptProvider, InitializingBean { + + @Value("${graph.file:complex}") + private String file; + + private Graph graph; + private SearchAlgorithm bfgAlgorithm = new BreadthFirstSearch<>(); + + @Override + public void afterPropertiesSet() throws Exception { + var in = Commands.class.getClassLoader().getResourceAsStream(file + ".yaml"); + var schema = new YAMLMapper().readValue(in, Map.class); + graph = Graph.of(schema); + } + + @ShellMethod("finds the shortest path by using Breadth First Search Algorithm") + public List shortest(String source, String target) { + return bfgAlgorithm.findPath(graph, source, target); + } + + @Override + public AttributedString getPrompt() { + return new AttributedString(file + ":>", AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW)); + } +} diff --git a/sample-yaml/src/main/java/lv/id/jc/sample/GraphShell.java b/sample-yaml/src/main/java/lv/id/jc/sample/GraphShell.java new file mode 100644 index 0000000..1492d2d --- /dev/null +++ b/sample-yaml/src/main/java/lv/id/jc/sample/GraphShell.java @@ -0,0 +1,12 @@ +package lv.id.jc.sample; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class GraphShell { + + public static void main(String[] args) { + SpringApplication.run(GraphShell.class, args); + } +} diff --git a/sample-yaml/src/main/resources/application.properties b/sample-yaml/src/main/resources/application.properties new file mode 100644 index 0000000..1b45c68 --- /dev/null +++ b/sample-yaml/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.main.allow-circular-references=true \ No newline at end of file diff --git a/sample-yaml/src/main/resources/complex.yaml b/sample-yaml/src/main/resources/complex.yaml new file mode 100644 index 0000000..64332c4 --- /dev/null +++ b/sample-yaml/src/main/resources/complex.yaml @@ -0,0 +1,8 @@ +A: { B: 5, H: 2 } +B: { A: 5, C: 7 } +C: { B: 7, D: 3, G: 4 } +D: { C: 20, E: 4 } +E: { F: 5 } +F: { G: 6 } +G: { C: 4 } +H: { G: 3 } diff --git a/sample-yaml/src/main/resources/medium.yaml b/sample-yaml/src/main/resources/medium.yaml new file mode 100644 index 0000000..5c95ddf --- /dev/null +++ b/sample-yaml/src/main/resources/medium.yaml @@ -0,0 +1,5 @@ +A: { B: 5 } +B: { A: 5, C: 10 } +C: { B: 20, D: 5 } +D: { E: 5 } +E: { B: 5 } diff --git a/sample-yaml/src/main/resources/simple.yaml b/sample-yaml/src/main/resources/simple.yaml new file mode 100644 index 0000000..b22e0b0 --- /dev/null +++ b/sample-yaml/src/main/resources/simple.yaml @@ -0,0 +1,3 @@ +A: { B: 7, C: 2 } +B: { A: 3, C: 5 } +C: { A: 1, B: 3 } diff --git a/settings.gradle b/settings.gradle index 3c86329..522aedd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ rootProject.name = 'algorithms' -include 'algorithm', 'sample-java', 'sample-groovy' +include 'algorithm', 'sample-java', 'sample-groovy', 'sample-yaml' From 5e7c2b675a92e3d6a57e1e4a750d7873b537851f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 14:32:40 +0200 Subject: [PATCH 088/118] Updated settings.gradle --- .idea/gradle.xml | 2 +- {sample-yaml => sample-cli}/build.gradle | 0 .../main/java/lv/id/jc/sample/Commands.java | 31 ++++++++++++++----- .../main/java/lv/id/jc/sample/GraphShell.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/complex.yaml | 0 .../src/main/resources/medium.yaml | 0 .../src/main/resources/simple.yaml | 0 sample-yaml/src/main/java/GraphCli.java | 31 ------------------- settings.gradle | 2 +- 10 files changed, 26 insertions(+), 40 deletions(-) rename {sample-yaml => sample-cli}/build.gradle (100%) rename {sample-yaml => sample-cli}/src/main/java/lv/id/jc/sample/Commands.java (57%) rename {sample-yaml => sample-cli}/src/main/java/lv/id/jc/sample/GraphShell.java (100%) rename {sample-yaml => sample-cli}/src/main/resources/application.properties (100%) rename {sample-yaml => sample-cli}/src/main/resources/complex.yaml (100%) rename {sample-yaml => sample-cli}/src/main/resources/medium.yaml (100%) rename {sample-yaml => sample-cli}/src/main/resources/simple.yaml (100%) delete mode 100644 sample-yaml/src/main/java/GraphCli.java diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 61600b1..322de8d 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -13,9 +13,9 @@ diff --git a/sample-yaml/build.gradle b/sample-cli/build.gradle similarity index 100% rename from sample-yaml/build.gradle rename to sample-cli/build.gradle diff --git a/sample-yaml/src/main/java/lv/id/jc/sample/Commands.java b/sample-cli/src/main/java/lv/id/jc/sample/Commands.java similarity index 57% rename from sample-yaml/src/main/java/lv/id/jc/sample/Commands.java rename to sample-cli/src/main/java/lv/id/jc/sample/Commands.java index 100d62c..f49da85 100644 --- a/sample-yaml/src/main/java/lv/id/jc/sample/Commands.java +++ b/sample-cli/src/main/java/lv/id/jc/sample/Commands.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import lv.id.jc.algorithm.graph.BreadthFirstSearch; +import lv.id.jc.algorithm.graph.DijkstrasAlgorithm; import lv.id.jc.algorithm.graph.Graph; import lv.id.jc.algorithm.graph.SearchAlgorithm; import org.jline.utils.AttributedString; @@ -17,27 +18,43 @@ @ShellComponent public class Commands implements PromptProvider, InitializingBean { + private final SearchAlgorithm bfgAlgorithm = new BreadthFirstSearch<>(); + private final SearchAlgorithm dijkstrasAlgorithm = new DijkstrasAlgorithm<>(); - @Value("${graph.file:complex}") - private String file; + @Value("${graph:complex}") + private String graphName; private Graph graph; - private SearchAlgorithm bfgAlgorithm = new BreadthFirstSearch<>(); @Override public void afterPropertiesSet() throws Exception { - var in = Commands.class.getClassLoader().getResourceAsStream(file + ".yaml"); + var in = Commands.class.getClassLoader().getResourceAsStream(graphName + ".yaml"); var schema = new YAMLMapper().readValue(in, Map.class); graph = Graph.of(schema); } + @Override + public AttributedString getPrompt() { + return new AttributedString(graphName + ":> ", AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW)); + } + @ShellMethod("finds the shortest path by using Breadth First Search Algorithm") public List shortest(String source, String target) { return bfgAlgorithm.findPath(graph, source, target); } - @Override - public AttributedString getPrompt() { - return new AttributedString(file + ":>", AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW)); + @ShellMethod("finds the fastest path by using Dijkstra's Algorithm") + public List fastest(String source, String target) { + return dijkstrasAlgorithm.findPath(graph, source, target); + } + + @ShellMethod("prints schema of the graph") + public Map> schema() { + return graph.schema(); + } + + @ShellMethod("prints distance for the path") + public double distance(List path) { + return graph.getDistance(path); } } diff --git a/sample-yaml/src/main/java/lv/id/jc/sample/GraphShell.java b/sample-cli/src/main/java/lv/id/jc/sample/GraphShell.java similarity index 100% rename from sample-yaml/src/main/java/lv/id/jc/sample/GraphShell.java rename to sample-cli/src/main/java/lv/id/jc/sample/GraphShell.java diff --git a/sample-yaml/src/main/resources/application.properties b/sample-cli/src/main/resources/application.properties similarity index 100% rename from sample-yaml/src/main/resources/application.properties rename to sample-cli/src/main/resources/application.properties diff --git a/sample-yaml/src/main/resources/complex.yaml b/sample-cli/src/main/resources/complex.yaml similarity index 100% rename from sample-yaml/src/main/resources/complex.yaml rename to sample-cli/src/main/resources/complex.yaml diff --git a/sample-yaml/src/main/resources/medium.yaml b/sample-cli/src/main/resources/medium.yaml similarity index 100% rename from sample-yaml/src/main/resources/medium.yaml rename to sample-cli/src/main/resources/medium.yaml diff --git a/sample-yaml/src/main/resources/simple.yaml b/sample-cli/src/main/resources/simple.yaml similarity index 100% rename from sample-yaml/src/main/resources/simple.yaml rename to sample-cli/src/main/resources/simple.yaml diff --git a/sample-yaml/src/main/java/GraphCli.java b/sample-yaml/src/main/java/GraphCli.java deleted file mode 100644 index c566fb8..0000000 --- a/sample-yaml/src/main/java/GraphCli.java +++ /dev/null @@ -1,31 +0,0 @@ -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import lv.id.jc.algorithm.graph.BreadthFirstSearch; -import lv.id.jc.algorithm.graph.DijkstrasAlgorithm; -import lv.id.jc.algorithm.graph.Graph; - -import java.io.IOException; -import java.util.Map; -import java.util.Scanner; - -public class GraphCli { - public static void main(String[] args) throws IOException { - var in = GraphCli.class.getClassLoader().getResourceAsStream("complex.yaml"); - var schema = new YAMLMapper().readValue(in, Map.class); - var graph = Graph.of(schema); - - var scanner = new Scanner(System.in); - - System.out.print("Source node: "); - var source = scanner.next().toUpperCase(); - - System.out.print("Target node:"); - var target = scanner.next().toUpperCase(); - - var shortest = new BreadthFirstSearch<>().findPath(graph, source, target); - var fastest = new DijkstrasAlgorithm<>().findPath(graph, source, target); - - System.out.println("The shortest path: " + shortest); - System.out.println("The fastest path: " + fastest); - } - -} diff --git a/settings.gradle b/settings.gradle index 522aedd..f8c2158 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ rootProject.name = 'algorithms' -include 'algorithm', 'sample-java', 'sample-groovy', 'sample-yaml' +include 'algorithm', 'sample-java', 'sample-groovy', 'sample-cli' From bed5d4e54019a8d06f505ea640d0067c6e66e768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 14:47:25 +0200 Subject: [PATCH 089/118] Add banner.txt --- sample-cli/build.gradle | 4 ---- .../java/lv/id/jc/{sample => graph/cli}/Commands.java | 2 +- .../java/lv/id/jc/{sample => graph/cli}/GraphShell.java | 2 +- sample-cli/src/main/resources/banner.txt | 9 +++++++++ 4 files changed, 11 insertions(+), 6 deletions(-) rename sample-cli/src/main/java/lv/id/jc/{sample => graph/cli}/Commands.java (98%) rename sample-cli/src/main/java/lv/id/jc/{sample => graph/cli}/GraphShell.java (90%) create mode 100644 sample-cli/src/main/resources/banner.txt diff --git a/sample-cli/build.gradle b/sample-cli/build.gradle index 90ec070..64ee22d 100644 --- a/sample-cli/build.gradle +++ b/sample-cli/build.gradle @@ -4,10 +4,6 @@ plugins { id 'io.spring.dependency-management' version '1.0.11.RELEASE' } -java { - sourceCompatibility = JavaVersion.VERSION_17 -} - repositories { mavenCentral() } diff --git a/sample-cli/src/main/java/lv/id/jc/sample/Commands.java b/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java similarity index 98% rename from sample-cli/src/main/java/lv/id/jc/sample/Commands.java rename to sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java index f49da85..26f47c3 100644 --- a/sample-cli/src/main/java/lv/id/jc/sample/Commands.java +++ b/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java @@ -1,4 +1,4 @@ -package lv.id.jc.sample; +package lv.id.jc.graph.cli; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import lv.id.jc.algorithm.graph.BreadthFirstSearch; diff --git a/sample-cli/src/main/java/lv/id/jc/sample/GraphShell.java b/sample-cli/src/main/java/lv/id/jc/graph/cli/GraphShell.java similarity index 90% rename from sample-cli/src/main/java/lv/id/jc/sample/GraphShell.java rename to sample-cli/src/main/java/lv/id/jc/graph/cli/GraphShell.java index 1492d2d..ef9b391 100644 --- a/sample-cli/src/main/java/lv/id/jc/sample/GraphShell.java +++ b/sample-cli/src/main/java/lv/id/jc/graph/cli/GraphShell.java @@ -1,4 +1,4 @@ -package lv.id.jc.sample; +package lv.id.jc.graph.cli; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/sample-cli/src/main/resources/banner.txt b/sample-cli/src/main/resources/banner.txt new file mode 100644 index 0000000..8c173c1 --- /dev/null +++ b/sample-cli/src/main/resources/banner.txt @@ -0,0 +1,9 @@ + _____ _ _____ _ _____ + / ____| | | / ____| | | |_ _| + | | __ _ __ __ _ _ __ | |__ | | | | | | + | | |_ | | '__| / _` | | '_ \ | '_ \ | | | | | | + | |__| | | | | (_| | | |_) | | | | | | |____ | |____ _| |_ + \_____| |_| \__,_| | .__/ |_| |_| \_____| |______| |_____| + | | + |_| + From 9aaa20d9f70c1d9eb2d209ea2e08035d66540202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 14:54:40 +0200 Subject: [PATCH 090/118] Updated banner.txt --- sample-cli/build.gradle | 4 ++++ .../src/main/resources/application.properties | 3 ++- sample-cli/src/main/resources/banner.txt | 14 +++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sample-cli/build.gradle b/sample-cli/build.gradle index 64ee22d..803ab5a 100644 --- a/sample-cli/build.gradle +++ b/sample-cli/build.gradle @@ -15,6 +15,10 @@ dependencies { implementation 'org.springframework.shell:spring-shell-starter:2.0.1.RELEASE' } +bootJar { + launchScript() +} + group 'lv.id.jc' version '1.0-SNAPSHOT' diff --git a/sample-cli/src/main/resources/application.properties b/sample-cli/src/main/resources/application.properties index 1b45c68..c080813 100644 --- a/sample-cli/src/main/resources/application.properties +++ b/sample-cli/src/main/resources/application.properties @@ -1 +1,2 @@ -spring.main.allow-circular-references=true \ No newline at end of file +spring.main.allow-circular-references=true +logging.level.root=WARN diff --git a/sample-cli/src/main/resources/banner.txt b/sample-cli/src/main/resources/banner.txt index 8c173c1..c51d47b 100644 --- a/sample-cli/src/main/resources/banner.txt +++ b/sample-cli/src/main/resources/banner.txt @@ -1,9 +1,9 @@ - _____ _ _____ _ _____ - / ____| | | / ____| | | |_ _| - | | __ _ __ __ _ _ __ | |__ | | | | | | - | | |_ | | '__| / _` | | '_ \ | '_ \ | | | | | | - | |__| | | | | (_| | | |_) | | | | | | |____ | |____ _| |_ - \_____| |_| \__,_| | .__/ |_| |_| \_____| |______| |_____| + + _____ _ _____ _ _ _ + / ____| | | / ____| | | | | | | + | | __ _ __ __ _ _ __ | |__ | (___ | |__ ___ | | | | + | | |_ | | '__| / _` | | '_ \ | '_ \ \___ \ | '_ \ / _ \ | | | | + | |__| | | | | (_| | | |_) | | | | | ____) | | | | | | __/ | | | | + \_____| |_| \__,_| | .__/ |_| |_| |_____/ |_| |_| \___| |_| |_| | | |_| - From 18188954c2c6b5983a8e4f0b3e7e388d00069b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 16:26:25 +0200 Subject: [PATCH 091/118] Add validation for Vertex --- .../java/lv/id/jc/graph/cli/Commands.java | 13 +++++++++--- .../main/java/lv/id/jc/graph/cli/Vertex.java | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java diff --git a/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java b/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java index 26f47c3..30c9266 100644 --- a/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java +++ b/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java @@ -13,11 +13,13 @@ import org.springframework.shell.standard.ShellComponent; import org.springframework.shell.standard.ShellMethod; +import javax.validation.ConstraintValidator; +import javax.validation.ConstraintValidatorContext; import java.util.List; import java.util.Map; @ShellComponent -public class Commands implements PromptProvider, InitializingBean { +public class Commands implements PromptProvider, InitializingBean, ConstraintValidator { private final SearchAlgorithm bfgAlgorithm = new BreadthFirstSearch<>(); private final SearchAlgorithm dijkstrasAlgorithm = new DijkstrasAlgorithm<>(); @@ -39,12 +41,12 @@ public AttributedString getPrompt() { } @ShellMethod("finds the shortest path by using Breadth First Search Algorithm") - public List shortest(String source, String target) { + public List shortest(@Vertex String source, @Vertex String target) { return bfgAlgorithm.findPath(graph, source, target); } @ShellMethod("finds the fastest path by using Dijkstra's Algorithm") - public List fastest(String source, String target) { + public List fastest(@Vertex String source, @Vertex String target) { return dijkstrasAlgorithm.findPath(graph, source, target); } @@ -57,4 +59,9 @@ public Map> schema() { public double distance(List path) { return graph.getDistance(path); } + + @Override + public boolean isValid(String value, ConstraintValidatorContext context) { + return graph.schema().containsKey(value); + } } diff --git a/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java b/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java new file mode 100644 index 0000000..76caffb --- /dev/null +++ b/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java @@ -0,0 +1,20 @@ +package lv.id.jc.graph.cli; + +import javax.validation.Constraint; +import javax.validation.Payload; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.*; + +@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Constraint(validatedBy = {Commands.class}) +public @interface Vertex { + String message() default "this vertex was not found in the graph diagram"; + + Class[] groups() default {}; + + Class[] payload() default {}; +} From 60153b053e865cd3e05d7022b95a3d9fa476511a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 16:29:51 +0200 Subject: [PATCH 092/118] Delete unused targets in Vertex annotation --- sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java b/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java index 76caffb..4108746 100644 --- a/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java +++ b/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java @@ -6,9 +6,9 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.ElementType.PARAMETER; -@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER}) +@Target({PARAMETER}) @Retention(RetentionPolicy.RUNTIME) @Constraint(validatedBy = {Commands.class}) public @interface Vertex { From dd3dde701c1f0dc30fb3359f73fe97d60ff9862f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 18:48:22 +0200 Subject: [PATCH 093/118] Add GraphShell.md --- .idea/gradle.xml | 2 +- docs/GraphShell.md | 9 +++++++++ {sample-cli => graph-shell}/build.gradle | 0 .../src/main/java/lv/id/jc/graph/cli/Commands.java | 7 +++++++ .../src/main/java/lv/id/jc/graph/cli/GraphShell.java | 0 .../src/main/java/lv/id/jc/graph/cli/Vertex.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/banner.txt | 0 .../src/main/resources/complex.yaml | 0 .../src/main/resources/medium.yaml | 0 .../src/main/resources/simple.yaml | 0 settings.gradle | 2 +- 12 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 docs/GraphShell.md rename {sample-cli => graph-shell}/build.gradle (100%) rename {sample-cli => graph-shell}/src/main/java/lv/id/jc/graph/cli/Commands.java (91%) rename {sample-cli => graph-shell}/src/main/java/lv/id/jc/graph/cli/GraphShell.java (100%) rename {sample-cli => graph-shell}/src/main/java/lv/id/jc/graph/cli/Vertex.java (100%) rename {sample-cli => graph-shell}/src/main/resources/application.properties (100%) rename {sample-cli => graph-shell}/src/main/resources/banner.txt (100%) rename {sample-cli => graph-shell}/src/main/resources/complex.yaml (100%) rename {sample-cli => graph-shell}/src/main/resources/medium.yaml (100%) rename {sample-cli => graph-shell}/src/main/resources/simple.yaml (100%) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 322de8d..fc0e01e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -13,7 +13,7 @@ diff --git a/docs/GraphShell.md b/docs/GraphShell.md new file mode 100644 index 0000000..23ffbba --- /dev/null +++ b/docs/GraphShell.md @@ -0,0 +1,9 @@ +--- +layout: post title: Sample application: Graph Shell +--- + +## About + +To demonstrate the work of search algorithms, I made a small console program. The program allows you to select one of +three graph samples and search for a path using two algorithms. + diff --git a/sample-cli/build.gradle b/graph-shell/build.gradle similarity index 100% rename from sample-cli/build.gradle rename to graph-shell/build.gradle diff --git a/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java similarity index 91% rename from sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java rename to graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java index 30c9266..c4548bd 100644 --- a/sample-cli/src/main/java/lv/id/jc/graph/cli/Commands.java +++ b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java @@ -60,6 +60,13 @@ public double distance(List path) { return graph.getDistance(path); } + /** + * Implementation of java bean verification for @Vertex annotation + * + * @param value to check + * @param context of validation + * @return is value existing vertex in the graph scheme + */ @Override public boolean isValid(String value, ConstraintValidatorContext context) { return graph.schema().containsKey(value); diff --git a/sample-cli/src/main/java/lv/id/jc/graph/cli/GraphShell.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/GraphShell.java similarity index 100% rename from sample-cli/src/main/java/lv/id/jc/graph/cli/GraphShell.java rename to graph-shell/src/main/java/lv/id/jc/graph/cli/GraphShell.java diff --git a/sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/Vertex.java similarity index 100% rename from sample-cli/src/main/java/lv/id/jc/graph/cli/Vertex.java rename to graph-shell/src/main/java/lv/id/jc/graph/cli/Vertex.java diff --git a/sample-cli/src/main/resources/application.properties b/graph-shell/src/main/resources/application.properties similarity index 100% rename from sample-cli/src/main/resources/application.properties rename to graph-shell/src/main/resources/application.properties diff --git a/sample-cli/src/main/resources/banner.txt b/graph-shell/src/main/resources/banner.txt similarity index 100% rename from sample-cli/src/main/resources/banner.txt rename to graph-shell/src/main/resources/banner.txt diff --git a/sample-cli/src/main/resources/complex.yaml b/graph-shell/src/main/resources/complex.yaml similarity index 100% rename from sample-cli/src/main/resources/complex.yaml rename to graph-shell/src/main/resources/complex.yaml diff --git a/sample-cli/src/main/resources/medium.yaml b/graph-shell/src/main/resources/medium.yaml similarity index 100% rename from sample-cli/src/main/resources/medium.yaml rename to graph-shell/src/main/resources/medium.yaml diff --git a/sample-cli/src/main/resources/simple.yaml b/graph-shell/src/main/resources/simple.yaml similarity index 100% rename from sample-cli/src/main/resources/simple.yaml rename to graph-shell/src/main/resources/simple.yaml diff --git a/settings.gradle b/settings.gradle index f8c2158..2daba11 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ rootProject.name = 'algorithms' -include 'algorithm', 'sample-java', 'sample-groovy', 'sample-cli' +include 'algorithm', 'sample-java', 'sample-groovy', 'graph-shell' From f897728bdd61b0d5be25c9077d2c91b0ccb6cb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 18:54:46 +0200 Subject: [PATCH 094/118] Moved documentation --- CNAME => docs/CNAME | 0 LICENSE => docs/LICENSE | 0 README.md => docs/README.md | 15 +++++++++------ _config.yml => docs/_config.yml | 0 .../main/java/lv/id/jc/graph/cli/Commands.java | 3 ++- 5 files changed, 11 insertions(+), 7 deletions(-) rename CNAME => docs/CNAME (100%) rename LICENSE => docs/LICENSE (100%) rename README.md => docs/README.md (81%) rename _config.yml => docs/_config.yml (100%) diff --git a/CNAME b/docs/CNAME similarity index 100% rename from CNAME rename to docs/CNAME diff --git a/LICENSE b/docs/LICENSE similarity index 100% rename from LICENSE rename to docs/LICENSE diff --git a/README.md b/docs/README.md similarity index 81% rename from README.md rename to docs/README.md index 0982c8e..d1c6bee 100644 --- a/README.md +++ b/docs/README.md @@ -7,12 +7,14 @@ There are implementations and tests for two algorithms: - [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) - [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) -The implementation is written in Java 17. [API documentation](docs/api) is available. -You can also see the [specifications](docs/spock-reports) generated with the spock-reports. +The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You +can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports. ## How to use the classes in your program -The first step is create a graph structure. The Graph interface is generic, and you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. +The first step is create a graph structure. The Graph interface is generic, and you can use any Java type for vertex and +any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. You +can check the operation of the algorithms using the [Graph Shell](GraphShell.md) program. ### Example In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). @@ -72,7 +74,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ]) ``` -![Small Graph](docs/assets/small.gif) +![Small Graph](assets/small.gif) ### Medium Graph Sample @@ -87,7 +89,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ]) ``` -![Medium Graph](docs/assets/medium.gif) +![Medium Graph](assets/medium.gif) ### Complex Graph Sample @@ -103,5 +105,6 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht H: [G: 3] ]) ``` -![Complex Graph](docs/assets/complex.gif) + +![Complex Graph](assets/complex.gif) diff --git a/_config.yml b/docs/_config.yml similarity index 100% rename from _config.yml rename to docs/_config.yml diff --git a/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java index c4548bd..19373a8 100644 --- a/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java +++ b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java @@ -15,6 +15,7 @@ import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; +import javax.validation.constraints.NotEmpty; import java.util.List; import java.util.Map; @@ -56,7 +57,7 @@ public Map> schema() { } @ShellMethod("prints distance for the path") - public double distance(List path) { + public double distance(@NotEmpty List path) { return graph.getDistance(path); } From 70ad2b93cdf78ecc6cd0da13e7c795378a3b9710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 19:59:45 +0200 Subject: [PATCH 095/118] Add 2022-02-09-graph-shell.md --- docs/README.md | 10 ++++++---- .../2022-02-09-graph-shell.md} | 0 2 files changed, 6 insertions(+), 4 deletions(-) rename docs/{GraphShell.md => _posts/2022-02-09-graph-shell.md} (100%) diff --git a/docs/README.md b/docs/README.md index d1c6bee..c4d5ca3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,11 +10,13 @@ There are implementations and tests for two algorithms: The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports. -## How to use the classes in your program +## How to use the algorithms in your program -The first step is create a graph structure. The Graph interface is generic, and you can use any Java type for vertex and -any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. You -can check the operation of the algorithms using the [Graph Shell](GraphShell.md) program. +The first step is to create a graph structure. The Graph interface is generic, so you can use any Java type for vertex +and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. +You can play around with the algorithms using the [Graph Shell](_posts/2022-02-09-graph-shell.md) program. You can also +see the use of these algorithms in the [Hypermetro](https://rabestro.github.io/hypermetro/) project, where they are +utilized to find the optimal route. ### Example In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). diff --git a/docs/GraphShell.md b/docs/_posts/2022-02-09-graph-shell.md similarity index 100% rename from docs/GraphShell.md rename to docs/_posts/2022-02-09-graph-shell.md From 6495f891e0c073a42204864483ffb1c5fc5e9c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 20:59:20 +0200 Subject: [PATCH 096/118] Add description for Graph Shell --- docs/README.md | 4 + docs/_posts/2022-02-09-graph-shell.md | 107 +++++++++++++++++- .../java/lv/id/jc/graph/cli/Commands.java | 18 +-- 3 files changed, 114 insertions(+), 15 deletions(-) diff --git a/docs/README.md b/docs/README.md index c4d5ca3..1036df1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,7 @@ +--- +title: Graph search algorithms +--- + # Graph search algorithms The project implements an interface for the weighted graph, as well as two algorithms for finding a path in the graph. diff --git a/docs/_posts/2022-02-09-graph-shell.md b/docs/_posts/2022-02-09-graph-shell.md index 23ffbba..60ac8d1 100644 --- a/docs/_posts/2022-02-09-graph-shell.md +++ b/docs/_posts/2022-02-09-graph-shell.md @@ -1,9 +1,110 @@ --- -layout: post title: Sample application: Graph Shell +layout: post +title: Sample application: Graph Shell --- ## About -To demonstrate the work of search algorithms, I made a small console program. The program allows you to select one of -three graph samples and search for a path using two algorithms. +To demonstrate the work of search algorithms, I made a small console program. The program allows you to select one of three graph samples and search for a path using two algorithms. The source code of the program is located in `graph-shell` module. + +## Build & Run + +To compile the program, use the command: + +```shell +~/algorithms/graph-shell$ gradle assemble +``` + +This command will create an executable jar, so in Linux or macOS you may run the application by + +```shell +~/algorithms/graph-shell$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar +``` + +On the Windows machine you should run the application using java: + +```shell +~/algorithms/graph-shell$ java -jar ./build/libs/graph-shell-1.0-SNAPSHOT.jar +``` + +## Using Graph Shell + +The application has build-in three graph schemas: `simple`, `medium`, `complex`. By default the `complex` scheme is loaded. You may specify the schema in the `application.properties` file: + +```properties +graph=simple +``` + +Alternatively you may specify the command line parameter when you run the application: + +```shell +~/algorithms/graph-shell$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar --graph=medium +``` + +After starting the program you will see the banner and the prompt indicating the current graph scheme. + +```shell +jegors@X570UD:~/IdeaProjects/algorithms/graph-shell$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar + + _____ _ _____ _ _ _ + / ____| | | / ____| | | | | | | + | | __ _ __ __ _ _ __ | |__ | (___ | |__ ___ | | | | + | | |_ | | '__| / _` | | '_ \ | '_ \ \___ \ | '_ \ / _ \ | | | | + | |__| | | | | (_| | | |_) | | | | | ____) | | | | | | __/ | | | | + \_____| |_| \__,_| | .__/ |_| |_| |_____/ |_| |_| \___| |_| |_| + | | + |_| + +complex:> +``` + +The command help will show all available commands with short description. + +```shell +complex:> help +AVAILABLE COMMANDS + +Built-In Commands + clear: Clear the shell screen. + exit, quit: Exit the shell. + help: Display help about available commands. + history: Display or save the history of previously run commands + script: Read and execute commands from a file. + stacktrace: Display the full stacktrace of the last error. + +Commands + distance: prints distance for the path + fastest: finds the fastest path by using Dijkstra's Algorithm + schema: prints schema of the graph + shortest: finds the shortest path by using Breadth First Search Algorithm +``` + +Typing `help ` you will get more detailed information about each command. + +```shell +complex:> help fastest + + +NAME + fastest - finds the fastest path by using Dijkstra's Algorithm + +SYNOPSYS + fastest [--source] string [--target] string + +OPTIONS + --source string + + [Mandatory] + [this vertex was not found in the graph diagram] + + --target string + + [Mandatory] + [this vertex was not found in the graph diagram] +``` + +The program supports scripts. I provide one script `test1.script` to demonstrate the difference between two algorithms. + + + diff --git a/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java index 19373a8..6de426e 100644 --- a/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java +++ b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java @@ -20,7 +20,7 @@ import java.util.Map; @ShellComponent -public class Commands implements PromptProvider, InitializingBean, ConstraintValidator { +public class Commands implements InitializingBean, PromptProvider, ConstraintValidator { private final SearchAlgorithm bfgAlgorithm = new BreadthFirstSearch<>(); private final SearchAlgorithm dijkstrasAlgorithm = new DijkstrasAlgorithm<>(); @@ -41,6 +41,11 @@ public AttributedString getPrompt() { return new AttributedString(graphName + ":> ", AttributedStyle.DEFAULT.foreground(AttributedStyle.YELLOW)); } + @Override + public boolean isValid(String vertex, ConstraintValidatorContext context) { + return graph.schema().containsKey(vertex); + } + @ShellMethod("finds the shortest path by using Breadth First Search Algorithm") public List shortest(@Vertex String source, @Vertex String target) { return bfgAlgorithm.findPath(graph, source, target); @@ -61,15 +66,4 @@ public double distance(@NotEmpty List path) { return graph.getDistance(path); } - /** - * Implementation of java bean verification for @Vertex annotation - * - * @param value to check - * @param context of validation - * @return is value existing vertex in the graph scheme - */ - @Override - public boolean isValid(String value, ConstraintValidatorContext context) { - return graph.schema().containsKey(value); - } } From 31c32947c667510f9ae688d804723ef645b6e5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 21:03:43 +0200 Subject: [PATCH 097/118] Fixed README.md --- docs/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index 1036df1..c4d5ca3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,3 @@ ---- -title: Graph search algorithms ---- - # Graph search algorithms The project implements an interface for the weighted graph, as well as two algorithms for finding a path in the graph. From c6025f58c37f59c929e67a8ffbe0c43c320ef4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 9 Feb 2022 21:28:44 +0200 Subject: [PATCH 098/118] Update README.md --- docs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index c4d5ca3..a7aff23 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,8 +7,8 @@ There are implementations and tests for two algorithms: - [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) - [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) -The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You -can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports. +The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/api/) is available. You +can also see the [specifications](https://algorithms.jc.id.lv/spock-reports/) generated with the spock-reports. ## How to use the algorithms in your program From 87dd1facdd04ac13d781ed0222605c6638cb89bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 11:48:57 +0200 Subject: [PATCH 099/118] Updated README.md --- docs/README.md | 13 +- graph-shell/graph-shell.cast | 274 +++++++++++++++++++++++++++++++++++ graph-shell/test1.script | 14 ++ 3 files changed, 298 insertions(+), 3 deletions(-) create mode 100644 graph-shell/graph-shell.cast create mode 100644 graph-shell/test1.script diff --git a/docs/README.md b/docs/README.md index c4d5ca3..35c7602 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,9 +14,16 @@ can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports The first step is to create a graph structure. The Graph interface is generic, so you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. -You can play around with the algorithms using the [Graph Shell](_posts/2022-02-09-graph-shell.md) program. You can also -see the use of these algorithms in the [Hypermetro](https://rabestro.github.io/hypermetro/) project, where they are -utilized to find the optimal route. + +To demonstrate the work of search algorithms, I made a small console program. The program allows you to select one of three graph samples and search for a path using two algorithms. The source code of the program is located in `graph-shell` module. + +[![asciicast](https://asciinema.org/a/468058.svg)](https://asciinema.org/a/468058) + +### Usage in other projects + +These algorithms used in the [Hypermetro](https://rabestro.github.io/hypermetro/) project, where they are +utilized to find the optimal route in the metro schema. + ### Example In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). diff --git a/graph-shell/graph-shell.cast b/graph-shell/graph-shell.cast new file mode 100644 index 0000000..753a32a --- /dev/null +++ b/graph-shell/graph-shell.cast @@ -0,0 +1,274 @@ +{"version": 2, "width": 88, "height": 26, "timestamp": 1644485038, "idle_time_limit": 1.0, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color", "USER": "jegors"}, "title": "Demonstration of search algorithms in the graph."} +[0.027911, "o", "\u001b]0;jegors@X570UD:~/IdeaProjects/algorithms/graph-shell\u001b\\"] +[0.028901, "o", "\u001b]7;file://X570UD/home/jegors/IdeaProjects/algorithms/graph-shell\u001b\\"] +[0.029197, "o", "\u001b[?2004h\u001b]0;jegors@X570UD: ~/IdeaProjects/algorithms/graph-shell\u0007\u001b[01;32mjegors@X570UD\u001b[00m:\u001b[01;34m~/IdeaProjects/algorithms/graph-shell\u001b[00m$ "] +[3.275319, "i", "P"] +[3.276018, "o", "P"] +[3.73843, "i", "S"] +[3.738876, "o", "S"] +[4.077115, "i", "1"] +[4.07771, "o", "1"] +[5.065595, "i", "="] +[5.066169, "o", "="] +[5.763939, "i", "'"] +[5.764437, "o", "'"] +[9.132534, "i", "$"] +[9.133041, "o", "$"] +[10.221373, "i", "'"] +[10.22185, "o", "'"] +[10.511622, "i", "\r"] +[10.512049, "o", "\r\n\u001b[?2004l\r"] +[10.512759, "o", "\u001b]0;jegors@X570UD:~/IdeaProjects/algorithms/graph-shell\u001b\\"] +[10.517421, "o", "\u001b]7;file://X570UD/home/jegors/IdeaProjects/algorithms/graph-shell\u001b\\"] +[10.517884, "o", "\u001b[?2004h$"] +[34.358936, "i", "\u001b[200~# Demonstration of search algorithms in the graph \u001b[201~"] +[34.359826, "o", "\u001b[7m# Demonstration of search algorithms in the graph \u001b[27m"] +[35.595588, "i", "\r"] +[35.595964, "o", "\r\u001b[C# Demonstration of search algorithms in the graph \r\n\u001b[?2004l\r"] +[35.596517, "o", "\u001b]0;jegors@X570UD:~/IdeaProjects/algorithms/graph-shell\u001b\\"] +[35.601127, "o", "\u001b]7;file://X570UD/home/jegors/IdeaProjects/algorithms/graph-shell\u001b\\"] +[35.601558, "o", "\u001b[?2004h$"] +[45.781354, "i", "\u001b[200~# Graph Shell has build-in three graph schemes: simple, medium and comlex \u001b[201~"] +[45.78281, "o", "\u001b[7m# Graph Shell has build-in three graph schemes: simple, medium and comlex \u001b[27m"] +[47.041434, "i", "\r"] +[47.041939, "o", "\r\u001b[C# Graph Shell has build-in three graph schemes: simple, medium and comlex \r\n\u001b[?2004l\r"] +[47.042432, "o", "\u001b]0;jegors@X570UD:~/IdeaProjects/algorithms/graph-shell\u001b\\"] +[47.047454, "o", "\u001b]7;file://X570UD/home/jegors/IdeaProjects/algorithms/graph-shell\u001b\\"] +[47.047905, "o", "\u001b[?2004h$"] +[59.584057, "i", "\u001b[200~# If no specified the complex schema is loaded \u001b[201~"] +[59.5849, "o", "\u001b[7m# If no specified the complex schema is loaded \u001b[27m"] +[60.595809, "i", "\r"] +[60.596267, "o", "\r\u001b[C# If no specified the complex schema is loaded \r\n\u001b[?2004l\r"] +[60.596787, "o", "\u001b]0;jegors@X570UD:~/IdeaProjects/algorithms/graph-shell\u001b\\"] +[60.601613, "o", "\u001b]7;file://X570UD/home/jegors/IdeaProjects/algorithms/graph-shell\u001b\\"] +[60.602046, "o", "\u001b[?2004h$"] +[74.76556, "i", "\u001b[200~# Now we start the program with simple schema \r\r \u001b[201~"] +[74.76645, "o", "\u001b[7m# Now we start the program with simple schema \u001b[27m\r\n\r\n\r\u001b[7m \u001b[27m"] +[75.943562, "i", "\r"] +[75.944137, "o", "\u001b[A\u001b[A# Now we start the program with simple schema \r\n\r\n\r \r\n\u001b[?2004l\r"] +[75.944824, "o", "\u001b]0;jegors@X570UD:~/IdeaProjects/algorithms/graph-shell\u001b\\"] +[75.94987, "o", "\u001b]7;file://X570UD/home/jegors/IdeaProjects/algorithms/graph-shell\u001b\\"] +[75.950312, "o", "\u001b[?2004h$"] +[84.204334, "i", "\u001b[A"] +[84.204874, "o", "\r\u001b[C./build/libs/graph-shell-1.0-SNAPSHOT.jar --graph=simple"] +[88.633742, "i", "\r"] +[88.634162, "o", "\r\n\u001b[?2004l\r"] +[89.558375, "o", "\r\n _____ _ _____ _ _ _\r\n / ____| | | / ____| | | | | | |\r\n | | __ _ __ __ _ _ __ | |__ | (___ | |__ ___ | | | |\r\n | | |_ | | '__| / _` | | '_ \\ | '_ \\ \\___ \\ | '_ \\ / _ \\ | | | |\r\n | |__| | | | | (_| | | |_) | | | | | ____) | | | | | | __/ | | | |\r\n \\_____| |_| \\__,_| | .__/ |_| |_| |_____/ |_| |_| \\___| |_| |_|\r\n | |\r\n |_|\r\n\r\n"] +[90.786446, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[105.948456, "i", "\u001b[200~// The prompt indicated that the simple graph schema is successfully loaded\u001b[201~"] +[105.964575, "o", "\u001b[31m// The prompt indicated that the simple graph schema is successfully loa\u001b[0m\u001b[31md\u001b[0m\u001b[31med\u001b[0m"] +[107.400048, "i", "\r"] +[107.408447, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[107.413548, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[112.46835, "i", "h"] +[112.47101, "o", "\u001b[31mh\u001b[0m"] +[112.957856, "i", "e"] +[112.959463, "o", "\u001b[31me\u001b[0m"] +[113.134811, "i", "l"] +[113.136597, "o", "\u001b[31ml\u001b[0m"] +[113.198879, "i", "p"] +[113.202315, "o", "\b\b\b\u001b[1mhelp\u001b[0m\u001b[K"] +[113.513679, "i", "\r"] +[113.517016, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[113.586739, "o", "\u001b[1mAVAILABLE COMMANDS\r\n\r\nBuilt-In Commands\u001b[0m\r\n \u001b[1mclear\u001b[0m: Clear the shell screen.\r\n \u001b[1mexit, quit\u001b[0m: Exit the shell.\r\n \u001b[1mhelp\u001b[0m: Display help about available commands.\r\n \u001b[1mhistory\u001b[0m: Display or save the history of previously run commands\r\n \u001b[1mscript\u001b[0m: Read and execute commands from a file.\r\n \u001b[1mstacktrace\u001b[0m: Display the full stacktrace of the last error.\r\n\r\n\u001b[1mCommands\u001b[0m\r\n \u001b[1mdistance\u001b[0m: prints distance for the path\r\n \u001b[1mfastest\u001b[0m: finds the fastest path by using Dijkstra's Algorithm\r\n \u001b[1mschema\u001b[0m: prints schema of the graph\r\n \u001b[1mshortest\u001b[0m: finds the shortest path by using Breadth First Search Algorithm\r\n\r\n\r\n"] +[113.589229, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[130.723183, "i", "h"] +[130.724868, "o", "\u001b[31mh\u001b[0m"] +[131.142742, "i", "e"] +[131.14419, "o", "\u001b[31me\u001b[0m"] +[131.541978, "i", "l"] +[131.543541, "o", "\u001b[31ml\u001b[0m"] +[131.605809, "i", "p"] +[131.607528, "o", "\b\b\b\u001b[1mhelp\u001b[0m\u001b[K"] +[132.042382, "i", " "] +[132.043141, "o", " "] +[132.816931, "i", "s"] +[132.818416, "o", "s"] +[133.078999, "i", "c"] +[133.080476, "o", "c"] +[133.279177, "i", "h"] +[133.28056, "o", "h"] +[133.538538, "i", "e"] +[133.540024, "o", "e"] +[133.882552, "i", "m"] +[133.884249, "o", "m"] +[134.013943, "i", "a"] +[134.015444, "o", "a"] +[134.590303, "i", "\r"] +[134.593702, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[134.59937, "o", "\r\n\r\n\u001b[1mNAME\u001b[0m\r\n\tschema - prints schema of the graph\r\n\r\n\u001b[1mSYNOPSYS\u001b[0m\r\n\t\u001b[1mschema\u001b[0m \r\n\r\n\r\n\r\n"] +[134.601154, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[136.658136, "i", "s"] +[136.659362, "o", "\u001b[31ms\u001b[0m"] +[136.931108, "i", "c"] +[136.931513, "o", "\u001b[31mc\u001b[0m"] +[137.153947, "i", "h"] +[137.15528, "o", "\u001b[31mh\u001b[0m"] +[137.346398, "i", "e"] +[137.347806, "o", "\u001b[31me\u001b[0m"] +[137.69991, "i", "m"] +[137.701216, "o", "\u001b[31mm\u001b[0m"] +[137.827094, "i", "a"] +[137.828995, "o", "\u001b[5D\u001b[1mschema\u001b[0m\u001b[K"] +[138.329619, "i", "\r"] +[138.331188, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[138.369868, "o", "{A={B=7, C=2}, B={A=3, C=5}, C={A=1, B=3}}\r\n"] +[138.371489, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[141.02055, "i", "h"] +[141.021908, "o", "\u001b[31mh\u001b[0m"] +[141.332122, "i", "e"] +[141.333501, "o", "\u001b[31me\u001b[0m"] +[141.659468, "i", "l"] +[141.660874, "o", "\u001b[31ml\u001b[0m"] +[141.734046, "i", "p"] +[141.735516, "o", "\b\b\b\u001b[1mhelp\u001b[0m\u001b[K"] +[142.038872, "i", " "] +[142.040258, "o", " "] +[142.642315, "i", "s"] +[142.643816, "o", "s"] +[142.917715, "i", "h"] +[142.918972, "o", "h"] +[143.282957, "i", "o"] +[143.284416, "o", "o"] +[144.002742, "i", "r"] +[144.0042, "o", "r"] +[144.362211, "i", "\t"] +[144.37681, "o", "test "] +[145.046361, "i", "\r"] +[145.049781, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[145.063814, "o", "\r\n\r\n\u001b[1mNAME\u001b[0m\r\n\tshortest - finds the shortest path by using Breadth First Search Algorithm\r\n\r\n\u001b[1mSYNOPSYS\u001b[0m\r\n\t\u001b[1mshortest\u001b[0m [\u001b[1m--source\u001b[0m] \u001b[4mstring\u001b[0m [\u001b[1m--target\u001b[0m] \u001b[4mstring\u001b[0m \r\n\r\n\u001b[1mOPTIONS\u001b[0m\r\n\t\u001b[1m--source\u001b[0m \u001b[4mstring\u001b[0m\r\n\t\t\r\n\u001b[1m\t\t[Mandatory]\u001b[0m\r\n\u001b[1m\t\t[this vertex was not found in the graph diagram]\r\n\u001b[0m\r\n\t\u001b[1m--target\u001b[0m \u001b[4mstring\u001b[0m\r\n\t\t\r\n\u001b[1m\t\t[Mandatory]\u001b[0m\r\n\u001b[1m\t\t[this vertex was not found in the graph diagram]\r\n\u001b[0m\r\n\r\n\r\n"] +[145.065425, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[148.174946, "i", "s"] +[148.176352, "o", "\u001b[31ms\u001b[0m"] +[148.463, "i", "h"] +[148.464354, "o", "\u001b[31mh\u001b[0m"] +[148.725134, "i", "o"] +[148.726502, "o", "\u001b[31mo\u001b[0m"] +[149.191574, "i", "r"] +[149.192938, "o", "\u001b[31mr\u001b[0m"] +[149.448136, "i", "t"] +[149.449474, "o", "\u001b[31mt\u001b[0m"] +[149.562626, "i", "e"] +[149.563938, "o", "\u001b[31me\u001b[0m"] +[149.79337, "i", "s"] +[149.794596, "o", "\u001b[31ms\u001b[0m"] +[149.968465, "i", "t"] +[149.970017, "o", "\u001b[7D\u001b[1mshortest\u001b[0m\u001b[K"] +[150.086341, "i", " "] +[150.087842, "o", " "] +[152.02721, "i", "A"] +[152.027777, "o", "A"] +[152.386667, "i", " "] +[152.388223, "o", " "] +[152.863147, "i", "B"] +[152.864792, "o", "B"] +[153.547433, "i", "\r"] +[153.551276, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[153.576091, "o", "A\r\n"] +[153.576241, "o", "B\r\n"] +[153.577833, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[155.099248, "i", "f"] +[155.100625, "o", "\u001b[31mf\u001b[0m"] +[155.28906, "i", "a"] +[155.290648, "o", "\u001b[31ma\u001b[0m"] +[155.489145, "i", "s"] +[155.490408, "o", "\u001b[31ms\u001b[0m"] +[155.700639, "i", "t"] +[155.701924, "o", "\u001b[31mt\u001b[0m"] +[155.840851, "i", "e"] +[155.842168, "o", "\u001b[31me\u001b[0m"] +[156.060851, "i", "s"] +[156.062212, "o", "\u001b[31ms\u001b[0m"] +[156.241384, "i", "t"] +[156.242799, "o", "\u001b[6D\u001b[1mfastest\u001b[0m\u001b[K"] +[157.018753, "i", " "] +[157.020548, "o", " "] +[157.710521, "i", "A"] +[157.711946, "o", "A"] +[158.076379, "i", " "] +[158.077927, "o", " "] +[158.484749, "i", "B"] +[158.486046, "o", "B"] +[159.085469, "i", "\r"] +[159.089298, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l"] +[159.089867, "o", "\u001b[?2004l"] +[159.097297, "o", "A\r\n"] +[159.097549, "o", "C\r\n"] +[159.097919, "o", "B\r\n"] +[159.100224, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[161.645849, "i", "d"] +[161.64745, "o", "\u001b[31md\u001b[0m"] +[161.920218, "i", "i"] +[161.921585, "o", "\u001b[31mi\u001b[0m"] +[162.026591, "i", "s"] +[162.027786, "o", "\u001b[31ms\u001b[0m"] +[162.27677, "i", "t"] +[162.277951, "o", "\u001b[31mt\u001b[0m"] +[162.392453, "i", "a"] +[162.393652, "o", "\u001b[31ma\u001b[0m"] +[162.656308, "i", "n"] +[162.657468, "o", "\u001b[31mn\u001b[0m"] +[163.026019, "i", "c"] +[163.027184, "o", "\u001b[31mc\u001b[0m"] +[163.159787, "i", "e"] +[163.161196, "o", "\u001b[7D\u001b[1mdistance\u001b[0m\u001b[K"] +[163.277562, "i", " "] +[163.278724, "o", " "] +[165.12354, "i", "A"] +[165.124874, "o", "A"] +[165.392194, "i", ","] +[165.393639, "o", ","] +[166.289455, "i", "B"] +[166.290743, "o", "B"] +[167.695998, "i", "\r"] +[167.699265, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[167.712049, "o", "7.0\r\n"] +[167.713493, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[168.918752, "i", "d"] +[168.920167, "o", "\u001b[31md\u001b[0m"] +[169.152257, "i", "i"] +[169.153494, "o", "\u001b[31mi\u001b[0m"] +[169.328078, "i", "s"] +[169.329273, "o", "\u001b[31ms\u001b[0m"] +[169.558415, "i", "t"] +[169.559776, "o", "\u001b[31mt\u001b[0m"] +[169.754554, "i", "a"] +[169.756045, "o", "\u001b[31ma\u001b[0m"] +[169.971121, "i", "n"] +[169.972599, "o", "\u001b[31mn\u001b[0m"] +[170.3032, "i", "c"] +[170.304408, "o", "\u001b[31mc\u001b[0m"] +[170.441556, "i", "e"] +[170.442935, "o", "\u001b[7D\u001b[1mdistance\u001b[0m\u001b[K"] +[170.570542, "i", " "] +[170.571772, "o", " "] +[172.203523, "i", "A"] +[172.20466, "o", "A"] +[172.552722, "i", ","] +[172.554059, "o", ","] +[172.902159, "i", "C"] +[172.903843, "o", "C"] +[173.924009, "i", ","] +[173.925262, "o", ","] +[175.304144, "i", "B"] +[175.305116, "o", "B"] +[175.962629, "i", "\r"] +[175.965594, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[175.969572, "o", "5.0\r\n"] +[175.970947, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33msimple:> \u001b[0m"] +[177.668678, "i", "e"] +[177.670133, "o", "\u001b[31me\u001b[0m"] +[178.077727, "i", "x"] +[178.078942, "o", "\u001b[31mx\u001b[0m"] +[178.243986, "i", "i"] +[178.245137, "o", "\u001b[31mi\u001b[0m"] +[178.479066, "i", "t"] +[178.4805, "o", "\b\b\b\u001b[1mexit\u001b[0m\u001b[K"] +[179.035113, "i", "\r"] +[179.038028, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"] +[179.072935, "o", "\u001b]0;jegors@X570UD:~/IdeaProjects/algorithms/graph-shell\u001b\\"] +[179.074759, "o", "\u001b]7;file://X570UD/home/jegors/IdeaProjects/algorithms/graph-shell\u001b\\"] +[179.074989, "o", "\u001b[?2004h$"] +[180.52887, "i", "\u0004"] +[180.529318, "o", "\u001b[?2004l\r\r\n"] +[180.529984, "o", "logout\r\n"] diff --git a/graph-shell/test1.script b/graph-shell/test1.script new file mode 100644 index 0000000..a150925 --- /dev/null +++ b/graph-shell/test1.script @@ -0,0 +1,14 @@ +// The simple test is demonstrate the difference between two algorithms +// By default the application loads the complex graph + +// We make a search by using Breadth First Search algorithm +shortest D B + +// The path is shortest and we check the distance/time +distance D,C,B + +// For second search we use Dijkstras algorithm +fastest D B + +// For the same source and target the path is longer but it requires less time +distance D,E,F,G,C,B From 5e881703678f2cb12578b9ea40a30d818688ff26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 11:52:15 +0200 Subject: [PATCH 100/118] Updated README.md --- docs/README.md => README.md | 10 +++++----- docs/_config.yml => _config.yml | 0 {graph-shell => docs}/graph-shell.cast | 0 .../2022-02-09-graph-shell.md => graph-shell/README.md | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename docs/README.md => README.md (90%) rename docs/_config.yml => _config.yml (100%) rename {graph-shell => docs}/graph-shell.cast (100%) rename docs/_posts/2022-02-09-graph-shell.md => graph-shell/README.md (100%) diff --git a/docs/README.md b/README.md similarity index 90% rename from docs/README.md rename to README.md index 35c7602..536ece6 100644 --- a/docs/README.md +++ b/README.md @@ -15,7 +15,7 @@ can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports The first step is to create a graph structure. The Graph interface is generic, so you can use any Java type for vertex and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. -To demonstrate the work of search algorithms, I made a small console program. The program allows you to select one of three graph samples and search for a path using two algorithms. The source code of the program is located in `graph-shell` module. +To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program allows you to select one of three graph samples and search for a path using two algorithms. The source code of the program is located in `graph-shell` module. [![asciicast](https://asciinema.org/a/468058.svg)](https://asciinema.org/a/468058) @@ -26,7 +26,7 @@ utilized to find the optimal route in the metro schema. ### Example -In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif). +In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](docs/assets/complex.gif). ```java var graph = Graph.of(Map.of( @@ -83,7 +83,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ]) ``` -![Small Graph](assets/small.gif) +![Small Graph](docs/assets/small.gif) ### Medium Graph Sample @@ -98,7 +98,7 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ]) ``` -![Medium Graph](assets/medium.gif) +![Medium Graph](docs/assets/medium.gif) ### Complex Graph Sample @@ -115,5 +115,5 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ]) ``` -![Complex Graph](assets/complex.gif) +![Complex Graph](docs/assets/complex.gif) diff --git a/docs/_config.yml b/_config.yml similarity index 100% rename from docs/_config.yml rename to _config.yml diff --git a/graph-shell/graph-shell.cast b/docs/graph-shell.cast similarity index 100% rename from graph-shell/graph-shell.cast rename to docs/graph-shell.cast diff --git a/docs/_posts/2022-02-09-graph-shell.md b/graph-shell/README.md similarity index 100% rename from docs/_posts/2022-02-09-graph-shell.md rename to graph-shell/README.md From 60389348fab23215f46ef7a4f85084075b7882c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 11:53:55 +0200 Subject: [PATCH 101/118] Updated README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c05b175..536ece6 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ There are implementations and tests for two algorithms: - [Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search) - [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) -The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/api/) is available. You -can also see the [specifications](https://algorithms.jc.id.lv/spock-reports/) generated with the spock-reports. +The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You +can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports. ## How to use the algorithms in your program From 8903a9ae25e8f2f77777b31f88efa4f4fde19de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 11:59:35 +0200 Subject: [PATCH 102/118] Moved CNAME --- docs/CNAME => CNAME | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/CNAME => CNAME (100%) diff --git a/docs/CNAME b/CNAME similarity index 100% rename from docs/CNAME rename to CNAME From ab94bc85038c43824d1637c7c5ad818100a2a3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 12:13:48 +0200 Subject: [PATCH 103/118] Updated README.md --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 536ece6..00a2608 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,9 @@ There are implementations and tests for two algorithms: The implementation is written in Java 17. [API documentation](https://algorithms.jc.id.lv/docs/api/) is available. You can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports/) generated with the spock-reports. -## How to use the algorithms in your program +## Demo. Graph Shell -The first step is to create a graph structure. The Graph interface is generic, so you can use any Java type for vertex -and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. - -To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program allows you to select one of three graph samples and search for a path using two algorithms. The source code of the program is located in `graph-shell` module. +To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program allows you to select [one of three build-in graph samples](#Graph-Samples) and search for a path using two algorithms. The source code of the program is located in `graph-shell` module. [![asciicast](https://asciinema.org/a/468058.svg)](https://asciinema.org/a/468058) @@ -25,6 +22,11 @@ These algorithms used in the [Hypermetro](https://rabestro.github.io/hypermetro/ utilized to find the optimal route in the metro schema. +## How to use the algorithms in your program + +The first step is to create a graph structure. The Graph interface is generic, so you can use any Java type for vertex +and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. + ### Example In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](docs/assets/complex.gif). @@ -73,6 +75,8 @@ routeTwo == ['D', 'E', 'F', 'G', 'C'] Tests are written in Groove language. For unit testing, the [Spock Framework](https://spockframework.org/) was used. To test the operation of the algorithms, the following sample graphs were created. +## Graph Samples + ### Small Graph Sample ```groovy From 9acfba5e351087d032a35e70a69fd0042606bedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 12:15:38 +0200 Subject: [PATCH 104/118] Updated README.md --- graph-shell/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/graph-shell/README.md b/graph-shell/README.md index 60ac8d1..a0f5a84 100644 --- a/graph-shell/README.md +++ b/graph-shell/README.md @@ -1,5 +1,4 @@ --- -layout: post title: Sample application: Graph Shell --- From b1bb4d6a2e5521f5c993351edf2bbfcbfe902198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 12:16:50 +0200 Subject: [PATCH 105/118] Updated README.md --- graph-shell/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/graph-shell/README.md b/graph-shell/README.md index a0f5a84..cf0fa2b 100644 --- a/graph-shell/README.md +++ b/graph-shell/README.md @@ -11,19 +11,19 @@ To demonstrate the work of search algorithms, I made a small console program. Th To compile the program, use the command: ```shell -~/algorithms/graph-shell$ gradle assemble +$ gradle assemble ``` This command will create an executable jar, so in Linux or macOS you may run the application by ```shell -~/algorithms/graph-shell$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar +$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar ``` On the Windows machine you should run the application using java: ```shell -~/algorithms/graph-shell$ java -jar ./build/libs/graph-shell-1.0-SNAPSHOT.jar +$ java -jar ./build/libs/graph-shell-1.0-SNAPSHOT.jar ``` ## Using Graph Shell @@ -37,13 +37,13 @@ graph=simple Alternatively you may specify the command line parameter when you run the application: ```shell -~/algorithms/graph-shell$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar --graph=medium +$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar --graph=medium ``` After starting the program you will see the banner and the prompt indicating the current graph scheme. ```shell -jegors@X570UD:~/IdeaProjects/algorithms/graph-shell$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar +$ ./build/libs/graph-shell-1.0-SNAPSHOT.jar _____ _ _____ _ _ _ / ____| | | / ____| | | | | | | From 380dc145e1d4bf567c88b38b307be68d14c844a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Thu, 10 Feb 2022 16:48:05 +0200 Subject: [PATCH 106/118] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 00a2608..f799f6f 100644 --- a/README.md +++ b/README.md @@ -121,3 +121,4 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ![Complex Graph](docs/assets/complex.gif) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rabestro_algorithms&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rabestro_algorithms) From 162f3d7e4667358f02bdc2187a926206ba230af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Fri, 11 Feb 2022 20:06:59 +0200 Subject: [PATCH 107/118] Updated README.md --- .../java/lv/id/jc/graph/cli/Commands.java | 27 ++++++++++++------- .../main/java/lv/id/jc/graph/cli/Vertex.java | 2 +- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java index 6de426e..17bb0bf 100644 --- a/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java +++ b/graph-shell/src/main/java/lv/id/jc/graph/cli/Commands.java @@ -7,20 +7,22 @@ import lv.id.jc.algorithm.graph.SearchAlgorithm; import org.jline.utils.AttributedString; import org.jline.utils.AttributedStyle; -import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; import org.springframework.shell.jline.PromptProvider; import org.springframework.shell.standard.ShellComponent; import org.springframework.shell.standard.ShellMethod; +import javax.annotation.PostConstruct; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import javax.validation.constraints.NotEmpty; +import java.io.IOException; import java.util.List; import java.util.Map; @ShellComponent -public class Commands implements InitializingBean, PromptProvider, ConstraintValidator { +public class Commands implements PromptProvider, ConstraintValidator { private final SearchAlgorithm bfgAlgorithm = new BreadthFirstSearch<>(); private final SearchAlgorithm dijkstrasAlgorithm = new DijkstrasAlgorithm<>(); @@ -29,10 +31,10 @@ public class Commands implements InitializingBean, PromptProvider, ConstraintVal private Graph graph; - @Override - public void afterPropertiesSet() throws Exception { - var in = Commands.class.getClassLoader().getResourceAsStream(graphName + ".yaml"); - var schema = new YAMLMapper().readValue(in, Map.class); + @PostConstruct + public void loadGraph() throws IOException { + var resource = new ClassPathResource(graphName + ".yaml"); + var schema = new YAMLMapper().readValue(resource.getInputStream(), Map.class); graph = Graph.of(schema); } @@ -46,22 +48,27 @@ public boolean isValid(String vertex, ConstraintValidatorContext context) { return graph.schema().containsKey(vertex); } - @ShellMethod("finds the shortest path by using Breadth First Search Algorithm") + @ShellMethod("Find the shortest path by using Breadth First Search Algorithm.") public List shortest(@Vertex String source, @Vertex String target) { return bfgAlgorithm.findPath(graph, source, target); } - @ShellMethod("finds the fastest path by using Dijkstra's Algorithm") + @ShellMethod("Find the fastest path by using Dijkstra's Algorithm.") public List fastest(@Vertex String source, @Vertex String target) { return dijkstrasAlgorithm.findPath(graph, source, target); } - @ShellMethod("prints schema of the graph") + @ShellMethod("Print the edges of the given vertex.") + public Map edges(@Vertex String vertex) { + return graph.edges(vertex); + } + + @ShellMethod("Print schema of the graph.") public Map> schema() { return graph.schema(); } - @ShellMethod("prints distance for the path") + @ShellMethod("Calculate the distance for the given path.") public double distance(@NotEmpty List path) { return graph.getDistance(path); } diff --git a/graph-shell/src/main/java/lv/id/jc/graph/cli/Vertex.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/Vertex.java index 4108746..bd7511d 100644 --- a/graph-shell/src/main/java/lv/id/jc/graph/cli/Vertex.java +++ b/graph-shell/src/main/java/lv/id/jc/graph/cli/Vertex.java @@ -12,7 +12,7 @@ @Retention(RetentionPolicy.RUNTIME) @Constraint(validatedBy = {Commands.class}) public @interface Vertex { - String message() default "this vertex was not found in the graph diagram"; + String message() default "must be present in the graph scheme"; Class[] groups() default {}; From 114ca48eda89bd3779d421b45731f6cf978067ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Fri, 11 Feb 2022 20:24:07 +0200 Subject: [PATCH 108/118] Add package-info.java --- algorithm/src/test/resources/SpockConfig.groovy | 2 -- .../src/main/java/lv/id/jc/graph/cli/package-info.java | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 graph-shell/src/main/java/lv/id/jc/graph/cli/package-info.java diff --git a/algorithm/src/test/resources/SpockConfig.groovy b/algorithm/src/test/resources/SpockConfig.groovy index 4f97364..9d1c0df 100644 --- a/algorithm/src/test/resources/SpockConfig.groovy +++ b/algorithm/src/test/resources/SpockConfig.groovy @@ -11,6 +11,4 @@ spockReports { 'com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled': true, 'com.athaydes.spockframework.report.IReportCreator' : 'com.athaydes.spockframework.report.internal.HtmlReportCreator' ]) - // com.athaydes.spockframework.report.template.TemplateReportCreator - // com.athaydes.spockframework.report.internal.HtmlReportCreator } \ No newline at end of file diff --git a/graph-shell/src/main/java/lv/id/jc/graph/cli/package-info.java b/graph-shell/src/main/java/lv/id/jc/graph/cli/package-info.java new file mode 100644 index 0000000..d0b00b7 --- /dev/null +++ b/graph-shell/src/main/java/lv/id/jc/graph/cli/package-info.java @@ -0,0 +1,4 @@ +/** + * The package contains a simple shell program to demonstrate the work of search algorithms. + */ +package lv.id.jc.graph.cli; \ No newline at end of file From 2a9479b3d56fdaeea8021bf1e86ae738216e3f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 23 Feb 2022 12:25:32 +0200 Subject: [PATCH 109/118] Update README.md --- README.md | 56 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index f799f6f..6a58334 100644 --- a/README.md +++ b/README.md @@ -79,12 +79,14 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ### Small Graph Sample -```groovy - def graph = Graph.of([ - A: [B: 7, C: 2], - B: [A: 3, C: 5], - C: [A: 1, B: 3] - ]) +```mermaid +flowchart LR + A --> |7| B + A --> |2| C + B --> |3| A + B --> |5| C + C --> |1| A + C --> |3| B ``` ![Small Graph](docs/assets/small.gif) @@ -92,31 +94,35 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ### Medium Graph Sample -```groovy - def graph = Graph.of([ - A: [B: 5], - B: [A: 5, C: 10], - C: [B: 20, D: 5], - D: [E: 5], - E: [B: 5] - ]) +```mermaid +flowchart LR + A --> |5 | B + B --> |5 | A + B --> |10| C + C --> |5 | D + C --> |20| B + D --> |5 | E + E --> |5 | B ``` ![Medium Graph](docs/assets/medium.gif) ### Complex Graph Sample -```groovy - def graph = Graph.of([ - A: [B: 5, H: 2], - B: [A: 5, C: 7], - C: [B: 7, D: 3, G: 4], - D: [C: 20, E: 4], - E: [F: 5], - F: [G: 6], - G: [C: 4], - H: [G: 3] - ]) +```mermaid +flowchart LR + A --> |5 | B + A --> |2 | H + B --> |5 | A + B --> |7 | C + C --> |7 | B + C --> |3 | D + C --> |4 | G + D --> |20| C + D --> |4 | E + E --> |5 | F + G --> |4 | C + H --> |3 | G ``` ![Complex Graph](docs/assets/complex.gif) From 3362a7555754f2b29ef1cd96517cbaedfffffac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Fri, 20 May 2022 16:57:02 +0300 Subject: [PATCH 110/118] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a58334..3172ede 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rabestro_algorithms&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rabestro_algorithms) + # Graph search algorithms The project implements an interface for the weighted graph, as well as two algorithms for finding a path in the graph. @@ -127,4 +129,3 @@ flowchart LR ![Complex Graph](docs/assets/complex.gif) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rabestro_algorithms&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rabestro_algorithms) From 768d6426f12b11836f893ac36592a1fac7d2b395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Fri, 1 Jul 2022 14:58:25 +0300 Subject: [PATCH 111/118] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..244293b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Jegors Čemisovs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 62a9f86ca86b7f04752fd31f48dbe17e4535768e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Tue, 11 Oct 2022 16:56:28 +0300 Subject: [PATCH 112/118] Fixed method name --- .idea/gradle.xml | 2 +- .idea/misc.xml | 3 +++ .../lv/id/jc/algorithm/graph/BreadthFirstSearchSpec.groovy | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index fc0e01e..3643ec5 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -8,7 +8,7 @@

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Sun Oct 16 13:46:14 EEST 2022 by jegors
                                                                                  @@ -111,7 +111,7 @@

                                                                                  Specifications summary:

                                                                                  - +
                                                                                  0 0 100.0%0.154 seconds0.118 seconds
                                                                                  @@ -142,7 +142,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.016 seconds +0.037 seconds @@ -155,7 +155,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.045 seconds +0.044 seconds @@ -168,7 +168,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.047 seconds +0.032 seconds @@ -181,7 +181,7 @@

                                                                                  Specifications:

                                                                                  0 0 100.0% -0.046 seconds +0.005 seconds diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html index 7ed9e35..e90c676 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.BreadthFirstSearchSpec.html @@ -27,6 +27,10 @@ font-style: italic; } +.return-toc { + float: right; font-size: 60%; +} + table.features-table { width: 800px; } @@ -191,6 +195,11 @@ background: white !important; } +.ex-time { + font-style: italic; + font-size: smaller; +} + .ex-pass { color: darkgreen; } @@ -251,7 +260,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.BreadthFirstSearchSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Sun Oct 16 12:33:47 EEST 2022 by jegors
                                                                                  @@ -272,7 +281,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.016 seconds0.037 seconds
                                                                                  @@ -302,7 +311,7 @@

                                                                                  Features:

                                                                                  should find a route for complex graph
                                                                                2. -should thrown NPE path for an empty graph +should thrown an exception for an empty graph
                                                                                3. should return an empty path if can't find a route @@ -312,8 +321,9 @@

                                                                                  Features:

                                                                                  should find a route for simple graph - + Return +
                                                                                  (0.006 seconds)
                                                                                  @@ -375,28 +385,40 @@

                                                                                  Features:

                                                                                  A 0 [A] -OK + +OK +(0.006 seconds) + A B 7 [A, B] -OK + +OK +(0) + B C 5 [B, C] -OK + +OK +(0) + C B 3 [C, B] -OK + +OK +(0) + @@ -410,8 +432,9 @@

                                                                                  Features:

                                                                                  should find a route for complex graph - + Return +
                                                                                  (0)
                                                                                  @@ -483,49 +506,70 @@

                                                                                  Features:

                                                                                  A [A] 0 -OK + +OK +(0) + B B [B] 0 -OK + +OK +(0) + A B [A, B] 1 -OK + +OK +(0) + B A [B, A] 1 -OK + +OK +(0) + A C [A, B, D, C] 3 -OK + +OK +(0) + C A [C, A] 1 -OK + +OK +(0) + E B [E, F, D, C, A, B] 5 -OK + +OK +(0) + @@ -537,10 +581,11 @@

                                                                                  Features:

                                                                                  -
                                                                                  -should thrown NPE path for an empty graph - +
                                                                                  +should thrown an exception for an empty graph + Return +
                                                                                  (0)
                                                                                  @@ -573,8 +618,9 @@

                                                                                  Features:

                                                                                  should return an empty path if can't find a route - + Return +
                                                                                  (0)
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html index 2ad5606..2887df0 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html @@ -27,6 +27,10 @@ font-style: italic; } +.return-toc { + float: right; font-size: 60%; +} + table.features-table { width: 800px; } @@ -191,6 +195,11 @@ background: white !important; } +.ex-time { + font-style: italic; + font-size: smaller; +} + .ex-pass { color: darkgreen; } @@ -251,7 +260,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Sun Oct 16 13:46:14 EEST 2022 by jegors
                                                                                  @@ -272,13 +281,14 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.045 seconds0.044 seconds
                                                                                  Dijkstra's Algorithm
                                                                                  -
                                                                                  Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph
                                                                                  +
                                                                                  Dijkstra's algorithm is an algorithm for finding 
                                                                                  +the fastest paths between nodes in a graph
                                                                                  See:
                                                                                    @@ -315,8 +325,9 @@

                                                                                    Features:

                                                                                    should find a route for a simple graph - + Return +
                                                                                    (0.006 seconds)
                                                                                    @@ -338,7 +349,8 @@

                                                                                    Features:

                                                                                    When:
                                                                                    -
                                                                                    def path = algorithm.findPath(graph, source, target)
                                                                                    +
                                                                                    def path = algorithm.findPath(graph, source, target)
                                                                                    +def time = graph.getDistance(path)
                                                                                    @@ -346,15 +358,8 @@

                                                                                    Features:

                                                                                    Then:
                                                                                    -
                                                                                    path == fastest
                                                                                    - - - - -
                                                                                    And:
                                                                                    - - -
                                                                                    graph.getDistance(path) == time as double
                                                                                    +
                                                                                    path == fastestPath
                                                                                    +time == fastestTime
                                                                                    @@ -368,53 +373,56 @@

                                                                                    Features:

                                                                                    source target -time -fastest +fastestPath +fastestTime A A -0 [A] -OK - - -B -B 0 -[B] -OK + +OK +(0.006 seconds) + -C -C -0 -[C] -OK +B +A +[B, A] +3 + +OK +(0) + A B -5 [A, C, B] -OK +5 + +OK +(0) +
                                                                                  -
                                                                                  4/4 passed
                                                                                  +
                                                                                  3/3 passed
                                                                                  should find a route for a medium graph - + Return +
                                                                                  (0)
                                                                                  @@ -478,42 +486,60 @@

                                                                                  Features:

                                                                                  A 0 [A] -OK + +OK +(0) + B B 0 [B] -OK + +OK +(0) + A B 5 [A, B] -OK + +OK +(0) + B A 5 [B, A] -OK + +OK +(0) + A C 15 [A, B, C] -OK + +OK +(0) + C A 20 [C, D, E, B, A] -OK + +OK +(0) + @@ -527,8 +553,9 @@

                                                                                  Features:

                                                                                  should find a route for a complex graph - + Return +
                                                                                  (0)
                                                                                  @@ -595,84 +622,120 @@

                                                                                  Features:

                                                                                  A 0 [A] -OK + +OK +(0) + B B 0 [B] -OK + +OK +(0) + A B 5 [A, B] -OK + +OK +(0) + B A 5 [B, A] -OK + +OK +(0) + A C 9 [A, H, G, C] -OK + +OK +(0) + C A 12 [C, B, A] -OK + +OK +(0) + A G 5 [A, H, G] -OK + +OK +(0) + C D 3 [C, D] -OK + +OK +(0) + D C 19 [D, E, F, G, C] -OK + +OK +(0) + B D 10 [B, C, D] -OK + +OK +(0) + D B 26 [D, E, F, G, C, B] -OK + +OK +(0) + D H 33 [D, E, F, G, C, B, A, H] -OK + +OK +(0) + @@ -686,8 +749,9 @@

                                                                                  Features:

                                                                                  should thrown NPE for an empty graph - + Return +
                                                                                  (0)
                                                                                  @@ -720,8 +784,9 @@

                                                                                  Features:

                                                                                  should return an empty path if can't find a route - + Return +
                                                                                  (0)
                                                                                  diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html index afabb22..f83fed4 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.GraphSpec.html @@ -27,6 +27,10 @@ font-style: italic; } +.return-toc { + float: right; font-size: 60%; +} + table.features-table { width: 800px; } @@ -191,6 +195,11 @@ background: white !important; } +.ex-time { + font-style: italic; + font-size: smaller; +} + .ex-pass { color: darkgreen; } @@ -251,7 +260,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.GraphSpec

                                                                                4. Summary:

                                                                                  -
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Sun Oct 16 12:33:47 EEST 2022 by jegors
                                                                                  @@ -272,7 +281,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.047 seconds0.032 seconds
                                                                                  @@ -307,8 +316,9 @@

                                                                                  Features:

                                                                                  should return edges for a given node - + Return +
                                                                                  (0)
                                                                                  @@ -362,17 +372,26 @@

                                                                                  Features:

                                                                                  A [B:7, C:2] -OK + +OK +(0) + B [A:3, C:5] -OK + +OK +(0) + C [A:1, B:3] -OK + +OK +(0) + @@ -386,8 +405,9 @@

                                                                                  Features:

                                                                                  should calculate distance for a path - + Return +
                                                                                  (0)
                                                                                  @@ -454,42 +474,66 @@

                                                                                  Features:

                                                                                  [A] 0 -OK + +OK +(0) + [A, B] 5 -OK + +OK +(0) + [B, A] 5 -OK + +OK +(0) + [A, B, A] 10 -OK + +OK +(0) + [A, B, A, B] 15 -OK + +OK +(0) + [C, D] 3 -OK + +OK +(0) + [D, C] 20 -OK + +OK +(0) + [D, E, F, G, C] 19 -OK + +OK +(0) + @@ -503,8 +547,9 @@

                                                                                  Features:

                                                                                  should be zero distance for an empty path - + Return +
                                                                                  (0.020 seconds)
                                                                                  @@ -541,8 +586,9 @@

                                                                                  Features:

                                                                                  should be zero distance for any one node path - + Return +
                                                                                  (0)
                                                                                  @@ -598,23 +644,38 @@

                                                                                  Features:

                                                                                  [A] -OK + +OK +(0) + [B] -OK + +OK +(0) + [2] -OK + +OK +(0) + [X] -OK + +OK +(0) + [12.56] -OK + +OK +(0) + @@ -628,8 +689,9 @@

                                                                                  Features:

                                                                                  should throw NPE for incorrect path - + Return +
                                                                                  (0)
                                                                                  @@ -705,15 +767,24 @@

                                                                                  Features:

                                                                                  [E, D] -OK + +OK +(0) + [A, C] -OK + +OK +(0) + [A, B, D] -OK + +OK +(0) + diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html index 6456a5d..3210ffe 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.SearchAlgorithmsSpec.html @@ -27,6 +27,10 @@ font-style: italic; } +.return-toc { + float: right; font-size: 60%; +} + table.features-table { width: 800px; } @@ -191,6 +195,11 @@ background: white !important; } +.ex-time { + font-style: italic; + font-size: smaller; +} + .ex-pass { color: darkgreen; } @@ -251,7 +260,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.SearchAlgorithmsSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Tue Jan 11 09:12:51 EET 2022 by jegors.cemisovs
                                                                                  +
                                                                                  Created on Sun Oct 16 12:33:47 EEST 2022 by jegors
                                                                                  @@ -272,7 +281,7 @@

                                                                                  Summary:

                                                                                  - +
                                                                                  0 0 100.0%0.046 seconds0.005 seconds
                                                                                  @@ -311,8 +320,9 @@

                                                                                  Features:

                                                                                  should find a route for a complex graph - + Return +
                                                                                  (0)
                                                                                  @@ -436,7 +446,10 @@

                                                                                  Features:

                                                                                  [A] 0 [A] -OK + +OK +(0) + B @@ -445,7 +458,10 @@

                                                                                  Features:

                                                                                  [B] 0 [B] -OK + +OK +(0) + A @@ -454,7 +470,10 @@

                                                                                  Features:

                                                                                  [A, B] 5 [A, B] -OK + +OK +(0) + B @@ -463,7 +482,10 @@

                                                                                  Features:

                                                                                  [B, A] 5 [B, A] -OK + +OK +(0) + A @@ -472,7 +494,10 @@

                                                                                  Features:

                                                                                  [A, B, C] 9 [A, H, G, C] -OK + +OK +(0) + C @@ -481,7 +506,10 @@

                                                                                  Features:

                                                                                  [C, B, A] 12 [C, B, A] -OK + +OK +(0) + A @@ -490,7 +518,10 @@

                                                                                  Features:

                                                                                  [A, H, G] 5 [A, H, G] -OK + +OK +(0) + C @@ -499,7 +530,10 @@

                                                                                  Features:

                                                                                  [C, D] 3 [C, D] -OK + +OK +(0) + D @@ -508,7 +542,10 @@

                                                                                  Features:

                                                                                  [D, C] 19 [D, E, F, G, C] -OK + +OK +(0) + B @@ -517,7 +554,10 @@

                                                                                  Features:

                                                                                  [B, C, D] 10 [B, C, D] -OK + +OK +(0) + D @@ -526,7 +566,10 @@

                                                                                  Features:

                                                                                  [D, C, B] 26 [D, E, F, G, C, B] -OK + +OK +(0) + D @@ -535,7 +578,10 @@

                                                                                  Features:

                                                                                  [D, C, B, A, H] 33 [D, E, F, G, C, B, A, H] -OK + +OK +(0) + diff --git a/graph-shell/build.gradle b/graph-shell/build.gradle index 803ab5a..28fbee7 100644 --- a/graph-shell/build.gradle +++ b/graph-shell/build.gradle @@ -10,7 +10,7 @@ repositories { dependencies { implementation project(':algorithm') - implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.1' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.0-rc1' implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.1' implementation 'org.springframework.shell:spring-shell-starter:2.0.1.RELEASE' } From 440f8fa39a1c5667fcd5796a95dfc66efd5766e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 2 Nov 2022 20:33:09 +0200 Subject: [PATCH 115/118] update dependency --- .idea/jarRepositories.xml | 15 + docs/spock-reports/aggregated_report.json | 2 +- docs/spock-reports/index.html | 24 +- ...lgorithm.graph.DijkstrasAlgorithmSpec.html | 303 +++--------------- graph-shell/build.gradle | 14 +- sample-groovy/build.gradle | 2 +- 6 files changed, 84 insertions(+), 276 deletions(-) diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 73a34ad..9c37e0e 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -21,5 +21,20 @@

                                                                                  Specifications summary:

                                                                                  -
                                                                                  Created on Sun Oct 16 13:46:14 EEST 2022 by jegors
                                                                                  +
                                                                                  Created on Mon Oct 17 14:40:08 EEST 2022 by jegors
                                                                                  @@ -103,15 +103,15 @@

                                                                                  Specifications summary:

                                                                                  - - + + - + + - - - + +
                                                                                  44031 0 1515101 00100.0%0.118 seconds75.0%0.111 seconds
                                                                                  @@ -144,18 +144,18 @@

                                                                                  Specifications:

                                                                                  100.0% 0.037 seconds - + lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec
                                                                                  Dijkstra's Algorithm
                                                                                  5 -5 -0 +1 +1 0 0 -100.0% -0.044 seconds +0.0% +0.037 seconds diff --git a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html index 2887df0..6112fea 100644 --- a/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html +++ b/docs/spock-reports/lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec.html @@ -260,7 +260,7 @@

                                                                                  Report for lv.id.jc.algorithm.graph.DijkstrasAlgorithmSpec

                                                                                  Summary:

                                                                                  -
                                                                                  Created on Sun Oct 16 13:46:14 EEST 2022 by jegors
                                                                                  +
                                                                                  Created on Sun Oct 16 16:27:44 EEST 2022 by jegors
                                                                                  @@ -275,13 +275,13 @@

                                                                                  Summary:

                                                                                  - - + + - - + +
                                                                                  551 01 0 0100.0%0.044 seconds0.0%0.037 seconds
                                                                                  @@ -306,28 +306,28 @@

                                                                                  Features:

                                                                                  -
                                                                                  +
                                                                                  should find a route for a simple graph Return -
                                                                                  (0.006 seconds)
                                                                                  +
                                                                                  (0.016 seconds)
                                                                                  @@ -337,7 +337,7 @@

                                                                                  Features:

                                                                                  Given:
                                                                                  -
                                                                                  def graph = Graph.of([
                                                                                  +
                                                                                  def graph = Graph.of([
                                                                                           A: [B: 7, C: 2],
                                                                                           B: [A: 3, C: 5],
                                                                                           C: [A: 1, B: 3]
                                                                                  @@ -349,7 +349,7 @@ 

                                                                                  Features:

                                                                                  When:
                                                                                  -
                                                                                  def path = algorithm.findPath(graph, source, target)
                                                                                  +
                                                                                  def path = algorithm.findPath(graph, source, target)
                                                                                   def time = graph.getDistance(path)
                                                                                  @@ -358,8 +358,8 @@

                                                                                  Features:

                                                                                  Then:
                                                                                  -
                                                                                  path == fastestPath
                                                                                  -time == fastestTime
                                                                                  +
                                                                                  path == fastestPath // line 29
                                                                                  +
                                                                                  time == fastestTime
                                                                                  @@ -385,7 +385,7 @@

                                                                                  Features:

                                                                                  0 OK -(0.006 seconds) +(0.005 seconds) @@ -398,14 +398,14 @@

                                                                                  Features:

                                                                                  (0) - + A B -[A, C, B] +[A, B] 5 -OK -(0) +FAIL +(0.011 seconds) @@ -413,16 +413,34 @@

                                                                                  Features:

                                                                                  -
                                                                                  3/3 passed
                                                                                  +
                                                                                  2/3 passed
                                                                                  + + + + +
                                                                                  +
                                                                                  The following problems occurred:
                                                                                  +
                                                                                  +
                                                                                    +
                                                                                  • +
                                                                                    [A, B, [A, B], 5]
                                                                                    +
                                                                                      +
                                                                                    • +
                                                                                      Condition not satisfied:

                                                                                      path == fastestPath
                                                                                      | | |
                                                                                      | | [A, B]
                                                                                      | false
                                                                                      [A, C, B]
                                                                                      +
                                                                                    • +
                                                                                    +
                                                                                  • +
                                                                                  +
                                                                                  +
                                                                                  -
                                                                                  +
                                                                                  should find a route for a medium graph Return -
                                                                                  (0)
                                                                                  @@ -466,96 +484,11 @@

                                                                                  Features:

                                                                                  - -
                                                                                  Examples:
                                                                                  - - -
                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                  sourcetargettimefastest
                                                                                  AA0[A] -OK -(0) -
                                                                                  BB0[B] -OK -(0) -
                                                                                  AB5[A, B] -OK -(0) -
                                                                                  BA5[B, A] -OK -(0) -
                                                                                  AC15[A, B, C] -OK -(0) -
                                                                                  CA20[C, D, E, B, A] -OK -(0) -
                                                                                  -
                                                                                  - - -
                                                                                  6/6 passed
                                                                                  - - - -
                                                                                  +
                                                                                  should find a route for a complex graph Return -
                                                                                  (0)
                                                                                  @@ -602,156 +535,11 @@

                                                                                  Features:

                                                                                  - -
                                                                                  Examples:
                                                                                  - - -
                                                                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                                  sourcetargettimefastest
                                                                                  AA0[A] -OK -(0) -
                                                                                  BB0[B] -OK -(0) -
                                                                                  AB5[A, B] -OK -(0) -
                                                                                  BA5[B, A] -OK -(0) -
                                                                                  AC9[A, H, G, C] -OK -(0) -
                                                                                  CA12[C, B, A] -OK -(0) -
                                                                                  AG5[A, H, G] -OK -(0) -
                                                                                  CD3[C, D] -OK -(0) -
                                                                                  DC19[D, E, F, G, C] -OK -(0) -
                                                                                  BD10[B, C, D] -OK -(0) -
                                                                                  DB26[D, E, F, G, C, B] -OK -(0) -
                                                                                  DH33[D, E, F, G, C, B, A, H] -OK -(0) -
                                                                                  -
                                                                                  - - -
                                                                                  12/12 passed
                                                                                  - - - -
                                                                                  +
                                                                                  should thrown NPE for an empty graph Return -
                                                                                  (0)
                                                                                  @@ -782,11 +570,10 @@

                                                                                  Features:

                                                                                  -
                                                                                  +
                                                                                  should return an empty path if can't find a route Return -
                                                                                  (0)
                                                                                  diff --git a/graph-shell/build.gradle b/graph-shell/build.gradle index 28fbee7..dbba16f 100644 --- a/graph-shell/build.gradle +++ b/graph-shell/build.gradle @@ -1,18 +1,24 @@ plugins { id 'java' - id 'org.springframework.boot' version '2.6.3' + id 'org.springframework.boot' version '2.7.1' id 'io.spring.dependency-management' version '1.0.11.RELEASE' } repositories { mavenCentral() + maven { url 'https://repo.spring.io/release' } + maven { url 'https://repo.spring.io/libs-snapshot-local' } + maven { url 'https://repo.spring.io/libs-milestone-local' } } dependencies { implementation project(':algorithm') - implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.0-rc1' - implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.1' - implementation 'org.springframework.shell:spring-shell-starter:2.0.1.RELEASE' + implementation 'org.springframework.boot:spring-boot-starter' + implementation 'org.springframework.shell:spring-shell-starter:2.1.3' + + // YAML + implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4.2' + implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.4' } bootJar { diff --git a/sample-groovy/build.gradle b/sample-groovy/build.gradle index a95ad88..18b78ad 100644 --- a/sample-groovy/build.gradle +++ b/sample-groovy/build.gradle @@ -11,7 +11,7 @@ repositories { } dependencies { - implementation 'org.codehaus.groovy:groovy-all:3.0.8' + implementation 'org.codehaus.groovy:groovy-all:3.0.12' implementation project(':algorithm') } From ca58066a1fc63e098ff391cee729745361726565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Mon, 5 Jun 2023 17:04:57 +0300 Subject: [PATCH 116/118] add graph2puml.awk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #50 Signed-off-by: Jegors Čemisovs --- .editorconfig | 312 ++++++++++++++++++++++++++ .gitmessage | 44 ++++ graph-shell/docs/complex.png | Bin 0 -> 36283 bytes graph-shell/docs/complex.puml | 29 +++ graph-shell/docs/medium.puml | 20 ++ graph-shell/docs/simple.puml | 17 ++ graph-shell/src/script/graph2puml.awk | 20 ++ 7 files changed, 442 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitmessage create mode 100644 graph-shell/docs/complex.png create mode 100644 graph-shell/docs/complex.puml create mode 100644 graph-shell/docs/medium.puml create mode 100644 graph-shell/docs/simple.puml create mode 100644 graph-shell/src/script/graph2puml.awk diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f5ca14e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,312 @@ +# This file is for unifying the coding style for different editors and IDEs. +# More information at http://EditorConfig.org + +# No .editorconfig files above the root directory +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = false +max_line_length = 130 +tab_width = 4 +trim_trailing_whitespace = true +ij_continuation_indent_size = 8 +ij_formatter_off_tag=@formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = true +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false + +[*.java] +indent_size = 3 +tab_width = 3 +ij_continuation_indent_size = 6 +ij_java_align_consecutive_assignments = false +ij_java_align_consecutive_variable_declarations = false +ij_java_align_group_field_declarations = false +ij_java_align_multiline_annotation_parameters = false +ij_java_align_multiline_array_initializer_expression = false +ij_java_align_multiline_assignment = false +ij_java_align_multiline_binary_operation = false +ij_java_align_multiline_chained_methods = false +ij_java_align_multiline_extends_list = false +ij_java_align_multiline_for = true +ij_java_align_multiline_method_parentheses = false +ij_java_align_multiline_parameters = false +ij_java_align_multiline_parameters_in_calls = false +ij_java_align_multiline_parenthesized_expression = false +ij_java_align_multiline_records = true +ij_java_align_multiline_resources = false +ij_java_align_multiline_ternary_operation = false +ij_java_align_multiline_text_blocks = false +ij_java_align_multiline_throws_list = false +ij_java_align_subsequent_simple_methods = false +ij_java_align_throws_keyword = false +ij_java_annotation_parameter_wrap = off +ij_java_array_initializer_new_line_after_left_brace = false +ij_java_array_initializer_right_brace_on_new_line = false +ij_java_array_initializer_wrap = normal +ij_java_assert_statement_colon_on_next_line = false +ij_java_assert_statement_wrap = off +ij_java_assignment_wrap = off +ij_java_binary_operation_sign_on_next_line = true +ij_java_binary_operation_wrap = normal +ij_java_blank_lines_after_anonymous_class_header = 0 +ij_java_blank_lines_after_class_header = 0 +ij_java_blank_lines_after_imports = 2 +ij_java_blank_lines_after_package = 1 +ij_java_blank_lines_around_class = 1 +ij_java_blank_lines_around_field = 0 +ij_java_blank_lines_around_field_in_interface = 0 +ij_java_blank_lines_around_initializer = 1 +ij_java_blank_lines_around_method = 1 +ij_java_blank_lines_around_method_in_interface = 1 +ij_java_blank_lines_before_class_end = 0 +ij_java_blank_lines_before_imports = 1 +ij_java_blank_lines_before_method_body = 0 +ij_java_blank_lines_before_package = 1 +ij_java_block_brace_style = end_of_line +ij_java_block_comment_at_first_column = true +ij_java_call_parameters_new_line_after_left_paren = false +ij_java_call_parameters_right_paren_on_new_line = false +ij_java_call_parameters_wrap = normal +ij_java_case_statement_on_separate_line = true +ij_java_catch_on_new_line = true +ij_java_class_annotation_wrap = split_into_lines +ij_java_class_brace_style = end_of_line +ij_java_class_count_to_use_import_on_demand = 100 +ij_java_class_names_in_javadoc = 1 +ij_java_do_not_indent_top_level_class_members = false +ij_java_do_not_wrap_after_single_annotation = false +ij_java_do_while_brace_force = never +ij_java_doc_add_blank_line_after_description = true +ij_java_doc_add_blank_line_after_param_comments = false +ij_java_doc_add_blank_line_after_return = false +ij_java_doc_add_p_tag_on_empty_lines = true +ij_java_doc_align_exception_comments = true +ij_java_doc_align_param_comments = true +ij_java_doc_do_not_wrap_if_one_line = false +ij_java_doc_enable_formatting = true +ij_java_doc_enable_leading_asterisks = true +ij_java_doc_indent_on_continuation = false +ij_java_doc_keep_empty_lines = false +ij_java_doc_keep_empty_parameter_tag = true +ij_java_doc_keep_empty_return_tag = true +ij_java_doc_keep_empty_throws_tag = true +ij_java_doc_keep_invalid_tags = true +ij_java_doc_param_description_on_new_line = true +ij_java_doc_preserve_line_breaks = true +ij_java_doc_use_throws_not_exception_tag = true +ij_java_else_on_new_line = true +ij_java_entity_dd_suffix = EJB +ij_java_entity_eb_suffix = Bean +ij_java_entity_hi_suffix = Home +ij_java_entity_lhi_prefix = Local +ij_java_entity_lhi_suffix = Home +ij_java_entity_li_prefix = Local +ij_java_entity_pk_class = java.lang.String +ij_java_entity_vo_suffix = VO +ij_java_enum_constants_wrap = off +ij_java_extends_keyword_wrap = normal +ij_java_extends_list_wrap = normal +ij_java_field_annotation_wrap = split_into_lines +ij_java_finally_on_new_line = true +ij_java_for_brace_force = never +ij_java_for_statement_new_line_after_left_paren = false +ij_java_for_statement_right_paren_on_new_line = false +ij_java_for_statement_wrap = off +ij_java_generate_final_locals = true +ij_java_generate_final_parameters = true +ij_java_if_brace_force = always +ij_java_imports_layout = $*, |, de.hybris.**, |, com.hybris.**, |, java.**, |, javax.**, |, org.**, |, com.**, |, de.**, |, * +ij_java_indent_case_from_switch = true +ij_java_insert_inner_class_imports = false +ij_java_insert_override_annotation = true +ij_java_keep_blank_lines_before_right_brace = 10 +ij_java_keep_blank_lines_between_package_declaration_and_header = 2 +ij_java_keep_blank_lines_in_code = 10 +ij_java_keep_blank_lines_in_declarations = 10 +ij_java_keep_control_statement_in_one_line = false +ij_java_keep_first_column_comment = false +ij_java_keep_indents_on_empty_lines = false +ij_java_keep_line_breaks = true +ij_java_keep_multiple_expressions_in_one_line = false +ij_java_keep_simple_blocks_in_one_line = false +ij_java_keep_simple_classes_in_one_line = false +ij_java_keep_simple_lambdas_in_one_line = false +ij_java_keep_simple_methods_in_one_line = false +ij_java_label_indent_absolute = false +ij_java_label_indent_size = 0 +ij_java_lambda_brace_style = end_of_line +ij_java_layout_static_imports_separately = true +ij_java_line_comment_add_space = false +ij_java_line_comment_at_first_column = true +ij_java_message_dd_suffix = EJB +ij_java_message_eb_suffix = Bean +ij_java_method_annotation_wrap = split_into_lines +ij_java_method_brace_style = end_of_line +ij_java_method_call_chain_wrap = normal +ij_java_method_parameters_new_line_after_left_paren = false +ij_java_method_parameters_right_paren_on_new_line = false +ij_java_method_parameters_wrap = normal +ij_java_modifier_list_wrap = false +ij_java_names_count_to_use_import_on_demand = 100 +ij_java_new_line_after_lparen_in_record_header = false +ij_java_parameter_annotation_wrap = off +ij_java_parentheses_expression_new_line_after_left_paren = false +ij_java_parentheses_expression_right_paren_on_new_line = false +ij_java_place_assignment_sign_on_next_line = false +ij_java_prefer_longer_names = true +ij_java_prefer_parameters_wrap = false +ij_java_record_components_wrap = normal +ij_java_repeat_synchronized = true +ij_java_replace_instanceof_and_cast = false +ij_java_replace_null_check = true +ij_java_replace_sum_lambda_with_method_ref = true +ij_java_resource_list_new_line_after_left_paren = false +ij_java_resource_list_right_paren_on_new_line = false +ij_java_resource_list_wrap = on_every_item +ij_java_rparen_on_new_line_in_record_header = false +ij_java_session_dd_suffix = EJB +ij_java_session_eb_suffix = Bean +ij_java_session_hi_suffix = Home +ij_java_session_lhi_prefix = Local +ij_java_session_lhi_suffix = Home +ij_java_session_li_prefix = Local +ij_java_session_si_suffix = Service +ij_java_space_after_closing_angle_bracket_in_type_argument = false +ij_java_space_after_colon = true +ij_java_space_after_comma = true +ij_java_space_after_comma_in_type_arguments = true +ij_java_space_after_for_semicolon = true +ij_java_space_after_quest = true +ij_java_space_after_type_cast = true +ij_java_space_before_annotation_array_initializer_left_brace = false +ij_java_space_before_annotation_parameter_list = false +ij_java_space_before_array_initializer_left_brace = true +ij_java_space_before_catch_keyword = true +ij_java_space_before_catch_left_brace = true +ij_java_space_before_catch_parentheses = true +ij_java_space_before_class_left_brace = true +ij_java_space_before_colon = true +ij_java_space_before_colon_in_foreach = true +ij_java_space_before_comma = false +ij_java_space_before_do_left_brace = true +ij_java_space_before_else_keyword = true +ij_java_space_before_else_left_brace = true +ij_java_space_before_finally_keyword = true +ij_java_space_before_finally_left_brace = true +ij_java_space_before_for_left_brace = true +ij_java_space_before_for_parentheses = true +ij_java_space_before_for_semicolon = false +ij_java_space_before_if_left_brace = true +ij_java_space_before_if_parentheses = true +ij_java_space_before_method_call_parentheses = false +ij_java_space_before_method_left_brace = true +ij_java_space_before_method_parentheses = false +ij_java_space_before_opening_angle_bracket_in_type_parameter = false +ij_java_space_before_quest = true +ij_java_space_before_switch_left_brace = true +ij_java_space_before_switch_parentheses = true +ij_java_space_before_synchronized_left_brace = true +ij_java_space_before_synchronized_parentheses = true +ij_java_space_before_try_left_brace = true +ij_java_space_before_try_parentheses = true +ij_java_space_before_type_parameter_list = false +ij_java_space_before_while_keyword = true +ij_java_space_before_while_left_brace = true +ij_java_space_before_while_parentheses = true +ij_java_space_inside_one_line_enum_braces = false +ij_java_space_within_empty_array_initializer_braces = false +ij_java_space_within_empty_method_call_parentheses = false +ij_java_space_within_empty_method_parentheses = false +ij_java_spaces_around_additive_operators = true +ij_java_spaces_around_assignment_operators = true +ij_java_spaces_around_bitwise_operators = true +ij_java_spaces_around_equality_operators = true +ij_java_spaces_around_lambda_arrow = true +ij_java_spaces_around_logical_operators = true +ij_java_spaces_around_method_ref_dbl_colon = false +ij_java_spaces_around_multiplicative_operators = true +ij_java_spaces_around_relational_operators = true +ij_java_spaces_around_shift_operators = true +ij_java_spaces_around_type_bounds_in_type_parameters = true +ij_java_spaces_around_unary_operator = false +ij_java_spaces_within_angle_brackets = false +ij_java_spaces_within_annotation_parentheses = false +ij_java_spaces_within_array_initializer_braces = true +ij_java_spaces_within_braces = false +ij_java_spaces_within_brackets = false +ij_java_spaces_within_cast_parentheses = false +ij_java_spaces_within_catch_parentheses = false +ij_java_spaces_within_for_parentheses = false +ij_java_spaces_within_if_parentheses = false +ij_java_spaces_within_method_call_parentheses = false +ij_java_spaces_within_method_parentheses = false +ij_java_spaces_within_parentheses = false +ij_java_spaces_within_record_header = false +ij_java_spaces_within_switch_parentheses = false +ij_java_spaces_within_synchronized_parentheses = false +ij_java_spaces_within_try_parentheses = false +ij_java_spaces_within_while_parentheses = false +ij_java_special_else_if_treatment = true +ij_java_subclass_name_suffix = Impl +ij_java_ternary_operation_signs_on_next_line = false +ij_java_ternary_operation_wrap = on_every_item +ij_java_test_name_suffix = Test +ij_java_throws_keyword_wrap = normal +ij_java_throws_list_wrap = normal +ij_java_use_external_annotations = false +ij_java_use_fq_class_names = false +ij_java_use_relative_indents = false +ij_java_use_single_class_imports = true +ij_java_variable_annotation_wrap = off +ij_java_visibility = public +ij_java_while_brace_force = never +ij_java_while_on_new_line = true +ij_java_wrap_comments = true +ij_java_wrap_first_method_in_call_chain = false +ij_java_wrap_long_lines = false + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + +[{*.ant,*.edmx,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.qrc,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}] +ij_xml_align_attributes = true +ij_xml_align_text = false +ij_xml_attribute_wrap = normal +ij_xml_block_comment_at_first_column = true +ij_xml_keep_blank_lines = 2 +ij_xml_keep_indents_on_empty_lines = false +ij_xml_keep_line_breaks = true +ij_xml_keep_line_breaks_in_text = true +ij_xml_keep_whitespaces = false +ij_xml_keep_whitespaces_around_cdata = preserve +ij_xml_keep_whitespaces_inside_cdata = false +ij_xml_line_comment_at_first_column = true +ij_xml_space_after_tag_name = false +ij_xml_space_around_equals_in_attribute = false +ij_xml_space_inside_empty_tag = true +ij_xml_text_wrap = normal + +[{*.yaml,*.yml}] +indent_size = 2 +ij_yaml_align_values_properties = do_not_align +ij_yaml_autoinsert_sequence_marker = true +ij_yaml_block_mapping_on_new_line = false +ij_yaml_indent_sequence_value = true +ij_yaml_keep_indents_on_empty_lines = false +ij_yaml_keep_line_breaks = true +ij_yaml_sequence_on_new_line = false +ij_yaml_space_before_colon = false +ij_yaml_spaces_within_braces = true +ij_yaml_spaces_within_brackets = true diff --git a/.gitmessage b/.gitmessage new file mode 100644 index 0000000..055d59b --- /dev/null +++ b/.gitmessage @@ -0,0 +1,44 @@ +# : (Max 50 char, Why is this change necessary?) +# |<---- Using a Maximum Of 50 Characters ---->| + +# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| +# Explain how the commit addresses the issue + +# IMPORTANT!! Describe any side effects of the change. + +# Provide links or keys to any relevant tickets, articles or other resources +# Examples: "Jira issue [ABC-123]" or "Closes Github issue #123" + +# --- COMMIT END --- +# Type can be +# feat (new feature) +# fix (bug fix) +# refactor (refactoring production code) +# style (formatting, missing semi colons, etc; no code change) +# docs (changes to documentation) +# test (adding or refactoring tests; no production code change) +# chore (updating grunt tasks etc; no production code change) +# wip (work in progress commit to be squashed -- do not push!)** +# -------------------- +# Remember to +# - Capitalize the subject line +# - Use the imperative mood in the subject line +# - Do not end the subject line with a period +# - Separate subject from body with a blank line +# - Use the body to explain what and why vs. how +# - Can use multiple lines with "-" for bullet points in body. +# -------------------- +# ** wip commit type +# A wip commit should only happen on a local branch. These commits are for +# unfinished snapshots that should not be checked into a shared branch. +# These commits should be squashed before changes are merged to +# a shared branch. +# -------------------- +# For more information about this template and useful commit messages, check out +# - https://gist.github.com/median-man/3a7c4324005e96f02691f3a20aeac26b +# - https://gist.github.com/adeekshith/cd4c95a064977cdc6c50 +# - https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message +# - https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html +# - https://8thlight.com/blog/kevin-liddle/2012/09/27/mind-your-git-manners.html +# +# diff --git a/graph-shell/docs/complex.png b/graph-shell/docs/complex.png new file mode 100644 index 0000000000000000000000000000000000000000..ba793ebbb02877c198756369c7a2618f209d3757 GIT binary patch literal 36283 zcmY(rWk4Lkwl0b@f#5-cJHahTa0>(v?(S}bTLvdsg1ZxfI|Luxf(LhZcYn>^_ndnl z{Ft8Un(FGNYSsE=5&l&{3Jrx21qKENP5O(3GVpo|0|So%LIREsJT<$37g!f%DKVJx z5#l}I%~vx`X>)mb7zW@N1Oo?)4Fmt$1o(vswSqzT&oK-PE$|9-lMVZS&t}8@@7dFA z`2RVE$9QcR(NlE;bfRUYstMMVm*X>WuwyYYbucz#@vw7zZ2%+S!3P}LnSqVSJ?w1l zUHCi%DgV=g4>*4Pn3arr%#_)**I7^IGBMJ%r2hxU?UG^dl#zzcJe>{ zNSL{pI9oY_tsLyhU;8yOc5np?Qc}KN=zo9yJ5I2b`TxC=z03c(E#L-OU(c|zv#_!L zZ{NUI1ztbpQ*^d61FrnqzYx2?e_HZ@beo&%(P)<<578ARdJ%8S5HWC|Tyx3k!;o&?X_KRuZ*;;mK=U-WL zJN~p3z(h?60>NcUkoUxCM@$5KBhSXfgc}MZ2YC>{QdEXADyrfmOd!CCLhV4cr=@bP z*(rpnI={pH4P$8wba-TB_ar}A(eH0?XW$gXVDc*U%eL8pK5|I&Oe6hnX$zORQ(5^} z`engQw2+nD<>peAVMHNMADBGx8462$dT~s`%>zu}YSp@jL9Jd>y~YB_^bEH$+iaAM zR&F8z-e=|85IkCca~Tx0{?Y7?yOj80W-v!MCU1)M0*#s8XxY*FcfR6vdk$>{l7nP& z;fcM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x@m92fFWQTGIT!tZflnGXe6hfw^OZ3lw3kBC8y`)_3_Le z*dr^L!6iPutOF{~K@5g?<-cr(faT*-FrKANVcO$it<1Y81w zbh%tPu^el0y}4Y_Y}Yb-UnQ@SH{S>)sL;Dpm|;##MGYmr=UI4mm~TqCvXoxlIQvIiZ18Oi}2v`kXmGqjxju3TI%X@|k<6{HGRm}>< zbfn~k;7$zztHP|Jeotj?7SEnpUI2KHHL0BJnGcQ^a9Vhd-gpxV&$<-Yl*Bgtr=Rlcr?y3V$4I$T~=?xsDS2k5zJGa9wy=L0oRiVzW_Lx%2)Q0(J-Q zN=JoAy?jqDZO_hU1y>vsvL$Vg93WiyH#e@FL{*KQSLs@o)VU$xk}%}q>sefqbRAbT z+@6!q+%hhvyjpOJglAR7gtAn>QX*An&g-_~%)?6~ZR&=ArJ+*aj`CTS-p1T`YxW^g zY#SUI<_D(fpf#7kWkH+)5j-Wnj38Jzkfd^%Py_m4z!0!LYvIUDkR*N&C&}B-+&PCu zZHU{4nNkB;YhhnT_DBRFRN%i8JRFDY2tr*R#1OE{3t)yf7>ES}#*rfy?3uO(11@90 v5U|S&V1_pshy??NfMda)X=^axG6w!1@BYK!8hk;l00000NkvXXu0mjfqMZR! literal 0 HcmV?d00001 diff --git a/graph-shell/docs/complex.puml b/graph-shell/docs/complex.puml new file mode 100644 index 0000000..759f9ce --- /dev/null +++ b/graph-shell/docs/complex.puml @@ -0,0 +1,29 @@ +@startdot +digraph complex { +fontname="Helvetica,Arial,sans-serif" +node [fontname="Helvetica,Arial,sans-serif"] +edge [fontname="Helvetica,Arial,sans-serif"] +node [color=lightblue2, style=filled, shape=circle]; +A +A -> B [label=5]; +A -> H [label=2]; +B +B -> A [label=5]; +B -> C [label=7]; +C +C -> B [label=7]; +C -> D [label=3]; +C -> G [label=4]; +D +D -> C [label=20]; +D -> E [label=4]; +E +E -> F [label=5]; +F +F -> G [label=6]; +G +G -> C [label=4]; +H +H -> G [label=3]; +} +@enddot diff --git a/graph-shell/docs/medium.puml b/graph-shell/docs/medium.puml new file mode 100644 index 0000000..4e53de8 --- /dev/null +++ b/graph-shell/docs/medium.puml @@ -0,0 +1,20 @@ +@startdot +digraph medium { +fontname="Helvetica,Arial,sans-serif" +node [fontname="Helvetica,Arial,sans-serif"] +edge [fontname="Helvetica,Arial,sans-serif"] +node [color=lightblue2, style=filled, shape=circle]; +A +A -> B [label=5]; +B +B -> A [label=5]; +B -> C [label=10]; +C +C -> B [label=20]; +C -> D [label=5]; +D +D -> E [label=5]; +E +E -> B [label=5]; +} +@enddot diff --git a/graph-shell/docs/simple.puml b/graph-shell/docs/simple.puml new file mode 100644 index 0000000..5205658 --- /dev/null +++ b/graph-shell/docs/simple.puml @@ -0,0 +1,17 @@ +@startdot +digraph simple { +fontname="Helvetica,Arial,sans-serif" +node [fontname="Helvetica,Arial,sans-serif"] +edge [fontname="Helvetica,Arial,sans-serif"] +node [color=lightblue2, style=filled, shape=circle]; +A +A -> B [label=7]; +A -> C [label=2]; +B +B -> A [label=3]; +B -> C [label=5]; +C +C -> A [label=1]; +C -> B [label=3]; +} +@enddot diff --git a/graph-shell/src/script/graph2puml.awk b/graph-shell/src/script/graph2puml.awk new file mode 100644 index 0000000..284c554 --- /dev/null +++ b/graph-shell/src/script/graph2puml.awk @@ -0,0 +1,20 @@ +BEGIN { + FS = "[ :,{}]+" + + match(FILENAME, /([^/]+)\.yaml/, GraphName) + print "@startdot" + print "digraph", GraphName[1], "{" + print "fontname=\"Helvetica,Arial,sans-serif\"" + print "node [fontname=\"Helvetica,Arial,sans-serif\"]" + print "edge [fontname=\"Helvetica,Arial,sans-serif\"]" + print "node [color=lightblue2, style=filled, shape=circle];" +} +{ + print $1 + for (i = 2; i < NF; i += 2) + print $1, "->", $i, "[label=" $(i + 1) "];" +} +END { + print "}" + print "@enddot" +} From 459275fdc276fdf45f4387782725a454e842d4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Wed, 7 Jun 2023 13:18:30 +0300 Subject: [PATCH 117/118] add graph2mermaid.awk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #50 Signed-off-by: Jegors Čemisovs --- README.md | 38 ++++++++++++++---------- graph-shell/src/script/graph2mermaid.awk | 17 +++++++++++ graph-shell/src/script/graph2puml.awk | 8 ++++- 3 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 graph-shell/src/script/graph2mermaid.awk diff --git a/README.md b/README.md index 3172ede..8d95bb6 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,16 @@ can also see the [specifications](https://algorithms.jc.id.lv/docs/spock-reports ## Demo. Graph Shell -To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program allows you to select [one of three build-in graph samples](#Graph-Samples) and search for a path using two algorithms. The source code of the program is located in `graph-shell` module. +To demonstrate the work of search algorithms, I made a small console program '[Graph Shell](graph-shell/README.md)'. The program +allows you to select [one of three build-in graph samples](#Graph-Samples) and search for a path using two algorithms. The source +code of the program is located in `graph-shell` module. [![asciicast](https://asciinema.org/a/468058.svg)](https://asciinema.org/a/468058) ### Usage in other projects These algorithms used in the [Hypermetro](https://rabestro.github.io/hypermetro/) project, where they are -utilized to find the optimal route in the metro schema. +utilized to find the optimal route in the metro schema. ## How to use the algorithms in your program @@ -30,7 +32,11 @@ The first step is to create a graph structure. The Graph interface is generic, s and any [Number](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Number.html) type for distance. ### Example -In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](docs/assets/complex.gif). + +In the following Java code we create a graph structure with eight nodes. We +use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex +identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the +distance. You can see the graphic representation of the scheme [here](docs/assets/complex.gif). ```java var graph = Graph.of(Map.of( @@ -45,7 +51,7 @@ var graph = Graph.of(Map.of( )); ``` -The second step is creating a search algorithm class. You can choose one of the two algorithms. +The second step is creating a search algorithm class. You can choose one of the two algorithms. ### Example @@ -66,11 +72,11 @@ var routeOne = shortest.findPath(graph, source, target); var routeTwo = fastest.findPath(graph, source, target); ``` -As result, you get a list with the path. +As result, you get a list with the path. ```java -routeOne == ['D', 'C'] -routeTwo == ['D', 'E', 'F', 'G', 'C'] +routeOne==['D','C'] + routeTwo==['D','E','F','G','C'] ``` ## Unit Tests @@ -83,12 +89,15 @@ Tests are written in Groove language. For unit testing, the [Spock Framework](ht ```mermaid flowchart LR - A --> |7| B - A --> |2| C - B --> |3| A - B --> |5| C - C --> |1| A - C --> |3| B + A((A)) + B((B)) + C((C)) + A -->|7| B + A -->|2| C + B -->|3| A + B -->|5| C + C -->|1| A + C -->|3| B ``` ![Small Graph](docs/assets/small.gif) @@ -127,5 +136,4 @@ flowchart LR H --> |3 | G ``` -![Complex Graph](docs/assets/complex.gif) - +![Complex Graph](docs/assets/complex.gif) \ No newline at end of file diff --git a/graph-shell/src/script/graph2mermaid.awk b/graph-shell/src/script/graph2mermaid.awk new file mode 100644 index 0000000..32d8aef --- /dev/null +++ b/graph-shell/src/script/graph2mermaid.awk @@ -0,0 +1,17 @@ +#!/usr/bin/env gawk --exec +# +# Copyright (c) 2023 Jegors Čemisovs +# License: MIT License +# Repository: https://github.com/rabestro/graph-pathfinding-algorithms +# +BEGIN { + FS = "[ :,{}]+" + print "flowchart LR" +} +{ + node = $1 + print node "((" node "))" + + for (i = 2; i < NF; i += 2) + printf "%s --> |%2d| %s\n", node, $(i + 1), $i +} \ No newline at end of file diff --git a/graph-shell/src/script/graph2puml.awk b/graph-shell/src/script/graph2puml.awk index 284c554..8f7da75 100644 --- a/graph-shell/src/script/graph2puml.awk +++ b/graph-shell/src/script/graph2puml.awk @@ -1,3 +1,9 @@ +#!/usr/bin/env gawk --exec +# +# Copyright (c) 2023 Jegors Čemisovs +# License: MIT License +# Repository: https://github.com/rabestro/graph-pathfinding-algorithms +# BEGIN { FS = "[ :,{}]+" @@ -17,4 +23,4 @@ BEGIN { END { print "}" print "@enddot" -} +} \ No newline at end of file From a2309a492a17bb35f50a3c979a4f36e51c6a720f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jegors=20=C4=8Cemisovs?= Date: Fri, 1 Sep 2023 11:08:35 +0300 Subject: [PATCH 118/118] Update README.md --- graph-shell/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph-shell/README.md b/graph-shell/README.md index cf0fa2b..ee363c1 100644 --- a/graph-shell/README.md +++ b/graph-shell/README.md @@ -1,5 +1,5 @@ --- -title: Sample application: Graph Shell +title: "Sample application: Graph Shell" --- ## About