Asymptotic performance of kruskals algorithm

Assignment Help JAVA Programming
Reference no: EM131587036

Traveling Salesman Problem (TSP)

Given a set P of points (e.g., a bunch of cities) and pairwise "distances" between these points, the Traveling Salesman Problem (TSP) seeks to find a shortest tour that starts from a point and visits every point exactly once and returns to the starting point. TSP is computationally very difficult; the fastest algorithms for this problem run in exponential time and there are reasons to believe that faster algorithms do not exist for TSP. A special case of TSP is the metric TSP problem in which distances satisfy the triangle inequality, i.e., for any three points p1, p2, p3, distance(p1, p3) ≤ distance(p1, p2)+distance(p2, p3). Even metric TSP is computationally difficult, but there are good approximation algorithms for metric TSP. In this homework you are required to implement a simple 2-approximation algorithm for metric TSP that is based on computing an MST.

Experiments

1. Report the following statistics on the execution of Boruvka's algorithm on the input graph:

(i) how many iterations does the algorithm take and (ii) what is the size of the smallest connected component at the end of each iteration. Recall that Boruvka's algorithm comes with the guarantee that in each iteration, the size of the smallest component, at least doubles. In practice, the size of connected components can grow much more quickly than this guarantee suggests. The point of this experiment is to understand this issue.

2. As we saw in class, the asymptotic performance of Kruskal's algorithm relies on the perfor- mance of the implementation of the Disjoint Set Union Find data structure.

If you implemented this data structure as a reverse tree with Union by depth, then the depth of the deepest tree associated with a component is a good measure of the performance of this data structure. So in this case, report the maximum depth of a reverse tree after each iteration. Note that this quantity is 1 after the first iteration of Kruskal's algorithm and it will typically remain unchanged for a number of iterations and then increase by 1.

If you implemented the Disjoint Set Union Find data structure as a shallow threaded tree with union by size, then the maximum number of times the "leader" pointer of a node is changed is a good measure of the performance of the data structure. So in this case, report the maximum number of times the "leader" pointer of a node is changed after each iteration. Note that this quantity is 1 after the first iteration of Kruskal's algorithm and it will typically remain unchanged for a number of iterations and then increase by 1.

It seems best to report these statistics in a plot with the x-axis being the iteration index and the y-axis being the measure of the data structure performance being reported.

3. Output the 127 edges in the computed MST and the weight of the computed MST.

4. After transforming the computed MST into a Traveling Salesman Tour, output the tour and its weight. So you're being asked to output the Traveling Salesman tour prior to using the 2-OPT and 3-OPT local search heuristics to improve the tour.

5. Output the Traveling Salesman Tour and its weight after using the 2-OPT local search heuris- tic.

6. Output the Traveling Salesman Tour and its weight after using the 2-OPT and 3-OPT local search heuristics.

What to Turn in

You are expected to turn in two items for this homework.

1. A single file named hw8.ext containing all your code. The extension ".ext" will of course depend on the programming language you use. Your code should be extensively documented. For example, functions should be preceded by comment blocks that tell the reader what the purpose of the function is, variable names should be suggestive of their purpose, etc. The file should also start with a listing of any bugs or issues with your code, sources you used, etc. You are not allowed to share code with classmates, but it is okay to use code available on the web, with appropriate attribution. For example, you might find it convenient to use a class that implements the max-heap data structure. This is fine, provide you carefully acknowledge your source. We will set up a dropbox on ICON for you to upload your code file. This needs to be done before class time on Tue, April 18th .

2. A single pdf file named hw8.pdf containing the results of all your experiments. You should upload this file onto the ICON dropbox and bring a printout to class on Tue, April 18th. This document should be well-formatted, should contain clear and concise text, and clearly and completely labeled plots.

Extra Credit Opportunities

