How many paths are there to the goal

Assignment Help Data Structure & Algorithms
Reference no: EM13833698

Depth-first & breadth-first search

The textbook shows algorithms for Depth-First Search (DFS) and Breadth-First Search (BFS) applied to tree structures. Now we extend the algorithms to graph structures.

In our definition, BFS is a graph search algorithm that begins from a node (a "root" node) and explores all the neighboring nodes. Then for each of those nearest nodes, it explores their unexplored neighbor nodes, and so on, until all the nodes within the graph are explored.

DFS is a graph search algorithm that starts from a node (a "root" node) and explores as far as possible along each branch before backtracking (going back to a node that has been explored before). For an undirected and connected graph, such a process could produce a Depth-First Search Tree, in which the starting node serves as the root of the tree. Whenever a new unvisited node is explored for the first time during the DFS search process, it is attached to the DFS tree as a child to the node from which it is being reached.

Please note that our BFS and DFS algorithms are defined in a traditional way. The algorithms shown in the textbook try to find a goal node. In our algorithms, we are trying to explore all the nodes within the graph.

Please use the Figure 1 and answer the questions. The figure shows an undirected graph and all the edges have equal costs (e.g., the lengths of all edges are equal). For simplicity, when we have a number of alternate nodes to explore, we will select them in an alphabetical order. The problems can be easily solved by hand.

Assume node a is the starting point (the "root" node) from which the search starts.

984_Depth-first & breadth-first search.png

1) Apply the BFS algorithm and show the output (list all the nodes by the order they are being explored)

2) Apply the DFS algorithm and show the output (list all the nodes by the order they are being explored)

3) Show the output from the previous question in the form of a DFS tree.

2: A* Search

The problem is described as follows. Consider an idealization of a problem where a robot has to navigate its way around obstacles. The goal is to find the shortest distance between two points on a plane that has convex polygonal obstacles. Figure 2 shows an example scene with seven polygonal obstacles where the robot has to move from the point start to the point end. Convince yourself that the shortest path from one polygon vertex to any other in the scene consists of straight-line segments joining some of the vertices of the polygon. (Note that the start and the end goal points may be considered polygons of size 0).

1) Suppose the state space (i.e., a set of possible locations for the robot) consists of all possible positions (x, y) in the plane. How many possible states are there? How many paths are there to the goal? Provide important assumptions for your answer.

2) Based on your solution for 1), can you find a better (and reasonable) state space for the problem? If the answer is yes, how large is the state space? If the answer is no, provide justifications why you think this is a good state space to implement your following searching algorithm.

3) Implement an algorithm to find the shortest path from the start node to the end node using an A* (A-star) heuristic search. Use the straight-line distance to the end node as a heuristic function. Show your pseudo code for this algorithm. Is this an admissible heuristic function? Why or why not?

4) Present the solutions for the following problem using the A* algorithm you implemented.

1195_Depth-first & breadth-first search1.png

Polygon 1: ((220, 616), (220, 666), (251, 670), (272, 647))

Polygon 2: ((341, 655), (359, 667), (374, 651), (366, 577))

Polygon 3: ((311, 530), (311, 559), (339, 578), (361, 560), (361, 528), (336, 516))

Polygon 4: ((105, 628), (151, 670), (180, 629), (156, 577), (113, 587))

Polygon 5: ((118, 517), (245, 517), (245, 577), (118, 557))

Polygon 6: ((280, 583), (333, 583), (333, 665), (280, 665))

Polygon 7: ((252, 594), (290, 562), (264, 538))

Polygon 8: ((198, 635), (217, 574), (182, 574))

Start: (120, 650) End: (380, 560)

Note: This figure is for illustration purpose only. Positions of the polygons inside the figure may not reflect their actual coordinates.

5) Is it possible to solve the problem using a breadth-first or a depth-first search algorithm? If the answer is yes, briefly discuss your solutions. Otherwise please explain.

Reference no: EM13833698

Questions Cloud

Write a precis of construction engineering v hexyl pvt ltd : Write a precis of Construction Engineering (Aust) Pty Limited v Hexyl Pty Limited [1985] HCA 13; (1985) 155 CLR 541 and discuss how this case contributed to the law of partnership.
Find the cost of 20 grams of lead at $60 per kg. : Find the cost of 20 grams of lead at $60 per kg.
Explain what role does douglass suggest education : What role does Douglass suggest education has in ending oppression? why do oppressors keep their victims in ignorance
Periodic and perpetual systems : Question 1: Whether LIFO costing is applied at the time each sale is made or only at the end of the period, both the periodic and perpetual systems will yield the same ending inventory under LIFO.
How many paths are there to the goal : Show your pseudo code for this algorithm. Is this an admissible heuristic function and How many possible states are there? How many paths are there to the goal?
How can a country finance a deficit budget : Explain the concept of deficit spending and clearly demonstrate the Keynesian effects. What are the effects of deficit spending on countries economy? How can a country finance a deficit budget?
Highlight relevant background and job history information : Highlight relevant background and job history information. Emphasize significant qualifications and exclude nonessential ideas.
Earn income as a stockholder : There are two primary means to earn income as a stockholder. The first method is dividend income and the second method is earnings from capital gains. With respect to the investor seeking dividend income, when the investor buys a stock from a corpora..
Determine the annual dps under the following policies : i) Determine the annual DPS under the following policies. ii) A regular dividend of sh. 8 and an extra dividend to bring the payout ratio to 40% if it otherwise would fall below. b) Do you believe it will be justifiable for a company to borrow money ..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Count up the number of times that both arrays

Count up the number of times that both arrays have the same integer value at the same index.

  Cpu scheduling algorithems

CPU SCHEDULING ALGORITHEMS

  Lines of action- explain how you will use a search tree to

lines of action- explain how you will use a search tree to find the solutionbullabstractbullintroductionbullrelated

  Prepare a japplet with a jbutton

Prepare a JApplet with a JButton labeled Who is number one and when the user clicks on button, display your favorite sports team. Save the document as JNumberOne.java.

  Complications in a time sharing system

Determine what complications could happen in a time-sharing system if two processes need access to the same file at the same time?

  An infix expression is one in which operators are located

an infix expression is one in which operators are located between their operands. this is how we are accustomed to

  Identify the most important facts about the diet

Identify the most important facts about the diet. State your opinion about the diet.Support your opinion with relevant facts or research

  Part 1 - report write a 2000-word report that describes a

part 1 - report write a 2000-word report that describes a suitable methodology from the literature for the purpose of

  What is procedural or algorithmic programming

What is procedural or algorithmic programming? What is object-oriented programming? What is the role of code reuse in object-oriented programming

  Definiteness is one of the properties of an algorithm

Using suitable word or phrase fill up the blanks in the following sentences.

  Creating a flowchart

Create a flowchart to illustrate the given problem. You are given input for the student name, number of credits, and cost per credit.

  Draw a red-black tree

Draw a red-black tree for the following values inserted in this order. Illustrate each operation that occurs: w k o s y t p r

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd