Algorithm Schedule. Science make a schedule

Suppose there are many n.identical processors, designated, and M independent tasks
to be executed. Processors can work simultaneously, and any task can be performed on any processor. If the task is loaded into the processor, it remains there until the end of the processing. Task processing time it is also known
Organize task processing so that the entire set of tasks is completed as quickly as possible.

The system works as follows: The first released processor takes the following task from the list. If two or more processors are simultaneously freed, then the next task from the list will be the processor with the smallest number.

Example. Let there be three processors and six tasks, the execution time of each of which is:

Consider the schedule at the initial moment of time. T \u003d 0.Processor begins to handle the task Processor - tasks and processor - tasks . CPU finishes the task at the time of time
while processors and still working on their original tasks. For T \u003d 3.cPU again finishes the task and begins to handle the task that ends at the time T \u003d 4.. Then he begins to fulfill the last task . Processors and finish tasks T \u003d 5.but since the list L.empty, they stop. CPU completes the execution of the task for T \u003d 12.. The reviewed schedule is illustrated in Fig.1. temporary diagram known as gantta scheme. Obviously, the schedule is not optimal. You can "pick up", for example, a schedule that allows you to complete all tasks for T * \u003d 8units of time (Fig.2.).

Now consider another type of task to draw up a schedule for multiprocessor systems. Instead of the issue of the fastest completion of the setup set by a fixed number of processors, now we will now put the issue of the minimum number of processors required to complete this set of tasks for a fixed time . Of course time there will be no less than the time of the time-consuming task.

In such a formulation, the task of drawing up the schedule is equivalent to the next packaging problem. Let each processor corresponds to the box size . Let each task be corresponds to the size of size equal to task execution where
Now, to solve the task of drawing a schedule, you need to build an algorithm that allows you to place all items in the minimum number of boxes. Of course, it is impossible to fill in the boxes above their volume. , and items can not be crushed into parts.

Literature

1. T. Corner, Ch. Leiserson, R. Rivest

Algorithms: Building and analysis. M.: MCSNMO, 2000.

2. D.knut art programming, Volume 1. Basic algorithms. Uch. pos. M.: ed. House "Williams", 2000.

3. Wirth N. Algorithms and Data Structures.: Pen. From English - M.: Mir, 2001.

4. Husainov B.S. Structures and data processing algorithms. Examples on

si language. Studies. benefit. M: Finance and statistics, 2004.

5. A. Aho, J. Chopcroft, J. Ulman, Data Structures and Algorithms M: St. Petersburg: Kiev: Williams, 2001.

Silence reigned, which Sewing himself broke, having sigh:
- ... in military service there must be a discipline - no one would have moved to the finger to a finger. Our Ober Lieutenant Makovets always said: "Discipline, nerds, necessary. Do not be discipline, you would like monkeys, Lasili trees. Military service from you, fools brainless, people will do! " Well, isn't it? Imagine the Square, say, on the Karlova Square, and on each tree sits one by one soldier without any discipline. It scares me terribly.
Yaroslav Gashek Adventure of the Brave Soldier Schweik

Schedule class, this is a combination in space and time of discipline (subject), teacher (teachers), audiences and groups (subgroups, stream) students.

Formulation of the problem

I will brief.

  • When conducting classes, there may be no one participants, for example, at a meeting of the department, students usually do not come or students went to military Department (They have their own schedule), and in order for the kind of classes there is no discipline, teacher and audience.
  • As a rule, the necessary requirement is the continuity (lack of windows) in students and preferably among teachers.
  • The schedule can be prepared on the semester / half-month for weeks, for two weeks and numerator / denominator (odd week / even week). There is also a schedule for a month.
  • Classes should be able to perform in manual mode (in other words in the editor). For example, a scientific council or a couple of the Bolshoi Chief and even a lesson is just a good person.
  • There must be a system of prohibitions for all participants in the lesson. For example, now almost all teachers work on the side (otherwise you will not live) or the auditing fund is divided between the faculties and it is impossible to put on the lunch to the part of the audience.
  • Availability of sophisticated wishes of teachers, one pose 5 couples per day to free other days, and other more than two pairs per day do not put, it is overwhelmed, and if a lecture, then one pair and necessarily 2 or 3 more.
  • Classes in different buildings requiring time to go more than a break time between classes. Naturally and the condition of minimizing displacements.

Output. As can be seen from the formulation, evaluate the quality of the schedule is possible, only after its complete compilation. Consequently, the use of genetic algorithms can allow to build a solution to the desired task and even get one of the good in a sense. In this case, genetic algorithms are very quickly converged to the optimal at the beginning and it means almost there will not be restrictions on the volume of input data.

The picture is taken from here.

Genetic algorithm

Pure rhetorically, I repeat the main stages of the genetic algorithm:

  1. Set the target feature (fitness) for individuals of the population
  2. Create an initial population
  3. (Cycle Start)
    1. Reproduction (crossing)
    2. MUNING
    3. Calculate the value of the target function for all individuals.
    4. Formation of a new generation (selection)
    5. If the stop conditions are performed, the end of the cycle, otherwise (the beginning of the cycle).

The most characteristic error of the use of genetic algorithms is to choose genes. Often, the solution is often chosen as genes. The selection of genes is the most nontrivial and creative element in creating a genetic algorithm. Personally, I believe that the selection of genes should meet the two of the following basic requirements.

  1. On the set of genes, the decision of the desired task should be built quickly and unambiguously.
  2. When crossing, the descendant must inherit the characteristic features of the parents.

Comment. The set of genes should give the entire set (possibly optimal) solutions of the problem. In principle, it is not necessary to require mutual unambiguity, it is enough for the mapping of genes to the solution space on the (Surifying).

Algorithm of drawing schedules

I will only describe the genes yourself, the algorithm for building them on them, crossing and mutation.

As the schedule of an experienced dispatcher. The word experienced means that the dispatcher was already / and the schedule is already talking at times and knows its bottlenecks. For example, a shortage of large streaming audiences or computer classes. The first course, since they have a lot of streaming lectures and at the same time classes in subgroups on computer classes, English / English from scratch / German / French, etc., and the bosses require that the first course does not have no windows in any case. And no more than two lectures on the day and days were uniformly loaded. Therefore, the experienced dispatcher puts first "narrow classes", classes of bosses on their demand and classes of particularly annoying teachers. Then using an arranged classes as a skeleton, quickly completing the schedule. Let's try to imitate, in a sense, this process.

Part of the classes are already in the schedule, which remain consistently. An array of occupation numbers will be considered genome, although in principle only the order of classes is important here. To build a schedule, we will consistently remove the numbers of classes and put the selected lesson in the schedule satisfying the necessary requirements and maximizing the target function for students, teachers and audiences (they also have employment criteria).
If the necessary requirements fail to satisfy, the individual with such a genome can be discarded as a non-visual. If the schedule does not work out, you can replace the necessary requirements with a fine in the target function.

Crossing can be organized in several ways. For example, one of them. Let we have the following genes

3 1 2 5 6 4 7
2 3 5 7 1 4 6

Here it is clear that the occupation 3 is found in both genes to position 2 inclusive, and, for example, from position 2 to position 5 interval for 1 classes. We will make the following tablet

_ * * * * _ _ for 1 classes
* * * _ _ _ _ for 2 classes
* * _ _ _ _ _ for 3 classes
_ _ _ _ _ * _ for 4 classes
_ _ * * _ _ _ for 5 classes
_ _ _ _ * * * for 6 classes
_ _ _ * * * * for 7 classes

here, asterisks marked the possible positions for the appearance of the descendant. You can choose from one or more possible solutions as a descendant or descendants of these parents. The decision to select the descendant genes is always, for example, both parents themselves satisfy him. Rewrite a table through many possible positions

1 position (2, 3)
2 position (1, 2, 3)
3 position (1, 2, 5)
4 position (1, 5, 7)
5 Position (1, 6, 7)
6 position (4, 6, 7)
7 Position (6, 7)

To build solutions, you can use the following algorithm. First we will put the numbers of classes that are less likely. If they sort them ascending, then we will have
1 time 4.
2 times 3, 5
3 times 2, 6
4 times 1, 7
Consequently, first put 4 lessons on the 6th position, then 3 or 5 in position (1, 2) or (3, 4), respectively. At each step you can throw boxes of matches. As a result, you can get the following steps for crossing algorithm

* * * * * 4 *
3 * * * * 4 *
3 * * 5 * 4 *
3 * * 5 * 4 6
3 * 2 5 * 4 6
3 * 2 5 7 4 6
3 1 2 5 7 4 6

Since it is possible to build the correct sequence, it is better to organize an algorithm in the form of a simple recursion to repeat the algorithm, i.e. Organizations of some bore.

Mutation can be organized enough simple, random permutation of occupation numbers.

Conclusion

This is a continuation, in a sense, my posts program to draw up the schedule of classes in the university and the calculation of the load on the department.

