Coder Social home page Coder Social logo

joshk0 / good-enough-golfers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from islemaster/good-enough-golfers

0.0 1.0 0.0 37 KB

The "good enough" Social Golfer Problem Solver

Home Page: http://goodenoughgolfers.com/

License: MIT License

CSS 8.28% HTML 15.62% JavaScript 76.10%

good-enough-golfers's Introduction

Good-Enough Golfers

Good-Enough Golfers is a near-solver for a class of scheduling problems including the Social Golfer Problem and Kirkman's Schoolgirl Problem. The goal is to schedule g x p players into g groups of size p for w weeks such that no two players meet more than once.

Real solutions to these problems can be extremely slow, but approximations are fast and often good enough for real-world purposes.

History

I originally threw this together over a Thanksgiving weekend because my Dad (a professor) posed the following problem:

I have 28 students that I want to organize into discussion groups of 4. I want them to rotate into new groups every 15 minutes, but never be in a group with the same person twice. Also, I've got several students that all brought the same article to class - they shouldn't be grouped together, if possible.

I pointed out that this sounded like a combinatorics problem, and while we quickly found matching problems online there weren't very many tools for solving them, much less with the additional constraints we needed.

FAQ

What does the conflict score indicate?

The conflict score is a made-up internal score used to compare candidate solutions while running the genetic algorithm. I've been meaning to replace it with a human-friendly "conflict count" in the UI. Here's how the score is currently calculated:

For every possible pairing of people in the group, the algorithm tracks the total number of times they've been placed in a group together. (This typically starts at zero for every pair.) After each round is locked it updates these counts. Then, while evaluating possible solutions for the next round, the "cost" of each pair is the square of the number of times they've been in a group together before. In other words, the cost of a pair that's golfed together once is 1, but if they've golfed together twice the cost of putting them together again jumps to 4, subsequently 9, and so on. The conflict score for a round is the sum of the cost of every pairwise relationship in every group for that round.

So, for low values, it represents the number of pairs that have been grouped together before. At higher values it's hard to give a useful unit of measurement.

The key advantage of the exponential behavior is that makes an even distribution of conflicts among players more favorable than putting one pair together over many rounds, which is especially useful in unsolvable situations. You can check this on a small scale with two groups of three players over four rounds - this heuristic nearly guarantees that no pair golfs together more than twice, even though conflicts are inevitable.

Pairs entered in the "Never allow these pairs" box begin with a cost of Infinity, outweighing any cost computed by the algorithm.

good-enough-golfers's People

Contributors

islemaster avatar joshk0 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.