Code Monkey home page Code Monkey logo

split_class-assign_schedule-algorithm's Introduction

分班、排课算法的Django http服务代码库

Python精确分班、排课算法在schedule_class/algorithrmapp/algorithm目录下

Java 聚类、邻域搜索算法在AssignClass目录下

算法介绍

  1. 分班算法

分班算法采用2级缓存结构,包含一级精确分班算法和二级聚类分班算法:

  第一级,精确分班算法根据聚类分班结果提取出命中频率最高的6类结果,采用分枝回溯算法以及邻域搜索策略进行精确搜索。
  
  第二级,采用聚类算法和邻域搜索算法进行分班类别的大规模搜索。

算法优点:

  本算法采用2级缓存机制,通过高频缓存的方法,提高整体运行效率。
  
  算法在聚类后设计了多种邻域搜索策略,搜索范围广,稳定性强。

算法适用范围:

  算法适用于高中定二走一的分班情景。能够按照成班人数限制,将所有学生按定二走一分班,并满足走班的学生能够按科目再次分班。
  1. 排课算法

排课算法是一个基于贪心算法和邻域搜索算法的二阶段启发式算法:

  第一阶段根据排课约束条件间的逻辑关系采用多层次贪婪算法对约束条件解耦,生成高质量的初始解;
  
  第二阶段根据实际排课经验设计6种邻域搜索策略快速搜索可行解。

算法优点:

  本算法分层解耦的贪心策略以及6种邻域搜索策略,搜索靶向性强。相比传统的遗传算法更加高效,适应于解决多约束、强约束条件的排课情景。
  
  贪心算法采用随机策略,能够有效跳出局部最优解,搜索范围广。 
  
  邻域搜索算法根据实际排课经验设计,排课结果更符合实际条件。 
  
  算法数据结构设计采用缓存结构设计,运行效率高。

算法适用范围:

  高中定二走一的排课情景。能够实现排连结课(多个班级不同科目同时上课)、排连堂课(连堂课天数不相邻)、设置固定不排课时间、手动排课、特定教师不排
  
  课、固定不排科目(设置教研组)、科目特定时间不排课、新增额外排课等功能。

Pyhton算法引擎-安装步骤

1、安装django

pip3 install django -i https://pypi.tuna.tsinghua.edu.cn/simple/

2、安装pymysql

pip3 install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple/

3、激活虚拟环境

source bin/activate

4、遇到问题:You have 17 unapplied migration(s)....

解决方法

python3 manage.py migrate

split_class-assign_schedule-algorithm's People

Contributors

zhangxin0 avatar

Watchers

 avatar

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.