0

i'm looking for a framework that is able to solve the following Data Science issue:

I have several Teachers that can work for X amount of hours a week and have several subject that they can teach.

  • Teacher 1: Math
  • Teacher 2: Math + English
  • Teacher 3: Sports + Art + English
  • Teacher 4: Math + Art
  • Teacher 5: Sports + Math + English

In a school, every subject needs a specific amount of hours per week. Some more than others

  • Math: 12 hours
  • English: 8 hours
  • Art: 4 hours
  • Sport: 2 hours

Lets say one teacher can do 2-3 hours just so you get my point^^

The Solution im looking for is a Framework or Algoritm that is filled (trained) with the data and then is able to distribute the teachers so all the subjects are capped or at least as close as possible. That means maybe Teacher 2 needs to teach only Math and Teacher 5 needs to teach 50% Sport and 50% English or 30% Math / 40% Sport / 30% English.

Someone mentioned Prolog but im not sure if it can handle this kind of problem? Maybe im wrong?

Is there something that is fitting for my problem or am i destined to code that algorithm from scratch on my own?

Thanks in advance.

Specta
  • 37
  • 6
  • 2
    This does not sound like you have to "train" anything. "Training" is used with machine learning algorithms, I think? Neural Networks and that kind of stuff? Maybe you just need a constraint solver? It might be that it is enough to use a something like constraint logic programing with finite domains? Who mentioned Prolog (from your question) and what exactly did they mean? – TA_intern Sep 28 '21 at 08:39
  • 4
    https://www.youtube.com/watch?v=uKvS62avplE – false Sep 28 '21 at 08:47
  • This problem is severely underspecified. – David Tonhofer Sep 28 '21 at 14:13

2 Answers2

3

An simple program to show constraint solving for this specific example in gnu-prolog:

soln(X) :-
    X = [T1M, T2M, T2E, T3S, T3A, T3E, T4M, T4A, T5S, T5M, T5E],
    fd_domain(X, 0, 10),

    %% subject constraints
    T1M + T2M + T4M + T5M #= 12,
    T2E + T3E + T5E #= 8,
    T4A + T3A #= 4,
    T3S + T5S #= 2,

    %% teacher constraints b/w 2 and 8 hrs
    2 #=< T1M, T1M #=< 8,
    2 #=< T2M + T2E, T2M + T2E #=< 8,
    2 #=< T3S + T3E + T3A, T3S + T3E + T3A #=< 8,
    2 #=< T4M + T4A, T4M + T4A #=< 8,
    2 #=< T5S + T5M + T5E, T5S + T5M + T5E #=< 8,
    fd_labeling(X).

with a few solutions

| ?- soln(X).

X = [2,0,2,0,0,6,4,4,2,6,0] ? ;

X = [2,0,2,0,1,5,5,3,2,5,1] ? ;

X = [2,0,2,0,1,6,4,3,2,6,0] ? ;

X = [2,0,2,0,1,6,5,3,2,5,0] ? ;

X = [2,0,2,0,2,4,6,2,2,4,2] ? ;

X = [2,0,2,0,2,5,5,2,2,5,1] ? ;

X = [2,0,2,0,2,5,6,2,2,4,1] ? ;

X = [2,0,2,0,2,6,4,2,2,6,0] ? ;

X = [2,0,2,0,2,6,5,2,2,5,0] ? ;

X = [2,0,2,0,2,6,6,2,2,4,0] ? ;

X = [2,0,2,0,3,3,7,1,2,3,3] ? ;

X = [2,0,2,0,3,4,6,1,2,4,2] ? ;

X = [2,0,2,0,3,4,7,1,2,3,2] ? 

Each solution X = ... gives the distribution for hours for T1M, T2M, T2E, T3S, T3A, T3E, T4M, T4A, T5S, T5M, T5E respectively.

rajashekar
  • 3,460
  • 11
  • 27
  • wow dude..thats a banger! I will try with the whole Dataset. Thanks a lot – Specta Sep 28 '21 at 10:10
  • is it possible to set a prioritization in the constraints? Like if its not possible to cap the subjects 100%, the algorithm shoud prioritize Math before English before Sports and so on? – Specta Sep 28 '21 at 12:26
  • 1
    @LarsB. Yes, you can do that. Such constraints should be designed appropriately. You could optimize variables using `fd_maximize(Goal, Var)` in `gnu-prolog`. So you should loosen the subject constraints a bit (use `#<` instead of `#=`) and then use `fd_maximize`. If you are new to prolog, I suggest you try out a few examples of constraint solvers and see how they actually work. In most cases modelling the problem correctly will be harder part than actually writing the program. – rajashekar Sep 28 '21 at 12:56
  • 1
    @LarsB. If you have time, I suggest going through the youtube video suggested by `false` in the comments. You will get a good overview of how to work with constraint programming. – rajashekar Sep 28 '21 at 13:01
1

The first step seems to be to translate a research problem (or a series of problem statements) into a precise form. Problem Characterization/Problem Conceptualization seems to be a technique for resolving that issue. Once the approach has been conceptualised, a technique must be identified for each of the sub-models and submodules.

Breaking down the high problem statement into smaller problems is called problem conceptualizing. For every subproblem, a technique must be identified, and the methodology must be determined by the assumptions that have been stated previously.

Realization of a Solution: Determines whether the assumptions are reasonable or whether the solutions meet his needs.

This can be compared to a flowchart that he has been creating with these subproblems, and also in general, it is attempting to reach a granularity level where he would determine the issue class. As a result, these issues can be classified as being either function optimization or categorization issues.