Crossover Function for Genetic

I am writing a time table generator in java using AI approaches to satisfy tight constraints and help find the best solution. So far I have implemented both an iterative construct (the most limited first heuristic) and Simulated Annealing, and I am in the process of implementing a genetic algorithm.

Some information about the problem and how I present it then: I have a set of events, rooms, functions (which require events and rooms), students and slots The problem is to assign a slot and room to each event, so that none the student was not supposed to attend two events in one slot, all assigned numbers meet the necessary requirements.

I have a rating function that for each set, if assignments value soft constraint violations, so the point should minimize this.

As I implement GA, I start with the aggregate generated by the iterative construct (which can leave events unassigned), and then follow the usual steps: evaluate, select, cross, mutate, and preserve the best. Rinse and repeat.

My problem is that my solution seems to be improving too little. No matter what I do, populations are prone to random physical form and stuck there. Please note that this suitability is always different, but a lower limit will nevertheless appear.

I suspect the problem is in my crossover function, and here is the logic:

. A B. B ( B):

. 3 .

  • , .
  • , , .
  • , , .

.

, , , . , .

, SA, , .

. , 100, GA () . - , ?

:

+3
5

, GA , ( ) , . , , , . , . ( ) , , .

, GA - .

0

, . .

. , , .

, ( ). ( ) . , .

, ? - . , , .

, .

. .

- .

http://people.brunel.ac.uk/~mastjjb/jeb/or/moreip.html

java .

http://javailp.sourceforge.net/

SolverFactory factory = new SolverFactoryLpSolve(); // use lp_solve
factory.setParameter(Solver.VERBOSE, 0); 
factory.setParameter(Solver.TIMEOUT, 100); // set timeout to 100 seconds

/**
* Constructing a Problem: 
* Maximize: 143x+60y 
* Subject to: 
* 120x+210y <= 15000 
* 110x+30y <= 4000 
* x+y <= 75
* 
* With x,y being integers
* 
*/
Problem problem = new Problem();

Linear linear = new Linear();
linear.add(143, "x");
linear.add(60, "y");

problem.setObjective(linear, OptType.MAX);

linear = new Linear();
linear.add(120, "x");
linear.add(210, "y");

problem.add(linear, "<=", 15000);

linear = new Linear();
linear.add(110, "x");
linear.add(30, "y");

problem.add(linear, "<=", 4000);

linear = new Linear();
linear.add(1, "x");
linear.add(1, "y");

problem.add(linear, "<=", 75);

problem.setVarType("x", Integer.class);
problem.setVarType("y", Integer.class);

Solver solver = factory.get(); // you should use this solver only once for one problem
Result result = solver.solve(problem);

System.out.println(result);

/**
* Extend the problem with x <= 16 and solve it again
*/
problem.setVarUpperBound("x", 16);

solver = factory.get();
result = solver.solve(problem);

System.out.println(result);
// Results in the following output:

// Objective: 6266.0 {y=52, x=22}
// Objective: 5828.0 {y=59, x=16}
0

, . , " ", ?

, , , "", . , , - , , A B, B . A B B A.

, . , - , , "" .

, , . , -, , , . , .

0

, , , .

:

, "" , ? "" ? , "" "" , .

, . , , "" (, // ..) , GA , , , , , , , 't ?

: , , . ( 2D-) ? , , . googling "ga gene presentation time tabling", , , (100 - GA, , , ?).

- , , Java, GA , ECJ. , , .

0

GA :

  • , , , () . , , . , , , , , , , . () , , , , . - ( 100%, - ) , , , , , .

  • , , . . , , , , .

  • . , , . , ( ) . , , , 100% . .

, , , : GA , . ( , - , ..) , . , /, GA. , , GA , , , GA , , , - .

0

All Articles