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

Program to store student record, Write a program called Grid. The program s...

Write a program called Grid. The program starts by prompting (asking) the user for the name of an input text file. This file is guaranteed to be correct and has the following fo

Rebuilding a server environment, Project Description: We prepare and ope...

Project Description: We prepare and operate smartphone application.(Picture sharing and social networking) But there are problems in server side. It's very slow. So we

Basic difference between java and c++, Both Java and C++ use same syntax an...

Both Java and C++ use same syntax and are Object Oriented, but there are several differences between Java and C++:   1.    Java does not use pointers. Pointers are inherently

Extensible messaging and presence protocol, According to XMPP Standards Fou...

According to XMPP Standards Foundation "XMPP is the Extensible Messaging and Presence Protocol, a set of open technologies for instant messaging, presence, multi-party chat, voice

Explain animate gifs, Explain Animate gifs? We can save 16 gif images ...

Explain Animate gifs? We can save 16 gif images of the previous instance in a single file in the form of an animated gif, and then used it in a regular tag to display a movi

What is spring, Spring is an open source framework created to address the d...

Spring is an open source framework created to address the difficulty of enterprise application development. One of the chief benefits of the Spring framework is its layered archite

I need gpa calculating application, I need GPA calculating application P...

I need GPA calculating application Project Description: My project is one of the GPA calculating application, Colleges have 37 courses or departments, engineering results alw

Program on while and until loop, Question Based on the program fragmen...

Question Based on the program fragment below, rewrite the outer for loop using: a. while loop b. repeat..until loop

Series, Write a Java program to find the sum of 1+3+5+…. , for 10 terms in ...

Write a Java program to find the sum of 1+3+5+…. , for 10 terms in the series.

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