Code modified dijkstra algorithm to search from start node

Assignment Help Data Structure & Algorithms
Reference no: EM132147904

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

Reference no: EM132147904

Questions Cloud

Pseudo code or a flowchart of your program : List above contains 26 fruits, each one with a name that begins with a different letter of the alphabet.
Which characteristics or approaches demonstrated by person : Which characteristics or approaches demonstrated by this person would you integrate into your own leadership style? Which ones would you prefer not to integrate
What data management considerations : What data management considerations must be reviewed to ensure success for both companies and assure regulatory compliance
Identify the given with a high risk of falling : Falls are one of the major causes of mortality and morbidity in older adults. Every year, an estimated 30-40% of patients over the age of 65 will fall at least.
Code modified dijkstra algorithm to search from start node : Assignment - Dijkstra Algorithm - Your task is to Code the modified Dijkstra's algorithm to search from the start node out
Determining the big-oh notation for the algorithm : What steps are required in determining the Big-Oh notation for the algorithm when sorting an array of integers
Troubleshoot reduced speed or latency : What are some other ways to troubleshoot reduced speed or latency? Or to find out what is using all the bandwidth? Perhaps might incorporate parts
Create an organizational culture in which employee feel safe : Create an organizational culture in which employees feel safe admitting or reporting on failure.
Discuss three concepts that you learned during the course : Advanced practice nurses should be able to critique, evaluate, and use theory. They should be able to integrate and apply a wide range of theories from nursing.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  They have collected by interviewing members of a village.

An efficient algorithm is proposed to do this: either it produces proposed dates of birth and death for each of the n people so that all the facts hold true, or it reports (correctly) that no such dates can exist. That is the facts collected by th..

  Building a tree for conversion purposes

Creating a Tree Class, Building a Tree. Converting Morse code to English characters. Concepts tested by this program: Generic Classes, Utility Class, New concepts tested by this program, Linked Trees, Building a Tree for conversion purposes.

  Algorithm for locating nth successor in circlar linked list

Write algorithm or code segment for locating nth successor of an item in circlar linked list (the nth item that follows the given item in the list).

  Describe what is meant by a parallel algorithm

Describe what is meant by a parallel algorithm. Explain how the pseudocode used in this book can be extended to handle parallel algorithms.

  List two skus that were purchased most frequently together

List the two SKUs that were purchased most frequently together. List the three SKUs that were purchased most frequently together. List the four SKUs that were purchased most frequently together.

  How to draw a five inch square

How to draw a five inch square on the screen using * symbo

  Write about encryption algorithm

Write about Encryption Algorithm and Hash Function Of Data structure in detail

  Create time algorithm-minimum time required to finish task

Create the O(|V | + | E |) time algorithm which, given times ti and the dependencies, determines minimum time required to complete all the tasks.

  Which actions would be inappropriate for program to take

If the user types an invalid value into a TextBox and moves focus to another TextBox, which of the following actions would be inappropriate for the program to take?

  Algorithm to produce a list of customers

Draw an algorithm to produce a list of customers from the Glad Rags Clothing Company's customer master file.

  Similar to last lab this lab is comprised of a series of

similar to last lab this lab is comprised of a series of mini tasks. in order to get credit for this lab you must

  Creating seven subnets on the network

Assume your corporation is assigned the network address 150.50.0.0. You need to construct seven subnets on the network. A router on one of the subnets will connect the network to Internet

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