Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:07:29+00:00 2026-06-08T20:07:29+00:00

I’m using a genetic algorithm (GA) to optimise a traveling salesman problem (TSP). My

  • 0

I’m using a genetic algorithm (GA) to optimise a traveling salesman problem (TSP). My problem is how I calculate the fitness of an individual.
Obviously solutions with shorter routes are fitter but how exactly do I assign a fitness value without knowing what the shortest possible route and longest possible route is to determine where my solution fits in that range?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:07:31+00:00Added an answer on June 8, 2026 at 8:07 pm

    Having fitness equals to path length is fine. Keep in mind that in genetic algorithms the fitness is only used for selecting individuals: consequently with usual selection procedures the scale does not matter, only the rank does.

    Examples of implementation:

    • http://www.codeproject.com/Articles/1403/Genetic-Algorithms-and-the-Traveling-Salesman-Prob
    • http://khayyam.developpez.com/articles/algo/voyageur-de-commerce/genetique/ (use Google translate)
    • http://www.lalena.com/ai/tsp/
    • http://www.mathworks.com/matlabcentral/fileexchange/13680

    More subtleties (2001 – Swarm Intelligence – Kennedy & Eberhart – page 249):

    Pablo Moscato is a South American researcher who has pioneered the
    study of memetic algorithms (e.g., Moscato, 1989). He and Michael
    Norman, who is now in Scotland at the University of Edinburgh, began
    working together in the 1980s at Caltech. In a recent paper they
    describe the use of a memetic algorithm for optimization of a
    traveling salesman problem (TSP) (Moscato and Norman, 1992). Recall
    that the TSP requires finding the shortest path through a number of
    cities, passing through each one only once. The problem has a rich
    history in applied mathematics, as it is very hard to solve,
    especially when the number of cities is large. TSP is an NP-hard
    problem, which suggests that if a way is found to solve it, then a
    large number of other problems will also have been solved. Moscato and
    Norman use an algorithm with both cooperation and competition among
    agents in the population, and implement a hybrid version of simulated
    annealing for local search.

    A population of individuals—these
    researchers usually use a population size of 16—searches the problem
    space, which is defined by permutations of the cities, called “tours.”
    The population is conceptualized as a ring, where each individual is
    attached to its two immediately adjacent neighbors, with whom it
    competes in the search; individuals are also connected to others on
    the far side of the ring, with whom they cooperate. Each individual in
    the population comprises a tour of the cities. Competition is seen as
    “challenge” and “battles” between pairs of individuals, where the tour
    lengths of an individual and its neighbor are compared and a
    probability threshold is set based on the difference. The difference
    between the tours’ lengths affects the steepness of the sshaped curve;
    when the difference is small or the temperature is cool, the
    probability distribution becomes nearly uniform, and when the
    difference in lengths between the two tours is great, the probability
    is increased that tour 1 will be deleted and replaced with a copy of
    tour 0.

    Cooperation is used to let more successful individuals “mate”
    with one another, rather than with less-fit members of the population.
    The same rule that is used in deciding competitive interactions is
    used to assess the desirability of partners for crossover, which is
    implemented just as it is in GA. One individual “proposes” to another,
    and if the proposition is accepted, that is, if the stochastic
    decision favors their interaction, then the crossover operator is
    implemented. Thus the next generation is created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.