Returns the edges of the given vertex,
+ or null if this graph contains no given vertex.
+
+
A return value of null does not necessarily
+ indicate that the specified vertex is not present in the graph;
+ it's also possible that in the graph schema, null was specified
+ for the edges of this vertex instead of an empty map.
Parameters:
-
id - vertex
+
vertex - vertex
Returns:
-
all links for the given vertex
+
all links for the given vertex
+ or null if no such vertex in the 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.
Type Parameters:
T - the type of vertex in this graph
Parameters:
schema - of the graph
Returns:
-
graph with given schema
+
graph object with given schema
diff --git a/docs/api/lv.id.jc.algorithm/lv/id/jc/algorithm/graph/SearchAlgorithm.html b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/SearchAlgorithm.html
similarity index 97%
rename from docs/api/lv.id.jc.algorithm/lv/id/jc/algorithm/graph/SearchAlgorithm.html
rename to docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/SearchAlgorithm.html
index 52266d1..370347e 100644
--- a/docs/api/lv.id.jc.algorithm/lv/id/jc/algorithm/graph/SearchAlgorithm.html
+++ b/docs/api/lv.id.jc.algorithm.graph/lv/id/jc/algorithm/graph/SearchAlgorithm.html
@@ -1,12 +1,12 @@
-
+
SearchAlgorithm
-
+
@@ -69,14 +69,14 @@
The module contains an interface for a graph and an interface for a graph search algorithm.
+ There is an implementation of two search algorithms:
+ Dijkstra's algorithm and Breadth First Search algorithm.
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
Coverage Summary for Class: BreadthFirstSearch (lv.id.jc.algorithm.graph)14 *
15 * The algorithm doesn't take into account the distance between nodes.
16 *
-17 * @param <T> type of vertex id
-18 */
-19 public class BreadthFirstSearch<T> implements SearchAlgorithm<T> {
-20
-21 @Override
-22 public List<T> findPath(Graph<T> graph, T source, T target) {
-23 final var queue = new LinkedList<T>();
-24 final var visited = new HashSet<T>();
-25 final var previous = new HashMap<T, T>();
-26 queue.add(source);
-27
-28 while (!queue.isEmpty()) {
-29 final var node = queue.removeFirst();
-30 if (target.equals(node)) {
-31 final var path = new LinkedList<T>();
-32 iterate(node, Objects::nonNull, previous::get).forEach(path::addFirst);
-33 return path;
-34 }
-35 visited.add(node);
-36 graph.edges(node).keySet().stream()
-37 .filter(not(visited::contains))
-38 .forEach(it -> {
-39 previous.computeIfAbsent(it, x -> node);
-40 queue.addLast(it);
-41 });
-42 }
-43 return List.of();
-44 }
-45
-46 }
+17 * @author Jegors Čemisovs
+18 * @param <T> the type of vertex
+19 * @since 1.0
+20 */
+21 public class BreadthFirstSearch<T> implements SearchAlgorithm<T> {
+22
+23 @Override
+24 public List<T> findPath(Graph<T> graph, T source, T target) {
+25 var queue = new LinkedList<T>();
+26 var visited = new HashSet<T>();
+27 var previous = new HashMap<T, T>();
+28 queue.add(source);
+29
+30 while (!queue.isEmpty()) {
+31 var node = queue.removeFirst();
+32 if (target.equals(node)) {
+33 var path = new LinkedList<T>();
+34 iterate(node, Objects::nonNull, previous::get).forEach(path::addFirst);
+35 return path;
+36 }
+37 visited.add(node);
+38 graph.edges(node).keySet().stream()
+39 .filter(not(visited::contains))
+40 .forEach(it -> {
+41 previous.computeIfAbsent(it, x -> node);
+42 queue.addLast(it);
+43 });
+44 }
+45 return List.of();
+46 }
+47
+48 }
@@ -145,7 +147,7 @@
Coverage Summary for Class: BreadthFirstSearch (lv.id.jc.algorithm.graph)
-
Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)
-
Graph$getDistance
+
Graph$getDistance$0
+
+
+
Graph$of
Total
@@ -90,37 +93,69 @@
Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)
5 import java.util.stream.IntStream;
67 /**
-8 * A generic graph representation
+8 * An interface for weighted directed graph (network)
9 *
-10 * @param <T> type of vertex id
-11 */
-12 public record Graph<T>(Map<T, Map<T, Number>> nodes) {
-13
-14 /**
-15 * Edges of the given vertex
-16 *
-17 * @param id vertex (node)
-18 * @return all connections for the given vertex id
-19 */
-20 public Map<T, Number> edges(T id) {
-21 return nodes().get(id);
-22 }
-23
-24 /**
-25 * Returns the calculated distance for the given path
-26 *
-27 * @param path the list of vertex ids representing the path
-28 * @return distance for the given path as double
-29 * @throws NullPointerException if path is incorrect and contains more than one vertex
-30 */
-31 public double getDistance(final List<T> path) {
-32 return IntStream
-33 .range(1, path.size())
-34 .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i)))
-35 .mapToDouble(Number::doubleValue)
-36 .sum();
-37 }
-38 }
+10 * @param <T> the type of vertex in this graph
+11 * @author Jegors Čemisovs
+12 * @since 1.1
+13 */
+14 @FunctionalInterface
+15 public interface Graph<T> {
+16 /**
+17 * Schema of the graph.
+18 *
+19
+20 *
+21 * @return the graph scheme
+22 */
+23 Map<T, Map<T, Number>> schema();
+24
+25 /**
+26 * Returns the edges of the given vertex,
+27 * or {@code null} if this graph contains no given vertex.
+28 *
+29 * <p>A return value of {@code null} does not <i>necessarily</i>
+30 * indicate that the specified vertex is not present in the graph;
+31 * it's also possible that in the graph schema, {@code null} was specified
+32 * for the edges of this vertex instead of an empty map.
+33 *
+34 * @param vertex vertex
+35 * @return all links for the given vertex
+36 * or null if no such vertex in the graph
+37 */
+38 default Map<T, Number> edges(T vertex) {
+39 return schema().get(vertex);
+40 }
+41
+42 /**
+43 * Calculate the distance for the given path
+44 *
+45 * @param path the list of vertices representing the path
+46 * @return distance for the given path as double
+47 * @throws NullPointerException if {@code path} is incorrect and contains more than one vertex
+48 */
+49 default double getDistance(List<T> path) {
+50 return IntStream
+51 .range(1, path.size())
+52 .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i)))
+53 .mapToDouble(Number::doubleValue)
+54 .sum();
+55 }
+56
+57 /**
+58 * Creates a Graph object by given schema.
+59 *
+60 * In a graph schema, each vertex is assigned an edge map.
+61 * If the vertex has no edges, then it should be assigned an empty map.
+62 *
+63 * @param schema of the graph
+64 * @param <T> the type of vertex in this graph
+65 * @return graph object with given schema
+66 */
+67 static <T> Graph<T> of(Map<T, Map<T, Number>> schema) {
+68 return () -> schema;
+69 }
+70 }
@@ -147,7 +182,7 @@
Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)
Coverage Summary for Class: SearchAlgorithm (lv.id.jc.algorithm.graph)
5 /**
6 * A functional interface for graph search algorithm
7 *
-8 * @param <T> type of vertex id
-9 */
-10 @FunctionalInterface
-11 public interface SearchAlgorithm<T> {
-12 /**
-13 * Find the path from the source node to the target
-14 *
-15 * @param graph The graph in which we search for the path
-16 * @param source Search starting point identifier
-17 * @param target Search finish point identifier
-18 * @return Path found or empty list if path cannot be found
-19 */
-20 List<T> findPath(Graph<T> graph, T source, T target);
-21 }
+8 * @author Jegors Čemisovs
+9 * @param <T> the type of vertex
+10 * @since 1.0
+11 */
+12 @FunctionalInterface
+13 public interface SearchAlgorithm<T> {
+14 /**
+15 * Find the path from the source node to the target
+16 *
+17 * @param graph The graph in which we search for the path
+18 * @param source Search starting point identifier
+19 * @param target Search finish point identifier
+20 * @return Path found or empty list if path cannot be found
+21 */
+22 List<T> findPath(Graph<T> graph, T source, T target);
+23 }
@@ -87,7 +89,7 @@
Coverage Summary for Class: SearchAlgorithm (lv.id.jc.algorithm.graph)
Coverage Summary for Class: BreadthFirstSearch (lv.id.jc.algorithm.graph)
-
-
-
-
Class
-
- Class, %
-
-
- Method, %
-
-
- Line, %
-
-
-
-
BreadthFirstSearch
-
-
- 100%
-
-
- (1/1)
-
-
-
-
- 100%
-
-
- (3/3)
-
-
-
-
- 94.7%
-
-
- (18/19)
-
-
-
-
-
-
-
-
-
-
-
-
1 package lv.id.jc.algorithm.graph;
-2
-3 import java.util.HashMap;
-4 import java.util.HashSet;
-5 import java.util.LinkedList;
-6 import java.util.List;
-7 import java.util.Objects;
-8
-9 import static java.util.function.Predicate.not;
-10 import static java.util.stream.Stream.iterate;
-11
-12 /**
-13 * Algorithm for finding the shortest paths between nodes in a graph.
-14 *
-15 * The algorithm doesn't take into account the distance between nodes.
-16 *
-17 * @param <T> type of vertex id
-18 */
-19 public class BreadthFirstSearch<T> implements SearchAlgorithm<T> {
-20
-21 @Override
-22 public List<T> findPath(Graph<T> graph, T source, T target) {
-23 final var queue = new LinkedList<T>();
-24 final var visited = new HashSet<T>();
-25 final var previous = new HashMap<T, T>();
-26 queue.add(source);
-27
-28 while (!queue.isEmpty()) {
-29 final var node = queue.removeFirst();
-30 if (target.equals(node)) {
-31 final var path = new LinkedList<T>();
-32 iterate(node, Objects::nonNull, previous::get).forEach(path::addFirst);
-33 return path;
-34 }
-35 visited.add(node);
-36 graph.edges(node).keySet().stream()
-37 .filter(not(visited::contains))
-38 .forEach(it -> {
-39 previous.computeIfAbsent(it, x -> node);
-40 queue.addLast(it);
-41 });
-42 }
-43 return List.of();
-44 }
-45
-46 }
-
Coverage Summary for Class: DijkstrasAlgorithm (lv.id.jc.algorithm.graph)
-
-
-
-
Class
-
- Class, %
-
-
- Method, %
-
-
- Line, %
-
-
-
-
DijkstrasAlgorithm
-
-
- 100%
-
-
- (1/1)
-
-
-
-
- 100%
-
-
- (3/3)
-
-
-
-
- 100%
-
-
- (18/18)
-
-
-
-
-
-
-
-
-
-
-
-
1 package lv.id.jc.algorithm.graph;
-2
-3 import java.util.HashMap;
-4 import java.util.LinkedList;
-5 import java.util.List;
-6 import java.util.Objects;
-7
-8 import static java.util.stream.Stream.iterate;
-9
-10 /**
-11 * Algorithm for finding the fastest paths between nodes in a graph.
-12 *
-13 * The algorithm uses information about edge's distance to find the fastest path.
-14 *
-15 * @param <T> type of vertex id
-16 */
-17 public class DijkstrasAlgorithm<T> implements SearchAlgorithm<T> {
-18
-19 @Override
-20 public List<T> findPath(Graph<T> graph, T source, T target) {
-21 final var queue = new LinkedList<T>();
-22 final var distances = new HashMap<T, Double>();
-23 final var previous = new HashMap<T, T>();
-24 queue.add(source);
-25 distances.put(source, .0);
-26
-27 while (!queue.isEmpty()) {
-28 final var prev = queue.removeFirst();
-29 graph.edges(prev).forEach((node, time) -> {
-30 final var distance = distances.get(prev) + time.doubleValue();
-31 if (distance < distances.getOrDefault(node, Double.MAX_VALUE)) {
-32 previous.put(node, prev);
-33 distances.put(node, distance);
-34 queue.addLast(node);
-35 }
-36 });
-37 }
-38
-39 final var path = new LinkedList<T>();
-40 iterate(target, Objects::nonNull, previous::get).forEach(path::addFirst);
-41 return path;
-42 }
-43
-44 }
-
Coverage Summary for Class: Graph (lv.id.jc.algorithm.graph)
-
-
-
-
-
Class
-
- Method, %
-
-
- Line, %
-
-
-
-
Graph
-
-
- 100%
-
-
- (3/3)
-
-
-
-
- 100%
-
-
- (7/7)
-
-
-
-
-
Graph$getDistance
-
-
-
Total
-
-
- 100%
-
-
- (3/3)
-
-
-
-
- 100%
-
-
- (7/7)
-
-
-
-
-
-
-
-
-
-
-
1 package lv.id.jc.algorithm.graph;
-2
-3 import java.util.List;
-4 import java.util.Map;
-5 import java.util.stream.IntStream;
-6
-7 /**
-8 * A generic graph representation
-9 *
-10 * @param <T> type of vertex id
-11 */
-12 public record Graph<T>(Map<T, Map<T, Number>> nodes) {
-13
-14 /**
-15 * Edges of the given vertex
-16 *
-17 * @param id vertex (node)
-18 * @return all connections for the given vertex id
-19 */
-20 public Map<T, Number> edges(T id) {
-21 return nodes().get(id);
-22 }
-23
-24 /**
-25 * Returns the calculated distance for the given path
-26 *
-27 * @param path the list of vertex ids representing the path
-28 * @return distance for the given path as double
-29 * @throws NullPointerException if path is incorrect and contains more than one vertex
-30 */
-31 public double getDistance(final List<T> path) {
-32 return IntStream
-33 .range(1, path.size())
-34 .mapToObj(i -> edges(path.get(i - 1)).get(path.get(i)))
-35 .mapToDouble(Number::doubleValue)
-36 .sum();
-37 }
-38 }
-
Coverage Summary for Class: SearchAlgorithm (lv.id.jc.algorithm.graph)
-
-
-
-
-
Class
-
-
-
SearchAlgorithm$findPath
-
-
-
Total
-
-
-
-
-
-
-
-
-
1 package lv.id.jc.algorithm.graph;
-2
-3 import java.util.List;
-4
-5 /**
-6 * A functional interface for graph search algorithm
-7 *
-8 * @param <T> type of vertex id
-9 */
-10 @FunctionalInterface
-11 public interface SearchAlgorithm<T> {
-12 /**
-13 * Find the path from the source node to the target
-14 *
-15 * @param graph The graph in which we search for the path
-16 * @param source Search starting point identifier
-17 * @param target Search finish point identifier
-18 * @return Path found or empty list if path cannot be found
-19 */
-20 List<T> findPath(Graph<T> graph, T source, T target);
-21 }
-
-
-
-
-
-
-
-
-
diff --git a/docs/inspection/index.html b/docs/inspection/index.html
new file mode 100644
index 0000000..f1d6f94
--- /dev/null
+++ b/docs/inspection/index.html
@@ -0,0 +1 @@
+IntelliJ IDEA inspection report
'findPath' in 'lv.id.jc.algorithm.graph.BreadthFirstSearch<java.lang.String>' cannot be applied to '(lv.id.jc.algorithm.graph.Graph<java.lang.Object>, java.lang.String, java.lang.String)' (at line 32)
'findPath' in 'lv.id.jc.algorithm.graph.BreadthFirstSearch<java.lang.String>' cannot be applied to '(lv.id.jc.algorithm.graph.Graph<java.lang.Object>, java.lang.String, java.lang.String)' (at line 32)
public interface Graph in package lv.id.jc.algorithm.graph
No problems found
Location
public interface SearchAlgorithm in package lv.id.jc.algorithm.graph
No problems found
Location
public interface SearchAlgorithm in package lv.id.jc.algorithm.graph
No problems found
Location
public method List<T> findPath(Graph<T> graph, T source, T target) in interface SearchAlgorithm(lv.id.jc.algorithm.graph)
Problem synopsis
Method is never used as a member of this interface, but only as a member of the implementation class(es). The project will stay compilable if the method is removed from the interface.
Problem resolution
Safe delete
Comment out
Add as Entry Point
Uses the following
Graph(lv.id.jc.algorithm.graph) Has reachable implementation instantiations. 1 instantiation found in the project code.
Derived methods
List<T> findPath(Graph<T>, T, T)(lv.id.jc.algorithm.graph.BreadthFirstSearch) Not Reachable. 2 usages found in the project code.
List<T> findPath(Graph<T>, T, T)(lv.id.jc.algorithm.graph.DijkstrasAlgorithm) Not Reachable. 2 usages found in the project code.
\ No newline at end of file
diff --git a/docs/inspection/script.js b/docs/inspection/script.js
new file mode 100644
index 0000000..9a267ef
--- /dev/null
+++ b/docs/inspection/script.js
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @author: Dmitry Batkovich
+ */
+function navigate(an_id) {
+ problem_div = document.getElementById("d" + an_id);
+ preview_div = document.getElementById("preview");
+ preview_div.innerHTML = problem_div != null ? problem_div.innerHTML : "Select a problem element in tree";
+}
\ No newline at end of file
diff --git a/docs/inspection/styles.css b/docs/inspection/styles.css
new file mode 100644
index 0000000..41cc324
--- /dev/null
+++ b/docs/inspection/styles.css
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2000-2016 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+html {
+ font-family: \Helvetica Neue\, Helvetica, Arial, \Lucida Grande\, sans-serif;
+}
+
+body {
+ color: #4C4C4C;
+ margin: 60px 60px 0 60px;
+}
+
+p {
+ font-size: 1em;
+ margin: 0 0 1em 0;
+}
+
+.grayout {
+ opacity: 0.6;
+}
+
+body, input, select, textarea, th, td {
+ font-size: 1em;
+}
+
+li {
+ position: relative;
+ list-style: none;
+}
+
+label:hover {
+ color: #0C479D;
+ text-decoration: underline;
+}
+
+li::before {
+ content: "\23FA";
+ margin: 0;
+}
+
+li input {
+ position: absolute;
+ left: 0;
+ margin-left: 0;
+ background: none;
+ opacity: 0;
+ z-index: 2;
+ cursor: pointer;
+ height: 1em;
+ width: 1em;
+ top: 0;
+}
+
+li input + ol {
+ margin: -15px 0 0 -44px;
+ height: 1em;
+}
+
+li input + ol > li {
+ display: none;
+ margin-left: -14px !important;
+ padding-left: 1px;
+}
+
+li label {
+ padding-left: 5px;
+}
+
+li input:checked + ol {
+ margin: -20px 0 0 -44px;
+ padding: 25px 0 0 80px;
+ height: auto;
+}
+
+li input:checked + ol > li {
+ display: block;
+ margin: 0 0 2px;
+}
+
+li input:checked + ol > li:last-child {
+ margin: 0 0 1px;
+}
+
+div.location {
+ margin-left: 40px;
+}
\ No newline at end of file
diff --git a/docs/spock-reports/aggregated_report.json b/docs/spock-reports/aggregated_report.json
index 321faf7..1419c96 100644
--- a/docs/spock-reports/aggregated_report.json
+++ b/docs/spock-reports/aggregated_report.json
@@ -1 +1 @@
-{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""}}
\ No newline at end of file
+{"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":162},"title":"","narrative":""},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":46},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":66},"title":"","narrative":""},"graph.GraphSpec":{"executedFeatures":["should calculate distance"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":19},"title":"","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":133},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":40},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":67},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":125},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":115},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":43},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":127},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":136},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":44},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":80},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":112},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":2,"totalFeatures":2,"passed":2,"successRate":1.0,"time":204},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":61},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":74},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":154},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should returns an empty path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":0,"successRate":0.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":4,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":54},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":3,"passed":1,"successRate":1.0,"time":31},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":48},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":10},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":3,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":2,"successRate":0.4,"time":96},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":69},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":3,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":0,"successRate":0.0,"time":62},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":4,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":0,"successRate":0.0,"time":46},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":0,"successRate":0.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":84},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":85},"title":"Comparison of two algorithms","narrative":""},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":116},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":68},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":17},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":54},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should throw NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":53},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":1,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":0,"successRate":0.0,"time":47},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":5,"passed":1,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":3,"totalFeatures":3,"passed":3,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":16},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":16},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":3,"successRate":0.75,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path for an empty graph","should return an empty path if can't find a route"],"ignoredFeatures":[],"stats":{"failures":0,"errors":1,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":4,"successRate":0.8,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":38},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":7},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":63},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":32},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":78},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":23},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":47},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":0},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":31},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":70},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":15},"title":"Comparison of two algorithms","narrative":""},"graph.BreadthFirstSearchSpec":{"executedFeatures":["should find a route for complex graph","should find a route for simple graph","should return an empty path if can't find a route","should thrown NPE path for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":4,"totalFeatures":4,"passed":4,"successRate":1.0,"time":69},"title":"Breadth First Search Algorithm","narrative":"Breadth First Search algorithm for finding the shortest paths between nodes in a graph"},"graph.DijkstrasAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph","should find a route for a medium graph","should find a route for a simple graph","should return an empty path if can't find a route","should thrown NPE for an empty graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":22},"title":"Dijkstra's Algorithm","narrative":"Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph"},"graph.GraphSpec":{"executedFeatures":["should be zero distance for an empty path","should be zero distance for any one node path","should calculate distance for a path","should return edges for a given node","should throw NPE for incorrect path"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":5,"totalFeatures":5,"passed":5,"successRate":1.0,"time":37},"title":"Generic Graph","narrative":"A generic implementation of Graph structure"},"graph.SearchAlgorithmSpec":{"executedFeatures":["should find a route for a complex graph"],"ignoredFeatures":[],"stats":{"failures":0,"errors":0,"skipped":0,"totalRuns":1,"totalFeatures":1,"passed":1,"successRate":1.0,"time":3},"title":"Comparison of two algorithms","narrative":""}}
\ No newline at end of file
diff --git a/docs/spock-reports/graph.BreadthFirstSearchSpec.html b/docs/spock-reports/graph.BreadthFirstSearchSpec.html
index 56a1b1f..eb40416 100644
--- a/docs/spock-reports/graph.BreadthFirstSearchSpec.html
+++ b/docs/spock-reports/graph.BreadthFirstSearchSpec.html
@@ -251,7 +251,7 @@
Report for graph.BreadthFirstSearchSpec
Summary:
-
Created on Mon Jan 03 14:12:34 EET 2022 by jegors.cemisovs
+
Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
+should thrown NPE path for an empty graph
+
+Return
+
+
+
+
+
+
+
Given:
+
+
+
an empty graph
+
+
+
+
+
+
def graph = Graph.of([:])
+
+
+
+
+
When:
+
+
+
we use Dijkstra's algorithm to find a path
+
+
+
+
+
+
algorithm.findPath(graph, 'A', 'B')
+
+
+
+
+
Then:
+
+
+
the exception was thrown
+
+
+
+
+
+
thrown NullPointerException
+
+
+
+
should return an empty path if can't find a route
diff --git a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html
index 6170b0d..6125802 100644
--- a/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html
+++ b/docs/spock-reports/graph.DijkstrasAlgorithmSpec.html
@@ -251,7 +251,7 @@
Report for graph.DijkstrasAlgorithmSpec
Summary:
-
Created on Mon Jan 03 14:12:35 EET 2022 by jegors.cemisovs
+
Created on Mon Jan 03 21:16:51 EET 2022 by jegors.cemisovs
diff --git a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java
index 0f08f94..6c6cfa2 100644
--- a/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java
+++ b/src/main/java/lv/id/jc/algorithm/graph/BreadthFirstSearch.java
@@ -15,7 +15,7 @@
* The algorithm doesn't take into account the distance between nodes.
*
* @author Jegors Čemisovs
- * @param the type of vertex id
+ * @param the type of vertex
* @since 1.0
*/
public class BreadthFirstSearch implements SearchAlgorithm {
diff --git a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java
index b0c5858..c6769c7 100644
--- a/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java
+++ b/src/main/java/lv/id/jc/algorithm/graph/DijkstrasAlgorithm.java
@@ -13,7 +13,7 @@
* The algorithm uses information about edge's distance to find the fastest path.
*
* @author Jegors Čemisovs
- * @param the type of vertex id
+ * @param the type of vertex
* @since 1.0
*/
public class DijkstrasAlgorithm implements SearchAlgorithm {
diff --git a/src/main/java/lv/id/jc/algorithm/graph/Graph.java b/src/main/java/lv/id/jc/algorithm/graph/Graph.java
index b715ea0..0fa674d 100644
--- a/src/main/java/lv/id/jc/algorithm/graph/Graph.java
+++ b/src/main/java/lv/id/jc/algorithm/graph/Graph.java
@@ -7,27 +7,36 @@
/**
* An interface for weighted directed graph (network)
*
- * @author Jegors Čemisovs
* @param the type of vertex in this graph
- * @since 1.0
+ * @author Jegors Čemisovs
+ * @since 1.1
*/
@FunctionalInterface
public interface Graph {
/**
- * Schema of the graph
+ * Schema of the graph.
+ *
+
*
* @return the graph scheme
*/
Map> schema();
/**
- * Edges of the given vertex
+ * Returns the edges of the given vertex,
+ * or {@code null} if this graph contains no given vertex.
+ *
+ *
A return value of {@code null} does not necessarily
+ * indicate that the specified vertex is not present in the graph;
+ * it's also possible that in the graph schema, {@code null} was specified
+ * for the edges of this vertex instead of an empty map.
*
- * @param id vertex
+ * @param vertex vertex
* @return all links for the given vertex
+ * or null if no such vertex in the graph
*/
- default Map edges(T id) {
- return schema().get(id);
+ default Map edges(T vertex) {
+ return schema().get(vertex);
}
/**
@@ -35,7 +44,7 @@ default Map edges(T id) {
*
* @param path the list of vertices representing the path
* @return distance for the given path as double
- * @throws NullPointerException if path is incorrect and contains more than one vertex
+ * @throws NullPointerException if {@code path} is incorrect and contains more than one vertex
*/
default double getDistance(List path) {
return IntStream
@@ -46,11 +55,14 @@ default double getDistance(List path) {
}
/**
- * Creates a Graph object by given schema
+ * Creates a Graph object by given schema.
+ *
+ * In a graph schema, each vertex is assigned an edge map.
+ * If the vertex has no edges, then it should be assigned an empty map.
*
* @param schema of the graph
- * @param the type of vertex in this graph
- * @return graph with given schema
+ * @param the type of vertex in this graph
+ * @return graph object with given schema
*/
static Graph of(Map> schema) {
return () -> schema;
diff --git a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java
index 7048c50..79692d7 100644
--- a/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java
+++ b/src/main/java/lv/id/jc/algorithm/graph/SearchAlgorithm.java
@@ -6,7 +6,7 @@
* A functional interface for graph search algorithm
*
* @author Jegors Čemisovs
- * @param the type of vertex id
+ * @param the type of vertex
* @since 1.0
*/
@FunctionalInterface
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
index bfbbd92..941d8df 100644
--- a/src/main/java/module-info.java
+++ b/src/main/java/module-info.java
@@ -1,3 +1,8 @@
-module lv.id.jc.algorithm {
+/**
+ * The module contains an interface for a graph and an interface for a graph search algorithm.
+ * There is an implementation of two search algorithms:
+ * Dijkstra's algorithm and Breadth First Search algorithm.
+ */
+module lv.id.jc.algorithm.graph {
exports lv.id.jc.algorithm.graph;
}
\ No newline at end of file
diff --git a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy b/src/test/groovy/graph/BreadthFirstSearchSpec.groovy
index 5d7eb3a..1d76485 100644
--- a/src/test/groovy/graph/BreadthFirstSearchSpec.groovy
+++ b/src/test/groovy/graph/BreadthFirstSearchSpec.groovy
@@ -71,6 +71,17 @@ class BreadthFirstSearchSpec extends Specification {
time = shortest.size() - 1
}
+ def 'should thrown NPE path for an empty graph'() {
+ given: 'an empty graph'
+ def graph = Graph.of([:])
+
+ when: "we use Dijkstra's algorithm to find a path"
+ algorithm.findPath(graph, 'A', 'B')
+
+ then: 'the exception was thrown'
+ thrown NullPointerException
+ }
+
def "should return an empty path if can't find a route"() {
given: 'a simple graph with no edge between nodes'
def graph = Graph.of([A: [:], B: [:]])
diff --git a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy b/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy
index a90e0f4..9ba35d4 100644
--- a/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy
+++ b/src/test/groovy/graph/DijkstrasAlgorithmSpec.groovy
@@ -9,7 +9,7 @@ import spock.lang.*
@Narrative("Dijkstra's algorithm is an algorithm for finding the fastest paths between nodes in a graph")
class DijkstrasAlgorithmSpec extends Specification {
@Subject
- def algorithm = new DijkstrasAlgorithm()
+ def algorithm = new DijkstrasAlgorithm()
def 'should find a route for a simple graph'() {
given: 'A simple graph'
@@ -103,14 +103,14 @@ class DijkstrasAlgorithmSpec extends Specification {
'D' | 'H' || 33 | ['D', 'E', 'F', 'G', 'C', 'B', 'A', 'H']
}
- def 'should throw NPE for an empty graph'() {
+ def 'should thrown NPE for an empty graph'() {
given: 'an empty graph'
def graph = Graph.of([:])
when: "we use Dijkstra's algorithm to find a path"
- algorithm.findPath(graph, _, _)
+ algorithm.findPath(graph, 'A', 'B')
- then: 'the exception thrown'
+ then: 'the exception was thrown'
thrown NullPointerException
}
diff --git a/src/test/groovy/graph/SearchAlgorithmSpec.groovy b/src/test/groovy/graph/SearchAlgorithmSpec.groovy
index 64cb16f..337841f 100644
--- a/src/test/groovy/graph/SearchAlgorithmSpec.groovy
+++ b/src/test/groovy/graph/SearchAlgorithmSpec.groovy
@@ -10,10 +10,10 @@ import spock.lang.Title
@Title("Comparison of two algorithms")
class SearchAlgorithmSpec extends Specification {
@Subject
- def bfsAlgorithm = new BreadthFirstSearch()
+ def bfsAlgorithm = new BreadthFirstSearch()
@Subject
- def dijkstras = new DijkstrasAlgorithm()
+ def dijkstras = new DijkstrasAlgorithm()
def 'should find a route for a complex graph'() {
given: 'A complex graph sample'
diff --git a/src/test/resources/SpockConfig.groovy b/src/test/resources/SpockConfig.groovy
index af9c48c..887390e 100644
--- a/src/test/resources/SpockConfig.groovy
+++ b/src/test/resources/SpockConfig.groovy
@@ -3,10 +3,4 @@ spockReports {
set 'com.athaydes.spockframework.report.outputDir': 'docs/spock-reports'
set 'com.athaydes.spockframework.report.projectName': 'Graph search algorithms'
set 'com.athaydes.spockframework.report.projectVersion': 1.0
-
- set "com.athaydes.spockframework.report.template.TemplateReportCreator.specTemplateFile": "/templateReportCreator/spec-template.md"
- set "com.athaydes.spockframework.report.template.TemplateReportCreator.reportFileExtension": "md"
- set "com.athaydes.spockframework.report.template.TemplateReportCreator.summaryTemplateFile": "/templateReportCreator/summary-template.md"
- set "com.athaydes.spockframework.report.template.TemplateReportCreator.summaryFileName": "summary.md"
- set "com.athaydes.spockframework.report.template.TemplateReportCreator.enabled": true
}
\ No newline at end of file