Local Search Defined

Local Search Defined
Travelling salesman problem?

I'm trying to code a solution to the traveling salesman problem in java. I have a work for the establishment of a branch and bound search and just need to specialize the methods to solve the problem at hand. How should I represent a state? For example, if it was a simple move from one target destination beginning to end, you only have to specify the name of the town and the local cost. However, because they have to visit all cities and then return to the starting position do not know how to define the representation of the state to meet this. Thanks

I guess you are talking about making a class / object that represents this state. If this is correct, then I could do something as simple as this. (Private-public class City name; private State theState;) (Private-public class City from State, private costs;) have methods that set and get the name, status, since the cost. The name would be the name the city. The City would be the path is. The cost is the local cost. Hope that helps.

This entry was posted in Local Search. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>