11 Replies Latest reply: Oct 8, 2007 2:19 PM by 807605 RSS

    Genetic Algorithms

    807605
      Hi Iam new to GA's

      My Individual genome is of the form [a1,a2,a3,.....an, g11,g12,g13.....gij, h11, h12,     hij]

      Search regions
      a -- 0-3
      g- 0-3.5
      h-0-1

      If iam doing mutation how can i specify boundaries i.e. a1 value shouldnt not mutate with g11value and so on(Iam not clear with this)

      Thanks For Help
        • 1. Re: Genetic Algorithms
          796254
          You should encapsulate the genome into a class and apply those rules inside a "mutate" method. Hide those details from clients.

          %
          • 2. Re: Genetic Algorithms
            807605
            Hi Can you be little more specific. I am very new to genetic algorithms

            my genome is like two vectors of size n and two n x n matrices


            Thanks For Help
            • 3. Re: Genetic Algorithms
              796254
              bobby24 wrote:
              Hi Can you be little more specific. I am very new to genetic algorithms
              No, it sounds like you're new to Java. My answer has almost nothing to do with GA and everything to with object-oriented programming, encapsulation, and information hiding.

              If by "more specific" you mean "post code", I can't do that. Don't have any to post even if I wanted to.

              Think about what GA is and develop an interface for the methods you'd want to call for it. Since GA can generate a lot of chromasomes, maybe a factory with a cache inside would be a good idea.
              my genome is like two vectors of size n and two n x n matrices
              How interesting. The Goldberg book only shows how to do it with a vector of length n. What are the matricies for?

              %
              • 4. Re: Genetic Algorithms
                807605
                Actually iam new to java also

                my genome is some thing like this


                |a1 g11 g12 b1 h11 h12|
                |a2 g21 g22 b2 h11 h12|
                |a3 g31 g32 b3 h11 h12|
                . . . . . .
                |an gij gik bn hij hik|




                i have search space for values a and b(ex: a and b range from 0, 10 etc)
                like wise for g and h whenever iam doing mutation i want to impose that search space so that a doesnt take values of h etc


                Thanks For Help
                • 5. Re: Genetic Algorithms
                  807605
                  Actually iam new to java also
                  Um. Mighty big first step.
                  List of Learning in Java
                  1. Hello World App
                  2. Genetic Algorithms
                  • 6. Re: Genetic Algorithms
                    807605
                    Um. Mighty big first step.
                    List of Learning in Java
                    1. Hello World App
                    2. Genetic Algorithms
                    Don't you think the step from 1. to 2. is still somewhat big'ish? =)

                    #
                    • 7. Re: Genetic Algorithms
                      807605
                      are you trying to solve knights tour or something?
                      • 8. Re: Genetic Algorithms
                        796254
                        mkoryak wrote:
                        are you trying to solve knights tour or something?
                        GA is an optimization technique that works well for discrete data and cases where gradients can't be calculated easily.

                        It might be applicable to solving a problem like knights tour, but I don't think it's necessary. I haven't seen that solution to KT:

                        http://mathworld.wolfram.com/KnightsTour.html

                        %
                        • 9. Re: Genetic Algorithms
                          807605
                          Not Actually

                          a and b represents protein concentrations and h g represents reaction rates. i just wanna make sure that when i do mutation i dont get value for search space of other variable

                          my algorithm

                          populate values of a,b,g and h by randomly generated variables with in search range and calulate value of f(x)
                          evaluate objective function g(x) g(x) = f(x)i - f(x)g (f(x)i value is computed from above step other from lab experiments)
                          now if value of objective fn is less than threshold terminte
                          else
                          crossover
                          mutate
                          new child is again fed to step 1 until threshold is reached


                          Thanks for Help
                          • 10. Re: Genetic Algorithms
                            807605
                            duffymo wrote:
                            mkoryak wrote:
                            are you trying to solve knights tour or something?
                            GA is an optimization technique that works well for discrete data and cases where gradients can't be calculated easily.

                            It might be applicable to solving a problem like knights tour, but I don't think it's necessary. I haven't seen that solution to KT:

                            http://mathworld.wolfram.com/KnightsTour.html

                            %
                            the reason i brought that up is that i had to solve knights tour in my GA class once, though i might have used genetic programming. All i remember is that moves were represented as sequences of genes and you would mutate them
                            • 11. Re: Genetic Algorithms
                              807605
                              Yes, Ga's are applied for various types of problems(Thats the reason i posted brief algorithm), In my case there are different search spaces involved as i have a heterogeneous parameters, so iam having difficulty in assigning those spaces or boundaries


                              Thanks For Help