1. Find an optimal Traveling Salesman tour for the given input. Given the current state of human knowledge, any algorithm that does this is bound to be some variant of brute force, taking exponential amount of time. But, there are some pretty sophisticated brute force implementations for the Traveling Salesman tour computation out there and you are welcome to download and use whatever you find. To get this extra credit, report the Traveling Salesman tour that has been computed, along with its weight. Then write a paragraph on how you found this tour, e.g., what software you downloaded, how you used it, and how long it took to find the tour.

2. Show on Google maps the MST and Traveling Salesman tours you computed for the experi- ments listed above. If you do this, then attach pictures of the MST and Traveling Salesman tours to your document hw8.pdf. You are welcome to go crazy and make a webpage, allow users to interact with these structures you're constructing, etc.

Reference no: EM131587036

Questions Cloud

Organizations of perfect competition and monopoly : What are the differences in the conclusions between the industrial organizations of perfect competition and monopoly?
Prepare the general journal entry : Use this information to prepare the General Journal entry (without explanation) for March 31. If no entry is required then write "No Entry Required."
Explain economic conditions of tech bubble : Describe and explain economic conditions of Tech Bubble/Bust for the 1990's.
What is the relationship between the bottom two rows : Suppose G is connected and k-regular and has no Eulerian circuit. Prove that if is connected, then has an Eulerian circuit.
Asymptotic performance of kruskals algorithm : Implement a simple 2-approximation algorithm for metric TSP that is based on computing an MST - distances" between these points, the Traveling Salesman Problem
Find julies optimal basket of consumption : Clothing costs $2 per unit always. Find Julies optimal basket of consumption.
Analyze the methods for establishing key risk indicators : Recommend to management the approach that they need to take to implement an effective ERM program.
Describe how expressive behavior interact in emotion : What are the major parenting styles and how do children's traits relate to them
What are some of ways that financial information will change : What are some of the ways that financial information will be changed in the way the information is processed, gathered, and communicated because of changing inf

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create simple java program that determine cost of insurance

Need to create a simple Java program that determines cost of insurance by including any additional person based on age (thus questions regarding age and how many people apply to each category as far as age should be included)

  Java application that calculates weekly pay for an employee

I have attach the pseudocode for it. I have also attach the program that I wrote for it and it will not compile need help on it. Now does the progrma follow suit with the pseudocode or not? In not then how do I go about on doing it?

  Create a class - constructor for a region

The skeleton provides you with several HTML pages and associated JavaScript and CSS files representing the structure of the app. You will need to implement the logic and functionality for each of these pages - demonstrate how to change from one pag..

  Write methods in java

1. int countVowels (String s) That for a given string s, return number of vowels in s.

  Explore how to throw and rethrow and exception

We will explore how to throw and rethrow and exception, and how to handle events in a program.  Please respond to all of the following prompts:Discuss whether it is it possible

  Design a class named mydate

Design a class named MyDate. The class contains: The data fields year, month, and day that represesents a date. month is 0-based, i.e., 0 is January. A no-arg constructor that creates a MyDate object for the current date

  Write a java program that declares an array alpha

Write a java program that declares an array alpha to 50 elements of type double. Initialize the array so that the first 25 numbers are equal to the square of the index variable, and the last 25 elements are equal to 3 times the index variable. Output..

  Create the default junit tests using netbeans

Create the 'default' JUnit tests using NetBeans. Do this for the HomeAppliance class only; not for your JFrame GUI class.

  Write a simulation of the memory management

CO2017 - Exercise 2 - Java Threads. You will write a simulation of the memory management component of an operating system. The system will use simple direct memory management

  Write java program which simulates flipping of coin

Write a Java program which simulates flipping of coin 1000 times and prints total number of heads and tails. You should create a class.

  Review the given code fragment from arraybag class

Review the given code fragment from ArrayBag class below and answer the following: Explain each line in your own words: Write the header (signature) of the method that contains this code

  Write a syntactically correct java program

Give an example from your daily life of some things that could be represented as an Array and how it could be used. Write a syntactically correct Java program to present your example: declarations, initializations and use

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