Gabriele Rossi created MATH-1451:
------------------------------------

             Summary: Infinite loop for CycleCrossover with duplicates
                 Key: MATH-1451
                 URL: https://issues.apache.org/jira/browse/MATH-1451
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.6.1
         Environment: Home PC
            Reporter: Gabriele Rossi
         Attachments: test-apache-math3.zip

I've found an infinite loop when recombining two integers Chromosomes admitting 
duplicates with CycleCrossover class.

For example, recombining example Chromosomes it works fine, but, if you 
substitute all "8" with "7", you run into an infinite loop while mating.

I attach the self-contained unit test (JUnit) for a better comprehension (issue 
a mvn clean install to run).

I added a little quick patch to fix, which I'm happy to provide, even could be 
less efficient than original.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to