Determine the second shortest path between the vertices

Assignment Help Computer Engineering
Reference no: EM131681767

ASSIGNMENT

This assignment involves extension to the single source - single destination shortest path problem.

The Program

Your program should:

1. Read the name of a text file from the console.

2. Read a graph from the file.

3. Find the shortest path between the start and goal vertices specified in the file.

4. Print out the vertices on the path, in order from start to goal.

5. Print out the length of this path.

6. Devise a strategy for determining the second shortest path between the vertices.

7. Find the second shortest path between the start and goal vertices specified in the file.

8. Print out the vertices on the path, in order from start to goal.

9. Print out the length of this path.

The data files are constructed as follows:

  • Two integers: nVertices and nEdges, the number of vertices and edges in the graph.
  • nVertices triples consisting of the label and the x- and y-coordinates of each vertex.
  • nEdges triples consisting of the labels of the start and end vertices of each edge, along with its weight. Note: the weight associated with an edge will be greater than or equal to the Euclidean distance between its start and end vertices as determined by their coordinates.
  • Two labels, the indicating the start and goal vertices for which the paths are required.

A proposed solution to the second shortest path problem is as follows:

For each edge ei on the shortest path: Find the shortest path on (V, E - {ei}). // shortest path without edge ei

The shortest of these is the second shortest path.

Questions -

Is this proposed solution correct?

1. If we require that the second shortest path be longer than the shortest path?

2. If the graph contains cycles?

3. If the graph is undirected?

In each case explain your answer and, if necessary explain how you might modify the proposed algorithm to address any issues you identify.

Attachment:- Assignment Files.rar

Reference no: EM131681767

Questions Cloud

Discuss what does andrew mean by quote : What does Andrew mean by quote. How can you make your business 10 times better than the competition
Why airlines are being investigated by justice department : Explain why the airlines are being investigated by the Justice Department. Airlines responded to regulators with explanations for slow expansion of capacity.
Discuss the pros and cons of franchising in the us : Evaluates and compares the pros and cons of franchising in the US vs. franchising internationally for OS
Case-jp morgan chase moves from outsourcing to insourcing : JP Morgan Chase is one of the world's largest financial institutions. In September 2004, Chase scrapped a seven-year, $5 billion IT outsourcing contract.
Determine the second shortest path between the vertices : Devise a strategy for determining the second shortest path between the vertices. Print out the vertices on the path, in order from start to goal
What is the optimal capital-labor ratio : Derive the amount of capital and labour required to produce 400 units of output. At the given prices what is the total cost of producing 400 units of output?
Using the midpoint income elasticity method : Using the midpoint income elasticity method. How can you tell whether the good is inferior or normal. Explain. My income elasticity is 1.6666666
Discuss kevins failure to make intelligent inquiries : Identify and explain the legal issue(s) or subject(s) that arises in this case as a result of Kevin's failure to make intelligent inquiries
Chinese statistical agency : A modest fall in the Share Index of the top 500 firms, in response to an announcement by the Chinese statistical agency.

Reviews

len1681767

10/16/2017 3:40:12 AM

Note: you may implement either the proposed solution or any modification you develop. You are not required to implement a modified proposal if you do not wish to do so. In each case explain your answer and, if necessary explain how you might modify the proposed algorithm to address any issues you identify. Programs must compile and run under g++ (C++ programs) Programs which do not compile and run will receive no marks. Programs should be appropriately documented with comments.

len1681767

10/16/2017 3:40:06 AM

Program should be implemented in single .cpp file. All coding must be your own work. Standard libraries of data structures and algorithms such as STL may not be used, nor may code be sourced from textbooks, the internet, etc. Standard libraries of data structure and algorithm such as STL may not be used. A program which produces the correct output, no matter how inefficient the code, will receive a minimum of 50% of the mark for the program. Additional marks beyond this will be awarded for the appropriateness, i.e. efficiency for this problem, of the algorithms and data structures you use. Programs which lack clarity, both in code and comments, will lose marks.

len1681767

10/16/2017 3:40:01 AM

Submission: Assignments should be typed into a single text file called ass1.ext where ext is the appropriate file extension. A pdf file describing your solution should also be produced. This file should contain at least: The documentation for your program - A high-level description of the overall solution strategy chosen for the shortest path problem. A high-level description of the design and overall solution strategy you have developed for the second shortest path problem. A list of all of the data structures used, where they are used and the reasons for their choice. A list of any algorithms used, where they are used and why they are used. The answers, explanations and possible changes for each question in the questions section.

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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