Example #1
0
		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;
		}
Example #2
0
		public abstract bool Search(Graph graph, int startNode, int targetNode);