Implemented in JAVA using Genetic Algorithm