Re-suggest the following solution (sketch).

  • GUI on pyqt or pyside
  • POSGRESQL DBMS (I'm ready for about 80% here), in addition, there are still applications and loads of teachers, curricula, and a lot more (for this purpose, publish one or more topics)
  • web interface on Cherrypy + Cheetah (but it can be discussed)
  • exports of all reports (schedules, curriculum cards, etc.) in OpenDocument format (GOST R ISO / IEC 26300-2010. State Standard of Russia (01.06.2011)) via ODFPY
  • schedule compiling algorithms from me (this topic is about this)
  • staging from me
  • for interested work on a common core
  • for interested adaptation under its own university and the opportunity to change everything flexibly, life goes, and officials do not dorm

Thanks to everyone who responded, after discussing this topic, it will be possible to organize.

Schedule lesson regulates the rhythm of school life, work and leisure of students and teachers.
The effectiveness of the entire educational process depends on its quality.

Acceptability of lessons and school schedule

The school curriculum must comply with the functional capabilities of students. Volume, content and organization educational process Must ensure such a state of the body, in which fatigue would completely disappear for the rest period.

The main criteria for estimating lessons in terms of functionality of students - difficulty and tired. Tedisality is characterized by a change in performance, and the difficulty of the subject - the level of academicity, that is, the degree of assimilation educational material. Therefore, when drawing up a schedule, it is necessary to take into account both factors equally.

In a legal aspect, the problem of creating a school schedule was reflected in new hygienic requirements for the preparation of the schedule, which are based on the data of modern scientific research of the biiorimology of mental performance and the difficulty table of the subjects of IG. Sivkova. However, for the deputy director of the school, which is the schedule, it is important not only to know how difficult it is to provide the force of the tiring of lessons on a particular subject on the health status. Unfortunately, table difficulty I.G. Sivkova does not take into account such a component of learning, as tiriness of objects, which primarily affects the health of the student.

Modern studies give an idea of \u200b\u200bthe dependence of the tediousness of the subject from its difficulty, although in some subjects, these indicators differ significantly. These ideas make it possible to combine two indicators in one - the acceptability of the subject. Therefore, Table I.G. Sivkova can be offered an alternative - the scale of the admissibility of objects, which would take into account the components of the difficulty and tiriness of training, as well as the features of each educational institution and curriculum of each class.

The acceptability scale consists of a column of "rank items", where items are made, the ranks of which were obtained by the results of the diagnosis of their difficulty and tedivity by the method expert assessments - Their algorithm is represented in Appendix 1. By its structure, the proposed scale of constant, and according to the content of the variable (see Table 1).

Table 1

Sample scale acceptability

As can be seen from Table 1, the scale consists of five groups of difficulties. Each group has an estimate in points - this is a permanent component of the scale, not subject to any changes. Content (i.e., a set of items) of each group may vary depending on the results of the diagnosis. It is a variative part of the scale.

In secondary school No. 618 of St. Petersburg, we received the following scale of the admissibility of objects (see Table 2).

table 2

Object acceptability scale

Algorithm for drawing a schedule

Since in each educational institution, the admissibility of objects will be their own, readers should not be copied to the one-to-one scale. It is advisable to diagnose the degree of difficulty and tiriness of items in your school by expert assessments.

In addition, when drawing up a schedule, it makes sense to guide the ranking table of the level of working capacity of students in different classes in various lessons during the school week (see Appendix 2).

We have created an algorithm for the preparation of a physiologically reasonable schedule, which takes into account actually fulfilled hygiene requirements. This algorithm can be used to compile a training schedule both at school with a large number of classes of the second and third steps and in a relatively small educational institution. The algorithm is intended for specialists who make up a schedule without using computer Program.

When using automated programs, it is advisable to perform the alignment of items using the automated program in stages based on the proposed algorithm. As practice shows, these programs can only be used as auxiliary tool for:

  • initial arrangement of objects with subsequent manual finishing;
  • saving information and output it to print.

After the automated distribution of objects (the program, as a rule, places from 40 to 70%), consider the hygiene requirements for the schedule of lessons is almost impossible, since it is necessary not only to deliver the remaining unsightened items, but also to significantly change (up to 60%) automated alignment of items on the principle "If you plan."

Therefore, when using a computer program for compiling a rational schedule, taking into account the actual feasible hygienic and pedagogical requirements, the specifics of the educational institution need to be aligned to perform stages using the algorithm proposed above. At the same time, each stage of the arrangement of a group of objects should end with manual finishing with the orientation on the above requirements. This will allow you to more rationally make a schedule and, if possible, take into account all the necessary conditions.

Procedure for changing the schedule

School Schedule Adjustment Algorithm

If necessary, change the schedule during the school year, which occurs quite often, you need to work with the table layout. To change the schedule, it is necessary to perform the following calculations and permutations.

The proposed method of drawing up the schedule takes time no more than usual, but allows you to make a schedule competently, i.e.:

  • make its own scale of admissibility of objects (difficulties and tired) to compile a more rational school schedule;
  • to keep in the field of view of the deputy director of the school a sufficiently large number of necessary information;
  • evenly distribute lessons for every day (avoid unnecessary number of seventh lessons);
  • put all the classes from the first lesson, which allows you to provide training in one rhythm, because every day students will start a school day at the same time;
  • regulate the degree of complexity of the school, depending on the dynamics of the weekly performance of schoolchildren;
  • express the lessons with almost no "windows" either with the minimum amount of them, which allows you to maintain the rhythm of the teacher's work and create a favorable working mode;
  • rationally alternate objects of different focus;
  • rationally arrange the necessary dual lessons;
  • quickly change and adjust the schedule due to production necessity.

In addition, with this method, it does not require a significant number of paper blanks (additional tables, especially if at school many classes of the second and third steps (from 30 or more).

In order to prepare a high-quality schedule that would correspond to the capabilities of a specific educational institution, it is necessary to conduct its own diagnosis of the degree of difficulty and tedivation of objects in each parallel. Experts in this case should be students, since no one can say what item is difficult and tedious.

Criteria of the hygienic assessment of the school schedule

1. Number of classes elementary school – ______.

2. The number of primary and high school classes - ___________.

3. Total classrooms used for conducting lessons - ___________.

4. The presence of an acceptability scale for its educational institution:

5. Accounting for the accommodation scale of objects in the school schedule:

6. Distribution of lessons per day for students:

7. All classes start studying from the first lesson:

8. rational alternation of objects of different focus and complexity:

9. Compliance with the accounting of student performance (in weekly dynamics):

10. Rational alignment of lessons for teachers:

11. Maximum number of lessons from teachers per day:

a) up to 4 lessons - ____ teachers - ______ (%);

b) 5 and 6 lessons - ____ teachers - _____ (%);

c) 7 lessons and more - in ____ teachers - ___ (%).

12. Methodical day is available (specify the number of teachers):

a) with load up to 24 hours a week - ____ teachers;

b) with a load of 25 to 30 hours a week - at ___ teachers;

c) with a load for more than 30 hours a week - at ___ teachers.

  1. Prepare sets with names of items from the 5th to the 11th grade.
  2. Students distribute sets of cards with names of objects and leaves for answers.
  3. Suggest select cards with the names of those subjects that are studied in this class (through a diary).
  4. Clarify the concept of "difficulty" objects.
  5. Suggest to independently determine the difficulty of each item by ranking, i.e. The folding of the cards in the order of descending the difficulty of the subject (the cards are deposited from top to bottom, i.e. in the first place from above - a card with the most difficult subject is less difficult, etc.).
  6. The resulting alignment of items to record on a sheet of answers.
  7. After that, disassemble and clarify the concept of "tiriness" of objects.
  8. Perform a similar ranking procedure and write the resulting alignment on the answer sheet.
  9. Sheets with answers to collect and process (see the form of the consolidated table below).

- Where: MK - middle score on the subject of one class;

n - the number of classes in the parallel studied;

or by the formula:

- Where: Mk - the amount of points on the subject of one class;

n - the number of students in one parallel participating in the study.

For example, in parallels of 7th grade there are five classes, 130 people participated in the diagnosis. The amount of points in the Russian language in parallels was 469. We substitute in the formula of the number:

Cf. b. PR \u003d (469/130) \u003d 3.61 - The average score in the Russian language in parallels of 7th grades was 3.61, children perceive this object as rather difficult.

In the same way, it is calculated separately average score of each subject in tedivation.

Then there is an average point of admissibility for each subject. For this, there are two indicators: the average score of the difficulty and the average score of tiriness, and then the result is divided into 2. Thus, it turns out the average points of acceptability of the subject.

Based on the obtained data, an individual table of acceptability of items of a particular educational institution for each parallel is drawn up.

Summary table form for response processing

Appendix 2.

Range study clocks during the week
Depending on the level of working capacity of students in different classes

1 - the most favorable hours; 10 - the most unfavorable.

6-7 - reduced level of performance (small clocks for conducting lessons).

8-10 - Low performance (adverse hours for conducting lessons).

Teacher's weekly load distribution table

Appendix 3.

Lesson schedule table layout technology

