Minimum spanning tree based heuristic, JAVA Programming

Assignment Help:

Problem description: A travelling salesman wants to make a tour of the cities and returns back to the starting point. What is the minimum length tour?

  • Formal Definition:

o   Input: A set S = {P1, P2, ..., Pn} of n points representing the locations of n cities. The coordinates of Pi is (xi, yi). For simplicity, the coordinates xi and  yi are integers in [0..1000), i.e.,  0  ≤ xi, yi  ≤ 999, i= 1,2,..,n. The distance between Pi and Pj is defined as |xi- xj|+|yi- yj|.

o    Output: A TSP tour that starts from P1, visit all the cities (Pi, i=2,3..,n) and return back to starting point P1

o    Objective: Minimize the total length of the TSP tour.

HEURISTICS

  • Minimum Spanning Tree (MST) Based Heuristic
  1. Construct a MST, T, for the points in S from starting point P1;
  2. Traverse around T to get the initial TSP tour for S;
  3. Exploit the triangular inequality and remove unnecessary visits in the TSP tour.
  4. Compute the length of the tour.
  • Nearest Neighbour Heuristic
  1. current position ← P1;
  2. Loop for n-1 steps
  1. At each step, choose to visit next the city that is closest to the current position;
  2. Update the current position;

o   Including the closing edge (back to P1) in the tour;

o   Compute the length of the tour.

TASKS

1.  Implement the MST Based Heuristic;

2.  Implement the Nearest Neighbour Heuristic;

3.  Implement a function, randomSetGenerator that will generate a set of random points on the L1-metric Plane.

4.  Conduct the following experiment for n=100

o   Repeat the following for 10 times

§   Call randomSetGenerator to generate a set S of n random points.

  • Feed S to the MST Based Heuristic. Record the length of the tour and the execution time.
  • Feed S to the Nearest Neighbour Heuristic. Record the length of the tour and the execution time.

o   Compute the average length of the tour and the average execution time for the MST Based Heuristic.

o   Compute the average length of the tour and the average execution time for the Nearest Neighbour Heuristic.

5.  Repeat the above experiments for n = 200, 300, 400, 500, 600, 700, 800, 900 and 1000. Collect the statistics (average length of the tour and average execution time) from the experiments. Compare the two heuristics in term of the average length of the tour and average execution time. 

 


Related Discussions:- Minimum spanning tree based heuristic

Design a scheduler in java, Your task is to design a scheduler for the Sher...

Your task is to design a scheduler for the Sheridan Rail Corporation which keeps track of all daily scheduled trips for the railway.  Users can add new trips as well as perform sea

Write a java adb client, Write a Java ADB client to perform the following- ...

Write a Java ADB client to perform the following- The client will read the contents of the file - invoice.txt. The first line of the file will display the type of the currency. The

Explain abstract method in java, Explain abstract method in java? Java ...

Explain abstract method in java? Java permits methods and classes to be declared abstract. An abstract method is not actually implemented in the class. It is merely declared th

Luminous Jewels, Byteland county is very famous for luminous jewels. Lumino...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Just i can told u looking for that for 6 mounth help me plea, how can i add...

how can i add script code in anouncement of a channel in a massneger the massnegr suport that but do not published it please help me please:((((((((((((((((((((((((((((((((((((((((

What is the core container module, This module is gives the fundamental fun...

This module is gives the fundamental functionality of the spring framework. In this module BeanFactory is the heart of any spring-based application. The whole framework was built o

Tasks with the classes Currency, In this assignment you work on a set of ta...

In this assignment you work on a set of tasks with the classes Currency, Money and Bank. Money and Currency You have been given a template for the Currency and Money classes (Lab1.

I want prosport savings plans, I want ProSport Savings Plans Project Des...

I want ProSport Savings Plans Project Description: To prepare an application on iPhone, Mac, iPad and Android, which does the subsequent:- Provides a calculation of the am

Need software protection with data files encryption, Need Software protecti...

Need Software protection with data files encryption Project Description: I am use to Chinese dongle sense lock clave 2, i need to prepare to dongle encryption tool same appli

COMPRE METHOD, Implement the compare method of the following class Rectangl...

Implement the compare method of the following class RectangleComparator. The method compares two rectangles. The method should return: A positive integer if the area of the first r

Write Your Message!

Captcha
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