Greedy strategy for finding a shortest path

Assignment Help Data Structure & Algorithms
Reference no: EM1380122

Question: Think about the given greedy strategy for finding a shortest path from vertex start to vertex goal in a connected graph.

1: Initialize path to start.
2: Initialize Visited Vertices to {start}.
3: If start=goal, return path and exit. Otherwise, continue.
4: Find the edge (start,v) of the minimum weight such that v is adjacent to start and v is not in Visited Vertices.
5: Add v to path.
6: Add v to Visited Vertices.
7: Set start equal to v and go to step 3.

Does this greedy strategy find the shortest path from start to goal?
Either explain intuitively why it works, or give a counter-example showing why it does not.

 

Reference no: EM1380122

Questions Cloud

Determine average waiting time for constant length messages : Messages reach at random to be sent across a communications link with a information rate of 9600 bps. The link is 70 percent utilized, and the average message length is 1000 octets.
Find the number of physicians : Find the number of physicians to be located in each of the areas if the physicians are income maximizers - Population Index
Find the db strength of the signal : A signal starts at x point. As it travels to y point it loses eight db. At point y the signal is boosted by ten db. As the signal travels to point z it loses 7 db.
Terminal and the corresponding data center : 2-information centers used for retail credit authorization are located in 2-different major population centers, which are separated from each other through a large zone of very little population.
Greedy strategy for finding a shortest path : Think about the given greedy strategy for finding a shortest path from vertex start to vertex goal in a connected graph.
Prepare a monthly operating budget for the dmv : What other changes would you suggest that might help the DMV's situation and what are the advantages and disadvantages of the various suggested changes
Time sharing operating system : Assume a time sharing operating system allocated time slices of twenty milliseconds and the machine executed an average of 5000 instructions per microsecond.
Data speed effect on fundamental business decisions : Can the speed in which data is transmitted have an adverse effect on fundamental business decisions? Yes, speed that is traveling at big rates of speed can have an affect on fundamental business decisions.
Draw a time line to show the cash flows of the project : Draw a time line to show the cash flows of the project and compute the project's payback period, net present value, profitability index, and internal rate of return.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Conceptual model entity relationship diagram

Assume you are asked you to create a new entity-relationship diagram for a corporation for a customized shipment tracking system.

  Explain method for combining two trees-heap-order property

Assume two binary trees, T 1 and T 2 , hold entries satisfying heap-order property. Explain method for combining T 1 and T 2 into a tree T whose internal nodes hold union of entries

  Contents of registers for independent memory-reference

Find out the contents of registers PC, AR, DR, AC, and IR for two independent memory-reference instructions below. Each instruction starts with given Initial values.

  Finding median by black-box worst-case linear-time algorithm

Given a black-box worst-case linear-time algorithm for ?nding median, create algorithm solving the selection problem for an arbitrary order statistic.

  Design time randomized monte carlo algorithm

You have to design an O(n) time randomized Monte Carlo algorithm which computes an (1 + o)- approximate ham-sandwich cut with probability 1 - n-c for any given constant c > 0.

  Creating algorithm broken into sequence of words

Katt wishes you to create an algorithm that, given a string X, determines efficiently how many ways X can be broken up into sequence of words.

  Question about structured wiring

Describe how properly installed structured wiring save the need to recable when new applications are added. Provide some examples of a project that required to be recabled because it was not properly installed structured wiring?

  Algorithm to find maximum sum of contiguous sublist

Using dynamic programming, write an algorithm to find the maximum sum of contiguous sublist of a given list of n real values.

  Converting arithmetic expression in reverse polish notation

Convert the following numerical arithmetic expression into reverse Polish notation and show the stack operations for evaluating the numerical result.

  Create efficient algorithm to find path in graph

Given connected undirected graph G described by the adjacency list representation create the efficient algorithm to find the path in G which goes through exactly once in each direction.

  Algorithm for string of numbers recognize all the substrings

Write down algorithm, using pseudocode, to perform the following task, Given a string of numbers, recognize all of the substrings that form numbers that are divisible by 3.

  Sorting arrays of name in descending order

Then sort arrays so that records are in descending order by purchase amount for month. Output lists the names of the top five customers.

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