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 828691e..fef3784 100644 --- a/algorithm/build.gradle +++ b/algorithm/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'lv.id.jc' -version '1.1' +version '1.1-SNAPSHOT' repositories { mavenCentral() 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/lv/id/jc/algorithm/graph/BreadthFirstSearchSpec.groovy similarity index 77% rename from algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/BreadthFirstSearchSpec.groovy index 7feffbd..d1ddaa8 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/BreadthFirstSearchSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/BreadthFirstSearchSpec.groovy @@ -1,4 +1,4 @@ -package lv.id.jc.graph +package lv.id.jc.algorithm.graph import lv.id.jc.algorithm.graph.BreadthFirstSearch import lv.id.jc.algorithm.graph.Graph @@ -14,20 +14,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 +39,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 +48,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 +72,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 +86,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/lv/id/jc/algorithm/graph/DijkstrasAlgorithmSpec.groovy similarity index 80% rename from algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/DijkstrasAlgorithmSpec.groovy index db283c6..ec6f6a1 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/DijkstrasAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/DijkstrasAlgorithmSpec.groovy @@ -1,4 +1,4 @@ -package lv.id.jc.graph +package lv.id.jc.algorithm.graph import lv.id.jc.algorithm.graph.DijkstrasAlgorithm import lv.id.jc.algorithm.graph.Graph @@ -12,20 +12,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 +37,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 +46,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 +66,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 +78,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 +104,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 +118,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/lv/id/jc/algorithm/graph/GraphSpec.groovy similarity index 98% rename from algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/GraphSpec.groovy index 5d87b77..9e2bdb9 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/GraphSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/GraphSpec.groovy @@ -1,4 +1,4 @@ -package lv.id.jc.graph +package lv.id.jc.algorithm.graph import lv.id.jc.algorithm.graph.Graph import spock.lang.Narrative diff --git a/algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy similarity index 86% rename from algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy rename to algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy index e3b51a2..d88ec0f 100644 --- a/algorithm/src/test/groovy/lv/id/jc/graph/SearchAlgorithmSpec.groovy +++ b/algorithm/src/test/groovy/lv/id/jc/algorithm/graph/SearchAlgorithmSpec.groovy @@ -1,4 +1,4 @@ -package lv.id.jc.graph +package lv.id.jc.algorithm.graph import lv.id.jc.algorithm.graph.BreadthFirstSearch import lv.id.jc.algorithm.graph.DijkstrasAlgorithm @@ -16,7 +16,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 +28,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/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/application/build.gradle b/application/build.gradle deleted file mode 100644 index 7d38e08..0000000 --- a/application/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -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/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/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 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 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/sample-java/build.gradle b/sample-java/build.gradle new file mode 100644 index 0000000..7a1e561 --- /dev/null +++ b/sample-java/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'application' +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + +dependencies { + implementation project(':algorithm') +} + +application { + 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'