Giter Club home page Giter Club logo

roommate-matching's Introduction

roommate-matching

We match pairs of people according to specified criteria.

We want to match pairs of people according to criteria, assumming unconstrained number of rooms such that if there are n people and k = 2 people per room, the number of rooms would be floor(n/k) if n is even and floor(n/k) + 1 if n is odd. We will place all people into doubles and the remainder in the odd case gets their own room.

Criteria

  1. Gender What gender are you? What gender do you want?

  2. Subfree Do you want subfree?

  3. First choice Who do you want to live with (both must agree)?

Inputs

Out program will take a list of people and their preferences in a csv file. (name, gender, preferred gender, subfree?, first choice)

Output

List of pairs:

name-name

.

.

.

name

In the odd case, there is one person who is in a room by themselves, therefore they are listed by themselves.

Algorithms ideas

  1. List
  • Read every entry from input file
  • Convert each to object
  • Store them in a list
  • While list has more than one element
    • Compute match score between head and every other element in the list and find the element with max match score through linear search
      • match score is weighted (first choice match outweighs all other criteria)
    • Remove the head and the matched elements from the list
      • Sliding

roommate-matching's People

Contributors

charunupara avatar ilic-stefan avatar

Watchers

James Cloos avatar  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.