/// <summary>Runs the Greedy search algorithm algorithm on a graph.</summary> /// <param name="start">The node to start at.</param> /// <param name="graph">The graph to search against.</param> /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param> /// <param name="goal">Predicate for determining if we have reached the goal node.</param> /// <returns>Stepper of the shortest path or null if no path exists.</returns> public static Stepper <T> Greedy(T start, Seven.Structures.Graph <T> graph, Heuristic heuristic, Goal goal) { return(Greedy(start, graph.Neighbors, heuristic, goal)); }
/// <summary>Runs the Greedy search algorithm algorithm on a graph.</summary> /// <param name="start">The node to start at.</param> /// <param name="graph">The graph to search against.</param> /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param> /// <param name="goal">Predicate for determining if we have reached the goal node.</param> /// <param name="equate">Delegate for checking for equality between two nodes.</param> /// <returns>Stepper of the shortest path or null if no path exists.</returns> public static Stepper <T> Greedy(T start, Seven.Structures.Graph <T> graph, Heuristic heuristic, T goal, Equate <T> equate) { return(Greedy(start, graph.Neighbors, heuristic, (T node) => { return equate(node, goal); })); }
/// <summary>Runs the Greedy search algorithm algorithm on a graph.</summary> /// <param name="start">The node to start at.</param> /// <param name="graph">The graph to search against.</param> /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param> /// <param name="goal">Predicate for determining if we have reached the goal node.</param> /// <returns>Stepper of the shortest path or null if no path exists.</returns> public static Stepper <T> Greedy(T start, Seven.Structures.Graph <T> graph, Heuristic heuristic, T goal) { return(Greedy(start, graph, heuristic, goal, Equate.Default)); }
/// <summary>Runs the A* search algorithm algorithm on a graph.</summary> /// <param name="start">The node to start at.</param> /// <param name="graph">The graph to perform the search on.</param> /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param> /// <param name="cost">Computes the cost of moving from the current node to a specific neighbor.</param> /// <param name="goal">The goal node.</param> /// <param name="equate">A delegate for checking for equality between two nodes.</param> /// <returns>Stepper of the shortest path or null if no path exists.</returns> public static Stepper <T> Astar(T start, Seven.Structures.Graph <T> graph, Heuristic heuristic, Cost cost, T goal, Equate <T> equate) { return(Astar(start, graph.Neighbors, heuristic, cost, (T node) => { return equate(node, goal); })); }
/// <summary>Runs the A* search algorithm algorithm on a graph.</summary> /// <param name="start">The node to start at.</param> /// <param name="graph">The graph to perform the search on.</param> /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param> /// <param name="cost">Computes the cost of moving from the current node to a specific neighbor.</param> /// <param name="goal">The goal node.</param> /// <returns>Stepper of the shortest path or null if no path exists.</returns> public static Stepper <T> Astar(T start, Seven.Structures.Graph <T> graph, Heuristic heuristic, Cost cost, T goal) { return(Astar(start, graph, heuristic, cost, goal, Equate.Default)); }
/// <summary>Runs the A* search algorithm algorithm on a graph.</summary> /// <param name="start">The node to start at.</param> /// <param name="graph">The graph to perform the search on.</param> /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param> /// <param name="cost">Computes the cost of moving from the current node to a specific neighbor.</param> /// <param name="goal">Predicate for determining if we have reached the goal node.</param> /// <returns>Stepper of the shortest path or null if no path exists.</returns> public static Stepper <T> Astar(T start, Seven.Structures.Graph <T> graph, Heuristic heuristic, Cost cost, Goal goal) { return(Astar(start, graph.Neighbors, heuristic, cost, goal)); }