Posts

Showing posts from November, 2018

City Search – v1.0

For this assignment, we created three search algorithms to find routes between cities, or points, on a map. Each algorithm is slightly different, however, they all have the same basic structure. Starting at an origin city, the neighboring ("connected") cities are loaded into a queue with a certain cost (distance, for example). The lowest cost city is opened next, and its neighboring cities are added to the queue. Uniform Search Uniform search is the simplest of them all. As each city is loaded into the queue, the cost is calculated by finding the distance between the current city and the neighboring city. When the target city is found, a route is declared. The cost for the route is the sum of all the distances traveled between the cities. Greedy Search Greedy search is also relatively simple. Instead of queued cities being sorted by the distance between this and the next, they are sorted by the distance from the target city (as the crow flies). This can lead to some

Binary Search Methods

After learning how to create a binary tree, we learned a few ways to search for items within those trees. Depth First Search This search goes all the way down on the left node, then works its way back up one by one.  Breadth First Search This search works its way down, level by level.  Depth-Limited Search Similar to Depth First, this node expands the deepest unexpanded node.  Iterative Deepening Search This search uses a depth-limited search, however this search goes level by level.