Git Product home page Git Product logo

fastgeneralizedmatching's Introduction

FastGeneralizedMatching

A repository for an implementation of Matching with Contracts. Initial work will be applied to CS 205 Final Project at Harvard University. Contributors: Ankit Gupta (@ankitvgupta) and Jonah Kallenbach (@jonahkall)

This repository contains the following important files, that should be evaluated for grading purposes.

Algorithms

  • ParallelSpark-Fast.py contains the spark-based implementation of the algorithm we developed to solve the National Residency Match in approximately O(log N) iterations. This is the primary part of our project, as the algorithm we designed for this has, to the best of our knowledge, never been used before.
  • ParallelSpark.py contains the old, slower spark-based implementation which works very similarly to Gale-Shapley
  • GaleShapleySerial.py contains the serial implementation of Gale-Shapley.
  • ParallelKnapsack.py contains our first implementation of a type of matching with contracts problem. We wrote a knapsack solver using dynamic programming, and parallelized the technique using Spark. This was one of the "extension" components of our project.

Generators

  • generate_matchings.py: contains code to generate preferences for give numbers of doctors, hospitals, and other preferences.
  • generate_graphs.py takes the data from the various experiments and plots the results

Dependencies

Pyspark (we use Spark 1.5.0 and findspark), numpy, scipy

Instructions to Run

  • Set parameters in generate_matchings.py to the desired parameters.
    • Recommended parameters are numDoctors = 4100, numHospitals = 500, numPreferencesPerDoctor = 100
  • run python generate_matchings.py
    • This will output save two files with lists of preferences
    • This may take a few minutes to run.
  • You should now see a doctor_preferences.txt and hospital_preferences.txt file created in the directory
  • Run time python ParallelSpark-Fast.py doctor_preferences.txt hospital_preferences.txt, or any of the other above algorithms
  • The code should execute and print the time it took to generate all of the matchings and verify their stability.

fastgeneralizedmatching's People

Contributors

jonahkall avatar ankitvgupta avatar

Watchers

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