Coder Social home page Coder Social logo

genetic_algorithm_timetable's Introduction

Timetable with genetic algorithm (GA)

Description

Improving the GA by applying the eugenics to optimize the running time and escape from local maxima in a non-convex optimization problem

The progress of algorithm

GA_process

Input:

[[Course ID, Teacher, The number of hour of class, Student class, Course name, The room type need to use]]

[[Room, The room type]

Each week is divided into 12 blocks (from monday to friday)

Each block is divided into 6 class period (both in the morning and afternoon)

Output:

[[Course ID, Teacher, Room, Block position in the week, The beginning point of class, The number of hour of class, Student class, Course name, Room type]]

Math clause

- Decision variables:   A{a,b,c,d,e,f,g,h,i} 
                            a = {Course ID}
                            b = {teacher} 
                            c = {Room} 
                            d = {1, … , 12} - The block position in the week 
                            e = {The number of hour of class} 
                            f = {1, … , 6} - The beginning point of class (each block has 6 beginning points to separate 6 periods)
                            g = {Student class}
                            h = {Course Name}
                            i = {Room Type}

- Conditions:    

    * Same teacher:        (*)      
            ∄ (p1{a1,b1,c1,d1,e1,f1,g1,h1,i1} = p2{a2,b1,c2,d2,e2,f2,g2,h2,i2} and p1,p2 ∈ A) 
                    ∀ (d1 == d2) and 
		            [(f1 < f2) and (f1 + e1)>f2] or [(f1 > f2) and (f2 + e2)>f1] 

    * Same room:           (**)        
            ∄ (p1{a1,b1,c1,d1,e1,f1,g1,h1,i1} = p2{a2,b2,c1,d2,e2,f2,g2,h2,i2} and p1,p2 ∈ A)
                    ∀ (d1 == d2) and 
		            [(f1 < f2) and (f1 + e1)>f2] or [(f1 > f2) and (f2 + e2)>f1]

    * Same student class:  (***)
            ∄ (p1{a1,b1,c1,d1,e1,f1,g1,h1,i1} = p2{a2,b2,c2,d2,e2,f2,g1,h2,i2} and p1,p2 ∈ A)
                    ∀ (d1 == d2) and (h1 != h2)
		            [(f1 < f2) and (f1 + e1)>f2] or [(f1 > f2) and (f2 + e2)>f1]

    * Same room type:      (****)
            ∄ p{a,b,c,d,e,f,g,h,i2} and p ∈ A
                    and c have i1
                    and i1 != i2

- Target:

    * ∃ A{a,b,c,d,e,f}   Satisfies  (*), (**), (***) and (****)

How to run

python3 src/main.py

genetic_algorithm_timetable's People

Contributors

dangha avatar

Stargazers

 avatar Mike Wilson avatar Ha avatar

Watchers

James Cloos avatar  avatar Tieu Phong avatar

Forkers

siwtom

genetic_algorithm_timetable's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.