To perform a layout you need to cook:

  • 4 litter of cardboard (thickness 1-2 mm, height - 42 cm, width - 22 cm; The height of the rows is 0.8 cm, the column width is 1 cm) *;
  • 4 sheets of colored paper (better light tones) density 200 g / cm and sizes similar to the size of cardboard sheets;
  • wide transparent scotch;
  • locker (boomvinyl) to glue the cardboard to the folder (ribbons 4-5 cm wide; 49-50 cm long);
  • pVA glue (strong enough, type "silac").

Algorithm execution layout

1. To glue the sheets of cardboard in the "clamshell":

2. On one sheet of color paper, place all the necessary information for the preparation of the schedule (placing on a sheet of cardboard No. 1); Example: Table on with. 27.

3. On the next two sheets of colored paper, draw the grid, for three days on each sheet, 7 cells for every day (put on the 2nd and 3rd cardboard sheet).

4. On the 4th sheet to draw a solid mesh without division for days (cells - similar sizes).

5. The finished drawn sheets are covered with scotch, so that there are no breaks during cuts.

6. Make slots in cells of 0.5-0.6 cm.

7. Glit paper sheets on the side parts of the cardboard sheets on the finished "clamshell". Mock is ready.

8. Separately make multicolored tags with a class literary (5th "A", 7th "g", etc.), the amount is based on the load of 5- or 6 days of the week + additionally to lessons where classes are divided on the subgroups. Tag size: width - 8 mm; Height - 15 mm.

9. Prepare tags of any color without a literator class to calculate the weekly load for each teacher. Dimensions: width 5 mm; Height 12-14 mm.

This layout is convenient in operation, since all the necessary information is always before the eyes of the Deputy Director. It can be folded into the folder, which makes it easy to carry. At the same time, the tags will be held in slots.

Information required for the schedule

___________ * Cardboard sheet dimensions are individual, because In each school, a different number of teachers, a different mode of operation (5- and 6-day school week). We offer sizes for schedule based on a 6-day school week and school in which 50-55 teachers work.

What you read here is mostly nonsense. Nevertheless, in some places, in my opinion, there are sensible thoughts, unfortunately such seats did not happen so much and do not think to take it there, where the problems of the theory of schedules are engaged in serious. Those who want to write something better, strongly recommend to read the Hu book. T. "Integer programming and threads in networks", in addition, it is probably worth reading the lectures of the NMIC on the theory of optimization N.M. Novikova (where it is in the internet, I do not remember). Now actively engaged in the problems of the theory of optimization, so that someone is also interested in this topic, he is always happy to communicate. Write [Email Protected]

Introduction eight

1. Description of the technological region. 10

1.1. The wording of the task of drawing up the schedule. 10

1.1.1. General formulation of the task of drawing up schedules. 10

1.1.2. The wording of the task of drawing up a rapping in the application to the schedule of training sessions. eleven

1.2. Analysis of existing on .. 12

1.3. Formulation of the problem. fifteen

2. Development of a mathematical model and the practical implementation of a system of automatic scheduling. sixteen

2.1. Mathematical model of schedule in high school. sixteen

2.1.1. Designations. sixteen

2.1.2. Variables. eighteen

2.1.3. Restrictions. nineteen

2.1.4. Target feature. 21.

2.2. Methods for solving the task. 22.

2.2.1. Fully integer algorithm. 23.

2.2.2 A direct algorithm for integer programming. 28.

2.2.3. Technique of obtaining an initial allowable basis. 32.

2.3. Features practical implementation Systems .. 36.

2.3.1. Select model. 36.

2.3.2. Description of input information. 39.

2.3.3. Development of information support. 41.

2.3.4. Features of the formation of restrictions of the mathematical model of the task of drawing up the schedule. 44.

2.4. Program Results .. 45

2.5. Analysis of the results obtained. 49.

Conclusions .. 50.

Literature. 51.

Appendix 1. The capabilities of software products of scheduling systems. 52.

Appendix 2. Listing the program module for solving the task of automatic design of the schedule. 61.

Introduction

The quality of training specialists in universities and especially the efficiency of using scientific and pedagogical potential depends on a certain extent on the level of the organization of the educational process.

One of the main components of this process is the schedule of classes - regulates labor rhythm, affects the creative return of teachers, so it can be viewed as a factor in optimizing the use of limited labor resources - a teaching staff. The technology of the development of the schedule should be taken not only as a labor-intensive technical process, an object of mechanization and automation using a computer, but also as an action of optimal control. Thus, this is the problem of developing optimal training schedules in universities with an obvious economic effect. Since the interests of the participants in the educational process are diverse, the task of drawing up the schedule is multicriterial.

The task of drawing up the schedule should not be considered only as a certain program that implements the function of mechanical distribution of classes at the beginning of the semester, on which its (programs) use and ends. The economic effect of more efficient use of labor resources can be achieved only as a result of painstaking work on the management of these labor resources. The schedule here is only a tool for such management, and for the most complete use it is necessary that the program combines not only the means to compile the optimal schedule, but also tools to maintain its optimality in the event of a change in some input data, which at the time of the schedule is considered permanent . In addition, optimal management of such a complex system is impossible without accumulating some statistical information on the processes occurring in the system. Therefore, the task of drawing up the optimal schedule is only part of a complex learning process management system.

Multi-criteria of this task and the complexity of the object for which mathematical model, determines the need for a serious mathematical research of the object to increase the functionality of the schedule compiling algorithms without significant complication of the model and, as a result, increasing the amount of memory used and the time to solve the problem.


1. Description of the technological region 1.1. Formulation of the task of drawing up

The task of the theory of schedules in the general formulation is considered very attractive, although the achievement of even small progress towards the solution is due, as a rule, with enormous difficulties. Despite the fact that many very qualified specialists were engaged in the tasks of theory of schedules, so far no one has managed to get any significant results. Unsuccessful attempts to obtain such results, as a rule, are not published and this partly determines the fact that the task continues to attract the attention of many researchers seeking simplicity of production.

1.1.1. General formulation of the task compilation problem

In the most general formulation, the task of drawing up the schedule is as follows. With a certain set of resources or service devices, some fixed task system must be performed. The goal is to ensure that the properties of the tasks and resources and the restrictions imposed on them find an effective algorithm for organizing tasks that optimize or strive to optimize the desired measure of efficiency. As the main efficiency measures, the Schedule Length is studied and the average residence time of tasks in the system. Models of these tasks are deterministic in terms of the fact that all information on the basis of which decisions are made about ordering are known in advance.

1.1.2. The wording of the task of drawing up a rapping in the application to the schedule of training sessions.

The overall theory of schedules assumes that all serving devices (or processors) cannot be performed in this moment The time of more than one task is that for the schedule of training sessions is not sufficient if as a processor when distributing tasks to accept an educational audience. So in some cases in one audience there may be lessons with more than one group at the same time, for example, general lectures for multiple threads.

Therefore, when transferring the general theory of schedules to schedule training sessions, the following assumptions were made:

All processors (i.e., in the event of a training schedule - the audience) have a capacity - a number C ≥ 1. The capacity of the processor defines the number of tasks that it can simultaneously "process" at the moment (in relation to the inadequacy of processors it would be interesting to consider the option when the audience is not as a processor, but a teacher, but as a task - a stream from one or more educational groups with which it works);

As a set of tasks for the distribution, training activities of the teacher with training groups are acting;

The time model in the system is discrete; All distribution is assumed to be periodically repeated throughout a time interval;

All tasks are performed for the same time, which is adopted per unit of sampling of the time interval;

The tasks have belonging to objects, which are accepted by training groups and teachers.

As a result, the wording of the task of drawing up the schedule of training sessions sounds as follows: "For a given set of educational auditors (in this case, under the educational audience, a wide range of rooms are held, in which training sessions are held (from computer audience to the sports hall)) and a given set of time intervals (i.e., in essence, lessons or training pairs), build such a distribution of training sessions for all objects (teachers and training groups), for which the chosen optimality criterion is the best. "

1.2. Analysis of the existing PA

At the moment, the sector of the market for the design of the schedule of classes is represented by a large number of different software products. In Table 1. Only some of those known to me are presented.

Due to objective reasons, the system of drawing up a collateral in the university (meaning a large state university) must implement a number of basic functions:

Accounting for teachers' wishes;

Consolidation of mandatory audiences;

Indication of desirable audiences;

Accounting of the transition between the corps;

Combining groups in flows on any totality of disciplines;

Division into subgroups;

After drawing up the schedule, if necessary, replace teachers or change the time of classes.

In addition, there are also specific requirements for the functional capabilities of the software product for each university.

Opportunities in my opinion the most popular on the Russian software products are given in Appendix 1.

From the list of the list, perhaps only the Methodist program more or less complies with the required functionality of the schedule of schedule preparation in the university. This state of affairs is easily explained by the fact that school education today is more "standardized" (in the sense of the organization of the educational process) than the university. Such standardization leads to a large amount of potential market for software sales and payback to the development by selling a large number of copies of the product at a relatively low price.

