GithubHelp home page GithubHelp logo

acezxn / grouping-optimization Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 16.07 MB

Web application to experiment with group happiness optimization using multiple grouping algorithms.

License: MIT License

Python 28.03% HTML 7.63% CSS 29.97% JavaScript 34.16% Procfile 0.01% Roff 0.19%
grouping optimization

grouping-optimization's Introduction

    Grouping-optimization

This website is intended to achieve the fairest group division, increasing social interests by improving overall satisfaction of group mates.

Pictures

Signing up
Screen Shot 2023-01-10 at 10 56 27 PM
Class members could input their preferences
Screen Shot 2023-01-10 at 10 57 39 PM
Class owners could customize optimization methods
Screen Shot 2023-01-10 at 10 58 26 PM
An example of the output
Screen Shot 2023-01-10 at 10 59 05 PM

Features

An account is needed to work with the algorithms of the web application.

  • Users can register accounts. In every account, user can join a classroom or create a new one.
  • Classrooms are intended for the class owner (the class creator) to select the favorite algorithm to generate optimized groups. There is an algorithm is faster for smaller classes (less than 12 people), and the other that is generally slower but capable of handling larger classes.
  • Everyone except the class owner have the interface to provide information of their favorites as well as someone they do not like much. The information is designed not be exposed to anyone within and outside the classroom. Only the person holding the information can view it.
  • The web application supports both English and Traditional Chinese.

Algorithms

The web application actually includes only Combination Selection Grouping and Regression Algorithm, but three algorithms were developed just in case if they are useful.

1. Combination Selection Grouping

  1. The possible outcome of a single groups are generated using itertools library.
  2. Using a recursive function, compute the possible outcomes of other groups to form nCr cases, which n is the number of people in total, and r is the group size.
  3. A dictionary of people favorism are used to compute the overall happiness of each group. For every groupmates, if one favored person in the same group, the overall happiness index will plus 1. On the other hand, if one unfavored person in the same group, the overall happiness index will minus 1.
  4. The happiness calculation will run in every groups in every cases
  5. The score of least happy groups will be collected as a list, where each element represent the least happy group of each case.
  6. The cases with highest least happy score will be selected to be the output.

2. Regression Algorithm

  1. The program generates the groups randomly
  2. The program calculates the most unhappy group, and change the member from the group with other groups randomly. The happiness calculation algorithm is the same as that of Combination Selection Grouping
  3. If the score of the most unhappy group exceeds the record, then set it as the current record. If the program cannot beat the record with a fixed attempts, the program will return the record.

Performance

Complexity for Combination Selection Grouping:

n represents the total number of people, r represents the group size, and x represents a positive integer.

$${n-1 \choose r-1} \cdot {n-r-1 \choose r-1} \cdot {n-2r-1 \choose r-1}...;n-xr-1 \geq r-1$$

The complexity grows factorially. Therefore, it is not suitable to group a class with more than 12 people.

Complexity for Regression Algorithm:

Maximum complexity:

$$depth * attempts$$

whereas depth is set fixed to 100 and maximum attempts is set fixed to 100000.
Therefore, it is more usable when grouping large classes.

grouping-optimization's People

Contributors

acezxn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.