Visualisation of Genetic Algorithms for the Traveling Salesman Problem in Java --by Johannes Sarg

The Traveling Salesman Problem (TSP)

Find the shortest trip through n towns where each town must be visited exactly once.

In the following we define that from each town all other towns can be visited. The costs to visit a town from another are represented by their euklidic distance. Therefore the costs are reflexive.


The Genetic Algorithm (GA)

A GA tries to use basic principles of natural evolution. It is especially appropriate for problems with large and complex search-spaces, where the global optimum can't be found within a reasonable amount of time using traditional techniques as e.g. total enumeration or branch and bound. It cannot be guaranteed that the optimum solution is found by the GA. Here are some references for GAs.

Structure of a GA:

procedure GA
begin
t = 0;
initialize(P(t));
evaluate(P(t));
while (not termination condition)
begin
t = t + 1;
Qs(t) = selection(P(t-1));
Qr(t) = recombination(Qs(t));
P(t) = mutation(Qr(t));
evaluate(P(t));
end;

end;

Description:

A set of potential solutions are randomly initialized and their quality evaluated. Out of this set better solutions are preferred, corresponding to a probability distribution. Each time, two of the selected solutions creats new solutions by recombination which finally are mutated. These generated solutions are evaluated and represents the basis for the next generation. In this way a GA tries to find better solutions and to reach the global optimum.


Objectives of the program TSPGA

  • exact simulation and visualisation of a GA run
  • visualisation of the mutation and recombination methods
  • possibility to compare different GA runs concerning the same TSP

The GA for TSPs

In the "Options" menu, you can configure the following properties for the GA:

GA parameters:

  • recombination methode:
    • Partially Matched Crossover (PMX)
    • Order Crossover (OX)
    • Cycle Crossover (CX)
    • Uniform Order Based Crossover (UOBX)
    • Edge Recombination Crossover (ERX)
    • ERX with heuristic (Grefenstette)
    • None
  • recombination probability (0% - 100%)
  • mutation methode:
    • Inversion
    • Insertion
    • Displacement
    • Reciprocal Exchange (Swap)
    • None
  • mutation probability (0% - 100%)
  • population size (5 - 100)
  • k value for the Tournament selection (1 - 10)
  • elitism (true / false)

Set Problem: A grid can be defined where the user can set the positions of the towns (4 - 100 towns).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值