In the case of universities, the demand for scheduling systems is perhaps even more than for schools, but the case is complicated by the great specifics of the organization of the educational process in each individual university. Create unified software is not possible, and the cost of creating a specialized product in third-party developers is unreasonably large. In addition, the prerequisite is the presence of a "established" schedule, which implies the ability to replace teachers or time of classes. So far, no software product allows enough to do this (although some possibilities are in the "Methodist").

1.3. Formulation of the problem.

The purpose of this work was to create a mathematical model of the schedule at a university, which would allow efficiently (on a given time and with a given degree of optimality) to solve the task of automatic scheduling and would have flexibility (minor changes in the case of changes in input information) to adapt the system within a specific Practical task. For some simplification of the task at the initial design of the design, some assumptions were made:

The schedule is made up at the rate of no more than two pairs per day (which is quite suitable for the case of an evening learning form);

All pairs are held in one case;

The task is placed in terms of linear programming;

Further decomposition of the model is not produced;

All model coefficients and the desired variables are integrated;

The task must be solved by one of the universal (independent of the integer values \u200b\u200bof the coefficients) methods of integer linear programming.


2. Development of a mathematical model and the practical implementation of the automatic schedule compilation system 2.1. Mathematical model of schedule in high school

We construct a mathematical model of schedule at the university in terms of linear programming. We introduce the notation and define variables and restrictions.

2.1.1. Designations

The university has N training groups combined into R flows; R is the flow number, r \u003d 1, ..., r, k r - the number of the study group in the stream R, k r \u003d 1, ..., g r.

The splitting of groups on flows is carried out on the basis of the principles:

1. The use of two groups of the same audited fund for their lectures automatically assumes the premises of them in 1 stream (it is assumed that all lectures of training groups are held together).

2. A group (or part of it), as a unit of the educational process in a university, can enter different streams, but only one time each of them.

3. The number of threads is not limited.

Classes are held on working days in half-sighted intervals, which will be called pairs.

Denote:

t - number of the week of the week, t є t kr, where

T Kr - many numbers of working days for group K R;

j - pair number, j \u003d 1, ..., j;

J - Total number of pairs.

With each study group K R flow R for a week, according to the curriculum, W KR classes are carried out, of which S r lectures and Q KR practical. Denote:

s R is the number of discipline in the list of lecture classes for the stream R, S R \u003d 1, ..., S R;

q kr - the discipline number in the list of practical training for the group K R, q kr \u003d 1, ..., q kr.

It is assumed that lectures are carried out in all stream groups at the same time in one audience. Then, if for some discipline, more than one occupation is carried out during the week, this discipline is mentioned in the list of lectures or practical classes as many times as provided by the curriculum for each flow or group.

Teachers

Let P be the number (name) of the teacher, p \u003d 1, ..., P. We introduce the Values \u200b\u200bto consideration and:

The learning load of teachers is planned before drawing up the schedule of classes, as a result of which at this stage of the quantity and can be considered specified. For each teacher p, p \u003d 1, ..., p, its audit load is also task - N p hours per week.

Auditing Fund

Each flow occupies can only be carried out in certain audiences (for example, practical information on computer science can be carried out only in display grades). Let be:

(A 1 R) - Many audiences for lectures on the stream R;

(A 2 R) - Many audiences for practical training on the stream R;

A 1 R is the number of elements of the set (A 1 R);

A 2 R is the number of elements of the set (A 2 R);

A 1 R + A 2 R is the number of arising audiences of sets (A 1 R) ∩ (A 2 R).

The audit fund is determined prior to the start of the schedule, so the set can be considered specified.

2.1.2. Variables

The task of making a schedule is to determine for each lecture (on the stream) and practical classes (in the group) of the day of the week and the pair on this day, taking into account the implementation of the limitations constructed below and minimize some target function.

We introduce the following desired boolean variables:

=

In the event of a schedule for a group of evening learning form J \u003d 2. Generalization of the model for all forms of learning, see, p. 669.

2.1.3. Restrictions

For each group K R, all types of audited work must be performed during the week:

Each lecture S r and the practical occupation of Q kr, respectively, for all streams R and all groups K R, can be carried out no more than once on any day T:

If variables linges all types of classes with the time of their holding, then and bind time with the name of the teacher.

In every day T and in each pair J, the P can lead no more than one occupation on one discipline on one stream or in one group:

Finally, on each day, at each pair, the number of lectures and practical sessions should not exceed the audited fund available in the university:

In addition, for all sets of intersecting sets (A 1 R) and (A 2 R) conditions must be met:

The represented relations are exhausted by unconditional restrictions with which they are always considered when the schedule is prepared. May, however be specific conditions, first of all, conducting certain types of work on the "top" or on the "lower" week (ie one academic hour per week). Other special conditions are not excluded, but they have not been considered to simplify the model.

2.1.4. Target feature

To fully maintain scientific, educational work, prepare for classes, the university teacher must have free time. This condition is insufficient, but necessary. Obviously, with free time, he should not have a "torn" mode, for example, are the "windows" between classes with students, but if possible, in completely free working days. This is equivalent to maximizing the audit load of teachers in those days when they have it (see (5)). However, at the same time, the claims for free time in teachers are unequal, since they have different creative potential. Therefore, it is necessary to introduce weighting coefficients through which the corresponding status of the teacher must be taken into account - its scientific degrees and title, the position, occupied position, scientific and social activity, etc. In some cases, on the basis of expert assessments, it is possible to use individual weighting coefficients that take into account other factors.

So, choose the quality criterion for the preparation of the schedule of classes in the form of maximizing the weighted number of days free from the audit work for all teachers, which, subject to the fixed length of the working week, is equivalent to the maximum total compaction of the audit burden.

Consider the expression for the size of the audit load per day T of the teacher P:


where M is an arbitrary positive large number; - The desired Boulev variable.

From (10) implies that if, then \u003d 1, and if, then \u003d 0.

Taking into account the above-mentioned sense, the optimization criterion in additional restrictions (10), as well as inputting the weight coefficients of the teacher, we obtain the desired optimality criterion:


The introduced target function is not the only possible. The introduction of other target functions does not change the limitations of the mathematical model and methods for solving the problem, but can significantly affect the results of calculations.

2.2. Methods for solving the task

The task of maximizing the linear target function at a given system of restrictions is the task of linear integer programming boolean, since all restriction coefficients are intended due to the discreteness of the source data of the problem; In addition, the desired variables of the mathematical model can take only two values. At the moment there are several possible solutions to this kind of task.

The methods of ordered indexation and modified marks based on the Lagrangian decomposition of the original model are described on a number of single-line tasks solved according to the methods of ordering indexing or modified marks. Unfortunately, the number of operations of each method does not allow a polynomial assessment; In addition, the dimension of the table of sets (intermediate values) of the methods increases sharply with increasing the dimension of the problem being solved, which is unacceptable in our case. It is possible that the change in the decomposition algorithm for a specific mathematical model will reduce the dimension of the tables, but so far there is no such algorithm.

In this regard, as a solution methods, described in the modification of the simplex method for the case of the task of integer linear programming were selected. In the general case, the number of operations of the simplex method does not allow a polynomial estimate (the task class was even shown for which the number of operations is O (EN)), but for the case of our task, the average number of operations allows polynomial estimate: O (N 3 M 1 / ( n-1)) (n - the number of variables; m is the number of restrictions).

2.2.1. Fully integer algorithm

This algorithm is found completely integer, because if the source table consists of integer elements, then all the tables that are obtained during the operation of the algorithm contain only integer elements. Like a dual simplex method, the algorithm begins to work with a double-valued table. If a i 0 (i \u003d 1, ..., n + m; a i 0 is the target function coefficients) - non-negative integers, then the task is solved. If for some row A i 0

Let the task of integer linear programming are specified:

maximize

under conditions

Conditions (12) can be recorded as


Suppose that for t \u003d 0 (i.e., for the original table), all A ij are integers and columns (J \u003d 1, ..., N) - lexicographically positive. Then all columns over the calculations remain lexicographically positive.

Before setting out the method of obtaining an additional restriction from the producing string, we introduce a new representation of numbers. Let [x] denotes the greatest integer that does not exceed x. For any number y (positive or negative) and positive can be written:

where (R y is a nonnegative balance of fastened yo). In particular, . Therefore, if, then r \u003d 1. If, then R \u003d 0.

Annexed additional inequality should be carried out at any whole solution of the problem (12). Consider some equation in T - table (lowering line index) with a 0


where X is the corresponding component of the vector, and the current non-binding variables. You can express x, a 0 and a j using the representation introduced above (14):

Substiving expressions (16) and (17) in (15) and rearring the members, we obtain:

Since, and on the variables X and the requirement of non-negativity, the left part of the equation (18) is always nonnegative. Consider the expression on the right side concluded in curly brackets. The coefficients in this expression are integers, and the variables are subject to the requirement of integer. Therefore, all expressions in brackets must be integer. Denote it through S, i.e.:

.

An integer weak variable S is non-negative. Indeed, if S was negative, i.e. It would take values \u200b\u200b-1, -2, ..., then the multiplication of the ones would make the whole right of the equation (18) negative, while the left side is nonnegative.

