Skip to content

Repository files navigation

Pair Research Matching Algorithm

This repository includes two matching algorithms that are used for Pair Research:

  1. Stable Roommates Matching
  2. Maximum Weighted Matching

Software requirements

  • Python 3.13
  • uv

Development and Analysis

  1. Run uv sync to set up your virtual environment and install packages.
  2. Activate environment using source .venv/bin/activate.
  3. Run pre-commit install to set up commit hooks for Python linting + formatting, and Markdown formatting.
  4. Run jupyter notebook to start a notebook server. Analysis notebooks are contained in the sr_analysis/ directory.
    1. You will need an .env with the MongoDB URI to the Pair Research database as MONGO_URI=<URI>.

Usage

cat input.json | python pair_research.py

Example:

Input: [(0, 1, 93), (0, 2, -20), (0, 3, 2), (1, 2, -13), (1, 3, 10), (2, 3, 80)]

  • Matching person 0 and person 1 gives a score of 93
  • Matching person 0 and person 2 gives a score of -20
  • Matching person 0 and person 3 gives a score of 2
  • Matching person 1 and person 2 gives a score of -13
  • Matching person 1 and person 3 gives a score of 10
  • Matching person 2 and person 3 gives a score of 80

Output: [1, 0, 3, 2]

  • Person 0 is matched with person 1
  • Person 1 is matched with person 0
  • Person 2 is matched with person 3
  • Person 3 is matched with person 2

About

Matching algorithm for pair research

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages