[SOLVED] CSCE-629 Analysis of Algorithms-Assignment # 2

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon HW2-qaty7j.zip (203.4 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

 

 

(

  1. Design algorithms for Min(H), Insert(H,a), and Delete(H,i), where the set H is stored in a heap, a is the element to be inserted into the heap H, and i is the index of the element in the heap H to be deleted. Analyze the complexity of your algorithms.

Remark. In the following questions, you can assume that your graphs are connected.

  1. Write the psuedo-code for the Dijstra’s algorithm that solves the Single-Source Shortest Path Analyze the complexity of the algorithm (you can assume that the algorithm uses a heap for fringes and you can use your results in Question 1 directly). Give a formal proof that the algorithm works correctly when the edge weights are all non-negative.
  2. Develop a linear-time (i.e., O(m)-time) algorithm that solves the Single-Source Shortest Path problem for graphs whose edge weights are positive integers bounded by 10. ( You can either modify Dijstra’s algorithm or consider using Breath-First-Search.)
  3. Consider an extended version of the Shortest-Path Suppose that you want to traverse from city s to city t. In addition, for some reason, you also need to pass through cities x, y, and z (in any order) during your trip. Your objective is to minimize the cost of the trip. The problem can be formulated as a graph problem as follows: Given a positively weighted directed graph G and five vertices s, t, x, y, z, find a path from s to t that contains the vertices x, y, z such that the path is the shortest over all paths from s to t that contain x, y, z, assuming that these paths are allowed to contain repeated vertices and edges. Develop an O(mlogn)-time algorithm for this problem.

 

  • HW2-qaty7j.zip