Consider two cases and. For and . Substituting an expression for X from (15) to equation (19), we obtain:

Equation (21) must be performed for any integer solution of the problem (12). Note that if a 0 in equation (21). Therefore, equation (21) can be used as a master string in the simplex method. In particular, you can always choose quite large, so that the leading element in the line (21) is equal to -1, which will preserve the integer table. The choice of the appropriate will affect the rate of convergence of the algorithm. First of all, we describe the algorithm itself. As an initial, it is necessary to take a double permissible solution, which can be obtained by adding the limit of Xn + M + 1 \u003d M - x 1 - - ... - xn 0, where M is a sufficiently large constant, and carrying out one iteration with the added line and with a lexicographically minimal column taken as leading. The algorithm consists of the following steps:

Step 0. Start with a double permissible matrix a 0 in equation (13), the elements of which are integers (the matrix A 0 may contain the neuroble items, for this, see, p. 306).

Step 1. Among the rows with a i 0 0 (i \u003d 1, ..., n + m), then the task is solved.)

Step 2. Select (the election rule will be described further) and write an additional line at the bottom of the table

This line is selected as a lead.

Step 3. To hold a step of a dual simplex method, delete an additional line and return to step 1.

Proof of the limb of the algorithm See, p. 303-304.

The election rule is formulated as follows.

Step 0. Let a row with the V number be producing.

Step 1. Let - lexicographically minimal column among columns with a VJ

Step 2. For each A VJ - the greatest integer, such that (lexicographically less).

Step 3. Let, and (line V - producing). Then

.

Step 4. Put for a VJ

The element of the selection described above allows you to make a leading element equal to -1, while the dual permissibility of the table is preserved and at the same time zero column will be as much as possible to decrease.

2.2.2 Direct algorithm for integer programming

The term "straight" applied to an integer programming algorithm denotes a method that leads to an optimal solution by receiving successively "improved" solutions. Each of these solutions is permissible in the sense that it satisfies both linear restrictions and the condition of integerness. One of the probable advantages of the algorithm is the ability to interrupt calculations, before the optimal solution is obtained, and use the best of the solutions obtained as approximate. In addition, you can use a direct algorithm in a compound with dual algorithms to obtain various composite algorithms that can proceed from the phase that gives the dualifiable solutions to the phase that gives directly permissible solutions.

The natural precedent for the direct algorithm is completely integer algorithm, since in the process of this algorithm, a sequence of double permissible integer solutions is obtained. It should be reminded that the fully integer algorithm of Homori is a modification of the dual simplex method. The main difference of this algorithm is that as a master line is used to cut the homorie with a leading element equal to -1. This clip is obtained from the producing string, which is defined as one of the possible leading rows in the dual simplex method. The use of such cut-off as a leading line will save after iteration the dual permissibility and integer table.

It turns out that it is possible to modify the simplex-method to be modified in such a way as to obtain an algorithm that retains the direct validity and intelligence of the tables. To describe the computational procedure, consider the following task of integer programming:

maximize

Suppose that the column is selected as the master and string V - the master line in the iteration of the simplex method, i.e. For all rows I, in which A IS\u003e 0. Before carrying out a Gauss elimination procedure in a simplex method, add the handle to the table, obtained from the row V:

where J is a plurality of indexes of non-abase variables in (22), S k - a new (basic) weak variable and - an indefinite (temporary) positive constant.

Note that if you put \u003d a vs, the clipping (23) will have two important properties. Firstly,

This means that the direct validity of the table will be saved if you use the clip (23) as a leading line. Secondly, i.e. The drive element is 1 (if the clip is used as a leading line). It is easy to verify (by studying the formulas for changing the basic variables), that the conversion of the simplex table with a single drive element saves the integer elements of the simplex table.

These ideas served as the basis of the direct algorithm in integer programming:

Step 0. Start from the column table, in which A i 0 0 (i 1) and all elements A 0 j, a ij and a i 0 are integers.

Step 1. Check the execution of conditions A 0 J 0 (J 1); If they are completed, the end, the current basis solution is optimal; If not - go to step 2.

Step 2. Select the presenter column S with a 0 S 0. This string is used to cut off Homori.

Step 3. Get a piece of homorie from the producing string and add it at the bottom of the table, i.e. Add to the limitations of the problem Equation (23), where.

Step 4. Conduct the conversion of the table using the clip (23) as a master string. The weak variable S k in (23) will become non-disconnect. Back to step 1.

Proof of the limb of the algorithm see, p. 346-353.

Since the choice of the producing string is a task of nontrivial, apparently, there must be several lines that can serve as producing. In preliminary arguments, the preview line of the simplex method was used as a producing line. This line always gives a clip, which is a leading string with a leading element equal to one. Apparently, there are other lines in the table from which cut-off with the same properties can be obtained. Suppose that the cut is obtained by the formula:

where is determined from the condition

We define the set V (S) as a set of rows satisfying condition (25).

The following two rules are examples of permissible rules for choosing a producing string:

Rule 1.

1. Make a serial finite list of string indexes so that the index of each row entered it at least once. Go to 2.

2. If the list is empty or does not contain a single index from V (s), return to 1; Otherwise, find the first index V V (S) in the list. Select a string V as producing. Display index V and all prior indexes. Go to 3.

3. Sequentially select a string V, taken in 2., as producing, as long as v V (S). As soon as V V (s), return to 2.

Rule 2.

1. Let V T (S) be the set V (S) corresponding to the T-th table. If V t (s) contains more than one element: V T (S) \u003d (V 1, V 2, ..., VK +2), then as a producing to choose such a string that in the sets of sets V 1 (S 1), V 2 (S 2), ..., V T (S) The string appeared earlier (no later) of the rest and then persisted up to V t (s); Go to 2.

2. Sequentially select a string V, taken in 1., as long as. Once, back to 1.

2.2.3. Technique to obtain an initial allowable basis

The solution to each of the above methods can be made only if the linear programming task is either directly or a double permissible. Such admissibility means the presence of an initial allowable base in the original task. If the task is permissible and directly, and double, then the solution obtained is optimal. In most cases, after the task is set, it turns out that it is not allowed neither directly or dual. Therefore, we give an algorithm for obtaining an initial allowable basis.

Let the problem of linear programming are recorded in canonical form:

minimize

under conditions

All B i can be done non-negative, multiplying, if necessary, the corresponding equation on -1. Then it can be added to each equation an artificial variable (artificial variables should be non-negative) so that the initial variables to form an initial basis:

Artificial variables can be obtained from weak variables used to convert inequalities in the equation. Indeed, if the initial limitations of the linear programming problem are given in the form of inequalities:

that, adding a weak variable to each inequality, we get:

If B i 0, then s i can be used as initial basic variables.

The difference between artificial variables and weak variables S I is as follows. In the optimal solution of the problem, all artificial variables should be zero, since there are no such variables in the original task. On the other hand, it is quite possible that in the optimal solution, weak variables will have positive values. In order for artificial variables to be equal to zero, you can present the target function as follows:

where M i is quite large positive numbers. The idea of \u200b\u200bthe method corresponds to the fact that artificial variables are attached to knowingly large prices. This method leads to zero values \u200b\u200bof artificial variables in an optimal solution.

There is another way to get an initial allowable base. In this method, as in the first, artificial variables are used as initial base variables. A new target function is considered, which is an amount of artificial variables. It is required to minimize using Z - equation as one of the limitations. If the initial system of equations has a permissible solution, then all artificial variables should become zero. Consequently, the minimum value should become zero. If, the initial system of equations does not have permissible solutions. If, then you can lower the target function and use the optimal basis-form as an initial allowable basis to minimize Z. In the literature, such a method is called a two-phase simplex method. At the first phase of the method there is a permissible basis by minimizing, on the second - the Z is minimized and the optimal basis is obtained.

Consider as an example the following linear programming task:

minimize

under conditions

where all B I are non-negative.

If you enter artificial variables and a new target function, we will get the task:

minimize

,

under conditions

If you deny all the equations containing B I, from -form, we get:

-Z.

where the system (26) is diagonal relatively The first phase of the Simplex method is minimized under conditions (26). On the Z sign, restrictions are not superimposed. In the process of computing, as soon as the artificial variable becomes an unbasic and its coefficient to -form is positive, the variable itself and the corresponding vector-column column from further computations are excluded.

2.3. Features of the practical implementation of the system

In practice, it is not very convenient to work with information in the form in which it is defined in the mathematical model. Therefore, first of all, we define with the method of organizing data or the data model.

2.3.1. Select model

The data model is a set of agreements on the methods and means of a formalized description of objects and their connections related to the automation of system processes. The type of model and the types of data structures used in it reflect the concept of the organization and processing of data used in the DBMS supporting the model, or in the programming language language, which creates an application processing program.

As part of the solution of the task, it is necessary to create such a data model, in which the amount of supporting information would be minimal, there was a fundamental possibility of multiplayer access to data and would be provided high level data protection.

Currently, there are three main approaches to the formation of a data model: hierarchical, network and relational.

