formatting work

This commit is contained in:
eugenp
2017-01-29 16:03:33 +02:00
parent 44bf48068f
commit 034cde6e20
42 changed files with 455 additions and 700 deletions

View File

@@ -18,9 +18,7 @@ public class Dijkstra {
while (unsettledNodes.size() != 0) {
Node currentNode = getLowestDistanceNode(unsettledNodes);
unsettledNodes.remove(currentNode);
for (Entry<Node, Integer> adjacencyPair : currentNode
.getAdjacentNodes()
.entrySet()) {
for (Entry<Node, Integer> adjacencyPair : currentNode.getAdjacentNodes().entrySet()) {
Node adjacentNode = adjacencyPair.getKey();
Integer edgeWeigh = adjacencyPair.getValue();

View File

@@ -55,29 +55,19 @@ public class DijkstraAlgorithmTest {
for (Node node : graph.getNodes()) {
switch (node.getName()) {
case "B":
assertTrue(node
.getShortestPath()
.equals(shortestPathForNodeB));
assertTrue(node.getShortestPath().equals(shortestPathForNodeB));
break;
case "C":
assertTrue(node
.getShortestPath()
.equals(shortestPathForNodeC));
assertTrue(node.getShortestPath().equals(shortestPathForNodeC));
break;
case "D":
assertTrue(node
.getShortestPath()
.equals(shortestPathForNodeD));
assertTrue(node.getShortestPath().equals(shortestPathForNodeD));
break;
case "E":
assertTrue(node
.getShortestPath()
.equals(shortestPathForNodeE));
assertTrue(node.getShortestPath().equals(shortestPathForNodeE));
break;
case "F":
assertTrue(node
.getShortestPath()
.equals(shortestPathForNodeF));
assertTrue(node.getShortestPath().equals(shortestPathForNodeF));
break;
}
}