 		self.bidirectional = bidirectional
 	}
 
+	fileprivate var reversedEdge: Edge { get {
+		Edge(from: to, to: from, cost: cost, bidirectional: bidirectional)
+	} }
+
 	public var description: String {
 		return "\(from.ID) -> \(to.ID)"
 	}


				if (current.ID == dest.ID) { continue }

				if dest.pathCost != nil &&
				   dest.pathCost! <= (current.pathCost ?? 0) + e.cost
				{ continue }

				dest.pathCost = (current.pathCost ?? 0) + e.cost
				dest.parentNode = current
				queue.append(dest)
			}

		}

		var top : Node? = to

		processingLock.lock()

		for e in edges {
			e.from.outEdges.append(e)
			if (e.bidirectional) {
				e.to.outEdges.append(e.reversedEdge)
			}
		}