Hierarchical organization organization

The hierarchical database consists of an ordered set of trees; More precisely, from an ordered set of several instances of one type of wood. The type of wood consists of one "root" type of recording and an ordered set from zero or more types of support (each of which is some type of wood). The type of wood as a whole is a hierarchically organized set of recording types.

Automatically maintains the integrity of references between the ancestors and descendants. The main rule: no descendant can exist without your parent. Note that similar to maintaining integrity on the links between the records not included in one hierarchy is not supported.

Network method of organization

The network approach to the organization of data is an expansion of hierarchical. In hierarchical structures, the descendant record must have exactly one ancestor; In the network structure of data, a descendant can have any number of ancestors.

The network database consists of a set of records and a set of connections between these records, and if we say more accurately, from the set of instances of each type from the database set of recording types and set of instances of each type from a given set of communication types.

The type of communication is determined for two types of recording: ancestor and descendant. An instance of the type of communication consists of one instance of the type of ancestor recording and an ordered set of instances of the type recording type. For this type of communication L, the following two conditions must be performed as the following two conditions:

1. Each instance of type P is the ancestor only in one instance L;

2. Each instance C is a descendant not more than in one instance L.

Relational method of organization

The main disadvantages of the hierarchish and network types of data models are:

1. Too difficult to use;

2. In fact, knowledge of the physical organization is needed;

3. Applied systems depend on this organization;

4. Their logic is overloaded with the details of the access to the database.

The most common interpretation of the relational data model, apparently belongs to Date, which reproduces it (with various clarifications) in almost all its books. According to Date, the relational model consists of three parts describing different aspects of the relational approach: the structural part, the manipulation part and the holistic part.

In the structural part of the model, it is fixed that the only structure of the data used in the relational database is normalized N-arous attitude.

In the manipulation of the model, two fundamental mechanisms for manipulating relationulating database are approved - relational algebra and relational calculus. The first mechanism is based mainly on the classical theory of sets (with some clarifications), and the second is on the classical logical apparatus of the calculation of first-order predicates. The main function of the manipulation part of the relational model is to ensure the relationship of any particular language of relational databases: the language is called the relational, if it has no less expressive and power than relational algebra or relational calculus.

Finally, in the integral part of the relational data model, two basic integrity requirements are recorded that must be maintained in any relational DBMS. The first requirement is called the requirement of integrity integrity. The second requirement is called the requirement of integrity on the links.

After the preliminary analysis of the mathematical model of the system and methods of data organization, as well as the organization available on the software market (hierarchical and network methods of the organization, assume an object - ordered approach to the organization of data and today there are such DBMS (for example, Jasmin or Informix Dynamic Server), but on The moment of development of the possibility of their use was not, at the same time there are very "powerful" relational DBMS (for example Oracle 8i)) the choice was made in favor of the relational method of organizing storage of data.

2.3.2. Description of input information

All information necessary for solving the task is set until the iterations of the methods for solving the task of the schedule. To simplify, it is believed that the specified information is constant throughout the period for which the schedule is drawn up.

Without losing a certain degree of common task, it is possible to determine a certain set of input data required for the formation of restrictions and solving the problem, and at the same time common for all varieties of practical implementation of the system. Due to the specifics of the task (the possibility of relatively easy adaptation of the mathematical model for the case of practical implementation within a specific university), the forms of documents of the input information were not developed. Input details are described in Table 2.

Table 2. Description of input details

Name of requisites Characteristic requisites

input documents

A type Max. length Accuracy

Surname, first name, patronymic of the teacher;

Contact phone teacher;

Academic degree;

Scholarship;

Group name;

Numerical composition of the group;

The name of the readable course;

Number of audit hours;

Audience numbers;

Information about the audience;

The name of the subject read by the teacher;

The number of the group where the subject is read;

Information about the audiences where the subject is read.

In addition to these data, for a mathematical model, some other additional data are needed, which can be obtained after analyzing the input information programmatically.

2.3.3. Development of information support

We will analyze the source information in order to determine the composition and structure of information for the subsequent formalization and construction of the information and logical data model (ILM). The above mathematical model, as well as additional information from the description of the subject area, make it possible to determine the role of details in interrelated information contained in the document. On the basis of such an analysis, we will establish the functional dependences of the details in accordance with the recommendations and requirements of data normalization, after which they will carry out the normalization itself. The goal of normalization is to reduce (but not necessarily eliminate) data redundancy. However, sometimes some data redundancy is intended to increase the efficiency of the program. Let us give the definition of three forms of database normalization.

The table is in the first normal form (1NF) if it has a primary key, all attributes are simple data types and there are no repetitive attributes. To match 1NF, attribute domains must be atomic values \u200b\u200band should not be repeated attribute groups. All recurring attribute groups must be transferred to a new table.

The table is in the second normal form (2NF) when it is in the first normal form and each neutile attribute fully depends on the primary key (i.e., in 2NF, each nexian attribute must fully depend on the primary key fields).

The table is in the third normal form (3NF), if it is in 2NF and does not contain transitive dependencies. Transitive dependencies are the functional relationship between non-selective attributes. Any non-selective attribute that functionally depends on another non-selective attribute of the same table creates a transitive dependence and must be moved to another table.

The resulting functional dependencies are quite trivial and obviously flow from the mathematical model, so in the future describing they are not given. Also in further presentation, intermediate degrees of normalization are lowered. Therefore, we present only the final infological model of the database (see Fig. 1.).


Fig.1. Infological Model Database Task Configuration Task




2.3.4. Features of the formation of limitations of the mathematical model of the task of drawing up schedule

Drawing up restrictions (1) - (7) of the mathematical model of the schedule drawing problem is a sufficient trivial task solved using simple SQL requests and not requiring pre-analysis of input information. Therefore, we will only focus on the limitations of the form (8).

Note that in the mathematical model of the system, the readable object is "tied" not to a specific audience of the conduct, but to some multiple audiences. The alignment of specific audience numbers is performed after solving the task. The limitations of the form (8) make sense only when the sets of audiences intersect. In the mathematical model of the system, it is proposed to take into account all unique intersecting pairs in the form of restrictions. The number of these intersections may be large, which can lead to a large number of additional restrictions that negatively affect the speed of optimization algorithms. However, it is possible to significantly reduce the number of additional restrictions.

Consider the case of a linear arrangement of intersecting sets (see Fig. 2.).

Fig.2. Linear intersecting sets

In case of such a set of audiences for conducting classes total number The limitations of the form (8) will be N-1, where n is the number of sets. The above-described arrangement of intersecting sets can be called linear, since at the same time n intersecting sets are located in the line. You can consider the case when the sets crosses each other in an arbitrary manner (see Fig. 3.).

Fig.3. Arbitrarily intersecting sets

The number of limitations of the form (8) in this case can be reduced by carrying out the formation of these restrictions by analogy with the case of a linear arrangement of sets. To do this, it is necessary to assume that, for example, the sets B and D intersecting with A are one set, determine the area of \u200b\u200bintersection of such a set with a set A, after which they carry out the same actions with the resulting intersection area.

Read more about this, p. 210.

2.4. The results of the program

With the practical implementation of the system, special attention was paid to the task of writing the "core" system - methods for solving the problem and procedures for the formation of restrictions. Since the tasks were not set to write a full-featured commercial product, the interface part was written for the purpose of testing the nucleus and determining the limits of the applicability of algorithms, therefore includes the minimum of functionality and does not contain the input predefining modules.

The core of the system and the interface part were written on Delphi 6.0. Methods for solving and algorithms for the formation of restrictions are written using object-oriented technologies, which will allow them to easily encapsulate them into further modifications of the system without violating the integrity of the interaction of various algorithms. The text of the objects of the problem solving methods is given in Appendix 2. The database was implemented on the Oracle 8i DBMS, the requests to it are carried out in PL / SQL.

The source data of the tasks are recorded in the database tables using requesting forms. One of these forms is shown in Fig. 3.

Fig.3. Form of initial data

The data obtained as a result of solving the problem is not enough to output the schedule of classes immediately after solving the problem, therefore the data post-processing module was written. The final timetable of classes is displayed as a table, an example of which see. four.

Fig. 4. Example schedule of classes

The problem solving algorithms were tested on various samples of the source data. Testing was performed on a computer with an Intel Pentium 350 MHz processor, the Oracle 8I DBMS was installed on a two-processor server: 2 CPU Intel Pentium II 350 MHz, RAM 384 MB; A link capacity of up to 100 Mbps was used as a communication channel. As test source data, as real data on groups, teachers and readable subjects of the evening learning of the CHSU for 1999/2000 academic yearsand randomly formed source data (readable subjects randomly determined the audience for conducting classes). On average, it was produced from 5 to 10 tests for each test size of the source data. As a result, the data shown in Table 2. In Figure 5. A graph of the mean time of solving the problem from the number of readable items and the number of groups is given.

2.5. Analysis of the results obtained

Analyzing the obtained data can be made some conclusions about the functionality of the solution algorithms and the mathematical model, their shortcomings and applications.

