Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment - Dijkstra Algorithm

Dijkstra's algorithm finds the shortest path from a given node to all other nodes.

1) We observe that we can modify this algorithm to stop as soon as a particular node is reached; thus producing an algorithm to find the shortest path between a specific pair of points. However, this algorithm may involve the consideration of a number of points which do not lie on the final shortest path.

We now consider 2 alternatives:

2) We can modify the algorithm to add nodes to the solution based on an A* criterion derived from the Euclidean (straight line) distance from each candidate node to the desired end node.

3) We can attempt to improve our efficiency by modifying Dijkstra's algorithm to start at both the source and destination nodes and to construct two partial solution trees in parallel until one node is in both partial solution trees.

Your task is to:

1. Code the modified Dijkstra's algorithm to search from the start node out.

2. Code the A* variant.

3. Code the proposed improved algorithm.

Input consists of the following data:

1) The number of nodes in the graph.

2) A set of triples containing the node number, its X-coordinate and its Y coordinate - one triple for each node in the graph.

3) The number of edges in the graph.

4) A set of triples consisting of two node numbers and a cost - one triple for each edge in the graph.

5) A pair of node numbers representing the start and end nodes between which a path must be found.

Output consists of the following data:

  • The length of the shortest path from solution 1:
  • The path (ordered list of nodes) from solution 1:
  • The number of additional nodes in the solution tree for solution 1 (those not in the shortest path that were added to the selected set):
  • The length of the shortest path from solution 2:
  • The path (ordered list of nodes) from solution 2:
  • The number of additional nodes in the solution tree for solution2 (those not in the shortest path that were added to the selected set):
  • The length of the shortest path from solution 3:
  • The path (ordered list of nodes) from solution 3:
  • The number of additional nodes in the solution tree for solution 3 (those not in the shortest path that were added to the selected set).

Notes: The graph is undirected, so each edge connects the pair of nodes specified in both directions. Do not use the STL.

The graph will not have more than 100 nodes.

Your program should print an appropriate error message if no path exists between the specified nodes.

Programs must compile and run under gcc (C programs), g++ (C++ programs), java or python.

Programs which do not compile and run will receive no marks. Programs should be appropriately documented with comments.

In addition to the source file ass3.c or ass3.cpp you should also submit a text file containing a brief discussion of your results. You should talk about the relative efficiency of each of the three proposed approaches and note any problems that may arise with each of them.

Attachment:- Assignment Files.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93135368

Have any Question?


Related Questions in Computer Engineering

Given the following three months of data what is the

Given the following three months of data what is the coefficient of variation? t, R_t 1, 21.01% 2, -13.83% 3, 15.67% 4, 0.88% 5, -1.32% Express your answer in total return decimal format.

Is there someone to help me on to write c codea write a

Is there someone to help me on to write c++ code? A) Write a snippet of code to declare ( what would go into the .h file) and then implement(what go into the .cpp file) an exception class called PetBitesException which h ...

Respond to the followingin a bst what is the complexity

Respond to the following: In a BST, what is the complexity required to remove the minimum element? In a BST, what is the complexity required to find (but not remove) the minimum element? In a heap, what is the complexity ...

A study was conducted of long beach school district schools

A study was conducted of Long Beach School District schools regarding how many require school uniforms. In 2006, of the 296 schools questioned, 184 said they required s school uniforms. (Gentile & Imberman, 2009) Find th ...

Question suppose three items r s and t are placed in a

Question : Suppose three items R, S, and T are placed in a queue in that order. Then one item is removed from the queue before a fourth item, X is placed in the queue. Then one item is removed from the queue, the items Y ...

Determine the percentage of mass of the atmosphere that

Determine the percentage of mass of the atmosphere that resides between sea level and a height of 18.3 km. Assume an average pressure of 1.00 atm at sea level and a temperature of the atmosphere of 15 °C. The average mol ...

In c languageread a double number as 2 digits after the

In C language: Read a double number as 2 digits after the decimal point. The number should have at least 6 digits BEFORE the decimal point. Extract all digits at even positions. Print them in reverse order. Extract all d ...

Question after 1 year of launch ride sharing increased a

Question: After 1 year of launch, ride sharing increased a lot resulting in a lot of insertion requests to the database. Consider there is no room to further increase the size of server and changing database is not an op ...

A bar wants to move into a new area they want to find out

A bar wants to move into a new area. They want to find out the average income of people in the area to set a price point. To estimate the income of the locals with an error of at most $5,000 at a 80% confidence level, wh ...

Question suppose that a disk drive has 5000 cylinders

Question : Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4, 999. The drive is currently serving a request at cylinder 2, 150, and the previous request was at cylinder 1, 805. The queue of pending requests, ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As