Discount Get GSP 295 ALL WEEKS Solution ONLY $104.95 $139.93
GSP 295 Week 1 - A Simple ADT [$19.99]
GSP 295 Week 2 - Sorted List Lab [$19.99]
GSP 295 Week 3 - Palindromemordnilap [$19.99]
GSP 295 Week 4 - Horacious Glump [$19.99]
GSP 295 Week 5 - Simple Cipher [$19.99]
GSP 295 Week 6 - Graph ADT [$19.99]
GSP 295 Week 7 - Dijkstra [$19.99]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
GSP 295 GSP295 GSP/295 - Week 7 - Lab 7 - iLab 7 - Dijkstra - The shortest path algorithm you will implement requires selecting the smallest distance from a set of distances between two nodes that have recently been inserted.
    GSP 295 GSP295 GSP/295 - Week 7 - Lab 7 - iLab 7 - Dijkstra - The shortest path algorithm you will implement requires selecting the smallest distance from a set of distances between two nodes that have recently been inserted.

GSP 295 GSP295 GSP/295 - Week 7 - Lab 7 - iLab 7 - Dijkstra - The shortest path algorithm you will implement requires selecting the smallest distance from a set of distances between two nodes that have recently been inserted.

$19.99

Deliverables

A single zip file including the following.

  • Your Visual Studio Project directory and associated files, including source files for the Lab.
  • The results of your testing. What tests did you run? Did everything work okay? Are there outstanding issues in your program? A short half-page summary of your results is about the right length.
  • Your answers to Part 5 Lab Questions.

If you document any issues, it will be easier to isolate any problems, provide detailed help, and could potentially improve your grade.

Summary

The purpose of this week’s iLab is to extend your Week 6 iLab and implement Dijkstra’s algorithm to find the shortest path and distance to all destinations from a source node in an arbitrary graph. 

Part 1:  Priority Queues

The shortest path algorithm you will implement requires selecting the smallest distance from a set of distances between two nodes that have recently been inserted. Because you are now an algorithms and data structure expert, you immediately recognize the best solution for this problem: a priority queue.

However, it is unlikely you have a Priority Queue C++ implementation laying around as none of the iLabs has asked for this implementation. In order to adding functionality for selecting the smallest path from a set of pathsm you may do any of the following. 

Please select and perform ONE of the following implementation options.

  • Implement a priority queue ADT that uses integer distances as keys and stores strings as its data item. 
  • Reuse your binary tree ADT but modify it to place items based on an integer key. Then add an ADT function to select the minimum item by recursively following the left node of the tree.
  • Reuse your ADT sorted list but modify it to sort items based on an integer key. The first element in the ADT list will then be the smallest distance.
  • Reuse your Queue ADT but modify it to insert items based on an integer key. The first element in the queue will then be the smallest distance. Notice this will have a worse run-time than 1.
  • Create a custom function to traverse a list of vertices and find the one with the smallest distance.

Think about the run-time for the Dijkstra algorithm in each of the cases listed above.

Option 1 will require significant additional implementation time, but is the best solution because it results in the lowest run-time. Options 2, 3, and 4 are best for you if you’ve written your ADTs well and are comfortable with extending them but still may require moderate additional time.

Option 5 will be the easiest to implement in most cases as you can simply do a linear search; however, option 5 results in the worst run-time performance of Dijkstra.

Any option you select will be worth full credit, providing the functionality is correct.

Part 2: Dijkstra

Implement Dijkstra’s algorithm based on the pseudo code given in lecture or your web research to find all paths and weight totals from an arbitrary graph source node. Your Dijkstra algorithm should output the shortest distance from a source node to each other node as well as output the shortest path to each node.

Part 3: Output Shortest Paths

Because you will need to output the shortest path as well as distance you will need to keep track of each node’s previous node. Note that this means you will need to return two arrays from Dijkstra—a distance array and a previous array. Therefore, you will need to create a small function that outputs values from the previous array “backwards.” 

For example, if your source node is Austin and your array positions are as indicated in the city example problem from iLab 6, the shortest path to Atlanta will be Austin->Houston->Atlanta. If in the previous array, Atlanta is at position 0, Houston at position 5, and Austin at position 1, then to output the shortest path to Atlanta you will need to output Atlanta, then previous[0], which will be 5 (Houston) and then output previous[5] which will be 1 (Austin).

Part 4: Test Driver

Your test driver should be extended from Week 6 and contain all the same commands to create a graph ADT and a command to setup the city test problem given in iLab 6. In addition, you must create a command to run Dijkstra’s algorithm on a user specified source node. You can choose the input method of the source code.

Your program must output each node’s name, the complete shortest path to that node from the source node, and the shortest path distance

For example, if the source is Austin, the first few lines of output should be of the form (order is not significant):

Houston (160):  Austin->Houston

Atlanta (960):  Austin->Houston->Atlanta

Design a test plan with at least a few test cases and implement your test plan. At least one test case should use the city example below. You do not have to submit your test plan, but it would be a good idea to verify your algorithm by testing at least a few different problems and source nodes in various graphs.

Part 5: Lab Questions

Consider and answer the following questions in your Lab write-up. Big-O of Dijkstra is calculated using V (vertices) and E (edges) rather than N.

  • Which implementation option did you select for Part 1? Why did you choose this implementation?
  • For each of the implementation options 1, 2, 3, 4, and 5 in Part 1, what is the average Big-O run-time of Dijkstra? 

General iLab Comments

All oding assignments for this class will be using Microsoft Visual Studio. This is available through the Software Store, which can be found in Course Home. Contact the help desk if you encounter any issues or contact your professor. 

*Please note as a reminder that you may not copy code from any web reference to complete this assignment, even if you correctly give credit. You may of course use web references to help you understand, but you must code the assignment yourself. You may use code directly from your textbook where applicable, but do make sure you give credit in your comments if you are doing so. 

Here is solution for GSP295 - Week 7

It is 100% correct.

Solution contain Visual Studio C++ project and document answer all questions.

If you have more questions, please contact me via email support@extutorials.com

I will help you any time

Thank you very much

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B