First, the used mathematical model contains "extra" limitations, the existence of which is due to a linear integer model, besides this, each readable on the stream (the stream may consist of one group) is placed in accordance with 12 (for the case of events) of variables, each Of which is a Boolean variable. Secondly, the time to solve the problem increases sharply with increasing input data. This is due to a sharp increase in the number of variables and restrictions in the model, as a result of which the dimension of arrays increases and, accordingly, the time to solve the problem. Thirdly, formalized mathematically task covers only the task of drawing up the schedule for students of the evening training without taking into account the transitions between the corps. Accounting additional requirements It will increase the number of limitations of the problem, which will negatively affect the speed of the solution algorithms.

We draw attention to the increasing difference between the minimum and average value of the problem of solving the problem as the dimension of the problem increases. This difference corresponds to how "successful" (the most closely optimal) found the initial allowable basic solution of the problem. Therefore, the time to solve the problem can be significantly reduced, "well" finding an initial basis permissible solution. To search for such a solution, it is best to use heuristic and decomposition algorithms.


The conclusions during the work was built the mathematical model of the schedule in the university for the case of an evening form of training without transitions between the enclosures, methods for solving the task of the task were selected and a model for storing the source data of the task was developed. The source data storage model, the model of mathematical formalization model and the solution methods were implemented as software modules. The speed of operation of the algorithms was tested on the heterogeneous sets of source data, as a result of which the possibilities and areas of application of algorithms were determined.

Based on test results, it was found that by the speed of operation, the problem solving algorithms are highly dependent on the volume of input information and the initial permissible basis solution, and therefore significantly inferior to heuristic and decample. But in the case of the heuristic solution of it (solutions), the optimality (or achieving a global maximum) can be proven only with complete search for all possible options (it is clear that in this case the opening time of the algorithm will be very large), therefore iterations of heuristic algorithms are terminated upon reaching some maximum ( Cannot say, local or global) value. The solution of such an algorithm may be close to the optimal, but not optimal. In this case, to achieve a global maximum, it is possible to use a solution method considered in the work, since the optimum can be achieved in several iterations of the described solution methods.


LITERATURE

1. Lagosa B.A., Petropavlovskaya A.V. A complex of models and methods for optimizing the schedule of classes in the university // Economics and mat. Methods. 1993. T. 29. Vol. four.

2. Hu T. Integer programming and threads in networks. M.: Mir, 1979.

3. Lebedev S.S. Modification of the Benders method partially integer linear programming // Economy and mat. Methods. 1994. T. 30. Vol. 2.

4. Lebedev S.S., Zaslavsky A.A. Using a special method of branches and borders to solve an integer generalized transport problem // Economics and mat. Methods. 1995. T. 31. Vol. 2.

5. Zaslavsky A.A. Using the strategy of strategies of variables in common tasks integer linear programming // Economy and mat. Methods. 1997. T. 33. Issue 2.

6. Lebedev S.S. On the method of ordering indexing integer linear programming // Economy and mat. Methods. 1997. T. 33. Issue 2.

7. Lebedev S.S., Zaslavsky A.A. Modified Method Method for Programming Boolean Tasks // Economy and Mat. Methods. 1998. T. 34. Vol. four.

8. Zaslavsky A.A. Combined method for solving problems of backpack // Economy and mat. Methods. 1999. T. 35. Vol. one.

Appendix 1. The capabilities of software products of scheduling systems.

FROMstatus Author-2 + is intended for quick and convenient preparation of schedules of classes and accompany them during the entire school year.
BUTSecond-2 + - universal system. There are several versions of the program designed for any educational institutions:

Execution and specialized (mathematical, linguistic, etc.) of schools, lyceums, gymnasium;

Technical schools, colleges and colleges;

Universities with one educational building;

Universities with several educational buildings (taking into account moving between housings).

BUTThe second-2 + allows you to make it possible to make it possible to make it possible to make it possible to make it possible to make it possible to easily easily automate the challenges of the schedule. The system helps to easily stop, kopect and press in the form of convenient and visual documents:

Pascript class classes (training groups);

Schedules of the PRPHES;

Schedule of the audience (Cabinets);

Educational plans;

Tariff.

BUTThe second-2 + has a pigeon design and dpus. The program is quite easy to learn. There is a detailed manual, which describes all the possibilities and ways to work with the program.
Program works on any IBM-compatible computers, starting with 486DX with 4MB RAM (and higher), takes about 1 MB on the hard disk. Operating system: MS DOS, or Windows 95/98.
INworkfire depends on the size of the educational institution and the power of the computer. Full calculation and optimization of the mid-size school schedule (30 classes, 60 teachers, two shifts) goes about 15 minutes on a Celeron-400 computer.

Pthe rogram is characterized by a unique and very powerful algorithm for building and optimizing the schedule. The resulting automatic schedule practically does not require manual refinement, that is, even with very complex and hard restrictions, all possible classes are automatically placed. If there are insoluble contradictions in the source data, they can be detected and eliminated using a special analysis unit.

BUTThe second-2 + allows:

Optimize the "windows" in the schedule;

Take into account the required range of days / hours for both classes and teachers;

Optimally to make the classroom classes (audiences), taking into account the characteristics of classes, items, plexibilities and the capacity of the cabinets;

Take into account the happotes and wishes of both full-time specialists and part-time members;

Easy to connect ("sprink") several classes (training groups) in the flows of contacts of any classes;

Page classes PRESCERES OF FRIEND LANGUAGE, PHYSICAL CULTURE, TPU, informatics (and any other subjects) for any number of subgroups (up to ten!);

Enter (besides the main priests) special pumps and electives;

Optimize uniformity and laboriousness of the schedule.

2. System "Schedule" Ver 4.0 Moscow - Lintech

It is necessary to immediately note that the program "Schedule" is focused on the compilation of the school schedule, the use of university and colleges is possible only with some reservations. The scheduling is made within the framework of the conditions of the conditions that are determined on the initial data entry steps. The full list of possible conditions is given below:

- ABOUTthe maximum lesson number is bound - i.e. The number of lessons, maximum permissible per day;

- Ravomerity distribution of the load of teachers between schedule days;

- Ravtomerity of the load of the class of classes between the schedule days;

- TOonrop windows in the schedule of teachers;

