private int SumPathCosts(Queue <Node> nodes) { int pathCost = 0; Node current = nodes.Dequeue(); while (nodes.Count > 0) { pathCost += current.GetCostTo(nodes.Peek()); current = nodes.Dequeue(); } return(pathCost); }
private int GetCostBetween(Node node, Node neighbor) { return(GetCostFor(node) + node.GetCostTo(neighbor)); }