public override bool Search(Graph graphToSearch, int start, int end) { graph = graphToSearch; startNode = start; targetNode = end; Initialize(); while (nodesToCheck.Count > 0) { int currentNode = GetNextNode(); visitedNodes++; if (currentNode == InvalidNodeIndex) return false; if (currentNode == targetNode) return true; CheckAdjacency(currentNode); } return false; }
public abstract bool Search(Graph graph, int startNode, int targetNode);