- Pthe rogram takes into account the fact that classes can arbitrarily unite and crushes (classes can be combined into streams or crushing into smaller subgroups, and these subgroups, in turn, can serve as a basis for combining into larger groups. Example: at school №1859 There are 2 senior class, but in each of these classes there are two subgroups on specialization, classes on general education subjects are carried out immediately for the whole class, and items on specialization are separately. But since the subgroups on specialization are too small, and teachers are missing, according to some subjects. Subgroups 11A and 11B can also be combined (for example, on inmose.) - It complicates ensuring the continuity of the schedule for classes (it is necessary to ensure the continuity of the schedule for each of the subgroups);

- N.aity of a few shifts - In this case, individual classes must come later than the first shift groups, in addition, it is complicated by the windows control in the schedule of teachers, if there are teachers working in both shifts - in this case, in the schedule of these teachers, their classes need to "pull" around the crossing shift;

- W.the word of binding teachers to the audience - individual teachers have "their" audience in which all their classes are carried out;

- N.anise "floating" shift - when the start time of the first lesson is definitely not defined, because It is formed dynamically, depending on the release of related classes, teachers, audiences;

- TOoNTROL OBJECTIVE Schedule entry (class, teacher, audience) to the allowable working range (in the temporary limit card). For example, for a teacher in the temporary restriction map, methodological days are usually indicated, sometimes, some lesson numbers - in short, those positions are indicated that the installation of classes with the participation of this object is impossible;

- N.the aisia \u200b\u200bof combined items - type "inm. / informatics" "Informatics / Labor", etc. - When the class is divided into subgroups;

- W.the word of binding objects to the audiences - conducting classes on individual subjects is possible only in a strictly defined audience or the list of audiences (physical education, work, etc.);

- FROMleaving the schedule, taking into account the circumstance, that in some subjects it comes not a whole class, but its subgroup. That another subgroup at this time did not walk at school, such classes can be put strictly only the first or last lessons in the class schedule;

- “INto keep parallels "- For some teachers, it is necessary to take into account the fact that long-term training is required for classes (for example, chemistry classes), in which case the teacher's day schedule is trying to deliver parallel blocks, for example, first grades, then 7 etc., or when distributing between days, disseminate classes in different parallels for different days;

- ANDnORDOD, when drawing up a schedule, it is required to take into account that nuance that in some subjects the schedule is known in advance - in this case such classes are introduced as inconsistent (fixed);

- TOonropol forbidden combinations of objects per one class schedule - for example, it is undesirable to " physical education"And" labor "was carried out on the same day;

- INfulfill the conditions of the required sequences of objects - when it is necessary to ensure the installation of groups of classes in which classes must go in a certain sequence, for example, physics-astronomy, etc.;

- N.anise classes tied to audiences - the bulk of classes for such classes is carried out in this audience, with the exception of those classes for which a specialized audience is required;

- N.the ends of the arrangement of classes on individual subjects of two classes in a row ("couples", "writers"), and this condition may be rigid (in no case to break the "writers" of classes), and may be preferred (if it is impossible to move Two classes, "Spark" can be broken);

The circumstance is taken into account when, in some subjects, the alignment is permissible only by single occupations.

3. The system "Methodist"

Produced in two versions.

Version Virtual.

Release without an automatic schedule compilation module. Features Version Virtual:

Quick search in the lists of teachers, audiences, classes (groups), disciplines, enclosures;

Obtaining reference information for each found list item (audience capacity, all aud. Cases x, address and tel. Teacher, list of departments, number of hours on discipline, study load teacher and mn. dr.);

Control and the possibility of redistribution of hours between weeks on any discipline account. groups;

Automatic verification of possible data entry errors (compliance with the total amount of hours and by type of classes, the unassignment of teachers in subgroups, the budget of the time of the group and the teacher, the clock inconsistency in flow groups and mn. Other);

The ability to systematized storage (and quick search) additional (not mandatory for compiling a schedule) of information: photos of teachers, curators of training groups ( cool leaders), data on representatives of parental committees, posts, scientific degrees and titles responsible for the audience, ...

The rapid receipt of complete information on the combination of factors (all flow groups, all the disciplines of the teacher x, indicating the load on weeks and types of classes, which disciplines are allowed to carry out in the computer class, personal wishes for the occupations of any teacher, a list of festive dates in the Syrian group and MN. dr.);

Ability to view, print and edit a finished schedule with verification of changes in the correctness of changes (Aud., Pre., Groups / subgroups, ...);

At any time, you can order a schedule forming module for prepared data;

The schedule is formed on your computer with the ability to change settings, control, edits, etc. (without the possibility of changing hours, disciplines, teachers, ...);

If the need for a minor (up to 10%) changes in the source data (errors, sudden additions are detected), it is possible to re-order the schedule forming module for a small fee;

At any time you can go to the version of the standard;

Methodist - standard.

In addition to the capabilities of Virtual, includes:

Automatic schedule compiling module;

Distribution and control of training load;

Structuring a sequence of the discipline (lectures - 2 hours, practical - 4 hours, laboratory ...);

Drawing up a schedule for any type of educational institution: weekly or semester (from 1 to 23 weeks);

Accounting for combining groups (classes) in streams and / or partitioning them into subgroups;

Consolidation of special audiences (computer classes, categories, pool, ...);

Accounting of employment of teachers and audiences (partition, use of a common training base);

Accounting for transition time between hulls;

Weekends and holidays are common and for individual training groups (national, religious, public holidays);

Specifying the reasons for the "unsuccessful appointment" of classes (occupied by the audience, the teacher is appointed to the unwanted day of the week) with the possibility of their "manual" correction;

The possibility of multiple automatic "improvement" of the schedule;

The possibility of changing the significance of the factors taken into account in the preparation of the schedule;

The possibility of introducing teacher priorities - degrees of their individual wishes;

Restrictions on the functionality of the "Methodist":

Multiple schedules are limited to the maximum number of lessons per day - 7;

Classes always begin with the first lesson / pair (if necessary, it is possible to appoint the first pair of "free classes");

Change time is not taken into account (for example, to verify the possibility of transition between hulls);

"The level of complexity" of classes for their rational distribution of the week is not taken into account (although it is possible to do it indirectly);

The duration of occupations is constant (it is impossible to draw up a schedule for 30 minutes. Lesson in the younger and 45 min. - In high school).

Appendix 2. Listing software module solutions to solve automatic schedule compiling

type Myarray \u003d Array of Array Of Real;

Myarray_x \u003d Array of Longint;

procedure Step_Dual_Simplex (VAR A: MYARRAY; M, N, I1, J1: INTEGER);

(produces one step of the dual simplex method,

lead Element - a)

vAR I, J: Integer;

b, B1: Array of Real;

SetLength (B, M); SetLength (B1, N);

for i: \u003d 0 to M-1 DO B [i]: \u003d A;

for i: \u003d 0 to N-1 DO B1 [I]: \u003d A;

for i: \u003d 0 to M-1 Do

for J: \u003d 0 to N-1 Do Begin

if (i \u003d i1) and (j \u003d j1) THEN A: \u003d 1 / B

iF (i \u003d i1) THEN A: \u003d B1 [J] / B

if (j \u003d j1) THEN A: \u003d - B [i] / B

eLSE A: \u003d A-B [i] * B1 [j] / b;

for i: \u003d 0 to N-1 DO A: \u003d 0; A: \u003d - 1;

Finalize (b); Finalize (B1);

function Lexikogr_Few (A: MYARRAY; M, N: INTEGER; I, I1: Integer): Boolean;

(First column lexicographically less than the second)

Lexikogr_few: \u003d false;

while (a \u003d a) and (j

fUNCTION FIND_NU (A: MYARRAY; M, N: INTEGER; I, I1: Integer): LONGINT;

(I - the index of the lexicographically minimal column)

while (a \u003d a) and (j

iF (J 0) THEN FIND_NU: \u003d Round (int (A / A));

procedure Full_integer_Simplex (VAR X: MYARRAY_X; A: MYARRAY; M, N: Integer);

(Fully integer algorithm of the problem of linear integer

programming,

see Hu T. "Integer Programming and Threads in Networks", p. 300-309,

a - Matrix size M + N + 2 * N + 1, by analogy:

It is required to find maximum

z \u003d - 10x1 - 14x2 - 21x3

2x1 + 2x2 + 7x3\u003e \u003d 14

8x1 + 11x2 + 9x3\u003e \u003d 12

9x1 + 6x2 + 3x3\u003e \u003d 10,

the procedure returns the vector x, the first m component of which is the desired solution,

if the last component of the vector \u003d 1, then the solutions do not exist or it \u003d infinity)

vAR I, I1: Integer;

while (i \u003d 0) DO INC (I); (producing string)

while (j \u003d 0) do inc (j);

for i1: \u003d 1 To N-1 DO IF (A

minimum column)

(choice of alpha)

(Writeln (I, "", j); readln;)

for i1: \u003d 1 To N-1 Do IF A

j1: \u003d Find_NU (A, M, N, J, I1);

if (j1\u003e 0) and (-a / j1\u003e alfa) then alfa: \u003d - a / j1;

(Writeln (Alfa, "", I, "", j); readln;)

(Obtaining cut-off Homori)

for i1: \u003d 0 to N-1 DO IF A\u003e 0 THEN A: \u003d Round (int (A / AGFA))

a: \u003d Round (int (A / AFA));

iF FRAC (A / A / AFA) 0 THEN A: \u003d A-1;

STEP_DUAL_SIMPLEX (A, M, N, M-1, J);

until (i\u003e \u003d M-1) OR (J\u003e \u003d N);

for i: \u003d 0 to M-1 DO X [i]: \u003d Round (a);

iF j\u003e \u003d N THEN X: \u003d 1 ELSE X: \u003d 0;

procedure Step_one_Simplex (VAR A: MYARRAY; M, N, I: Integer);

vAR I1, I2: Integer;

(One step of a direct integer method (producing a string - the last

i - producing column))

for i1: \u003d 0 to M-2 DO A: \u003d A / (- A);

for i2: \u003d 0 to N-1 Do

for i1: \u003d 0 to M-2 Do

iF I2I THEN A: \u003d A + A * A;

procedure Direct_integer_Simplex (VAR X: MYARRAY_X; A: MYARRAY; M, N: Integer);

(A direct integer algorithm for the tasks of integer linear programming,

see Hu T. "Integer Programming and Threads in Networks", p. 344-370,

a - Matrix size M + N + 3 * N + 1 by analogy:

it is required to maximize

z \u003d x1 + x2 + x3

4x1 + 5x2 + 2x3

then the matrix and will look like:

10 1 1 1 - In this line, the first number is the rough MAX sums of non-bacon variables

0 0 0 0 - Gomorie cutoff string

the algorithm works only at a\u003e \u003d 0

returns the vector X - on the site of a single matrix the desired solution,

if in the last component unit - error during calculations)

vAR I, J, I1, J1: Integer;

b, B1, B2: Array of Byte;

SetLENGTH (B, M); setLength (B1, M);

for i: \u003d 0 to M-1 DO B1 [i]: \u003d 0;

(verification of optimality conditions)

for j: \u003d 1 to n-1 do if a

while Bool Do Begin

(search for a producing column)

bOOL: \u003d FALSE; J1: \u003d 0;

for J: \u003d 1 To N-1 Do Begin

iF A\u003e 0 THEN

for i: \u003d 0 to M-3 DO A: \u003d A / A;

iF NOT BOOL THEN BEGIN J1: \u003d J; BOOL: \u003d TRUE; END ELSE IF Lexikogr_Few (A, M, N, J, J1)

(search for a producing string)

for J: \u003d 1 To N-1 Do

iF A\u003e 0 THEN

for i: \u003d 0 to M-3 DO A: \u003d A * A;