• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generic Algorithm  RSS feed

 
Juwonlo Ibigbami
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pls can enybody tell me about generic algothim with respect to java, it applications and it advanteges

Juwonlo - Nigeria
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you're referring to. Could you tell us where you heard the term? Is it possible you meant genetic algorithm? Or just generics, without the word algorithm?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since your last question was about how to build a search engine, you most likely mean genetic algorithm (not generic).
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A genetic algorithm is trivial in any programming language and so it easy to implement in Java. It is capable of finding global maxima much much quicker than other methods such as simulated annealing, as you can only jump between neighbouring solutions using a SA algorithm rather than around the entire search space with a GA (made possible through crossover). Consequently, it is much less prone to getting stuck in a local maxia (which is a problem if you are trying to maximise the fitness value) or local minima (which is a problem if you are trying to minimise the fitness value)

As for applications, I programmed an automated timetabling system that timetable extra curriculum activies (such as workshops, group meetings, tutorials) around an existing lecture timetable which had to take into account 8 constraints/rules on how they had to be timetabled. This employed a GA - worked really well.

A genetic algorithm involves the use of encoding a solution as a chromosome and optimising that solution through the use of mutation and crossover operators - hence 'genetic' as it is imitating what happenins in out DNA - over a number of generations until either the maximum number of generations have been met or the desired fitness has been met/exceeded.

This means you will need a fitness function also that will evaluate your solutions that are present in the initial population and then present in the subsequent populations formed over the different generations.

Here is an outline of a GENERAL GA:



Note: the population sizes you are working with are up to you but there will be a range of sizes that will be optimal for the problem you have i.e. will allow you to find the BETTER solution quicker

There are many different ypes of crossover and mutational methods you can employ. Crossover will depenend on your encoding of the chromosome you use and sometimes standard crossover will not work and so you may need to use different forms, such as partially matched crossover (PMX).

You will need to decide if you want to score your solutions by giving those that are 'better' lower or higher scores - if you assign higher values to more desirable solutions then you will be aiming to achieve a global maxima, otherwise you will be aiming to achieve a global minima.

Let me know if you have any other questions.

[ May 30, 2007: Message edited by: Sam Bluesman ]

[ May 30, 2007: Message edited by: Sam Bluesman ]
[ May 30, 2007: Message edited by: Sam Bluesman ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JGAP is a Java implementation of a genetic algorithm/programming framework.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!