https://github.com/cyberagentailab/fairreciprocalrecommendation

This repository contains the algorithms and synthetic data generation codes used in the experimental section of the paper 'Fair Reciprocal Recommendation in Matching Markets' by Yoji Tomita and Tomohiko Yokoyama, RecSys2024.

https://github.com/cyberagentailab/fairreciprocalrecommendation

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: acm.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

This repository contains the algorithms and synthetic data generation codes used in the experimental section of the paper 'Fair Reciprocal Recommendation in Matching Markets' by Yoji Tomita and Tomohiko Yokoyama, RecSys2024.

Basic Info
  • Host: GitHub
  • Owner: CyberAgentAILab
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 43 KB
Statistics
  • Stars: 2
  • Watchers: 0
  • Forks: 2
  • Open Issues: 1
  • Releases: 0
Created almost 2 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

Fair Reciprocal Recommendation in Matching Markets

This repository contains the algorithms and synthetic data generation codes used in the experimental sections of the following papers: - [1] Yoji Tomita and Tomohiko Yokoyama. 2024. "Fair Reciprocal Recommendation in Matching Markets." Proceedings of the 18th ACM Conference on Recommender Systems (RecSys'24). - [2] Yoji Tomita and Tomohiko Yokoyama. 2025. "Balancing Fairness and High Match Rates in Reciprocal Recommender Systems: A Nash Social Welfare Approach." Working Paper.

Requirements

If you can use Rye, you can set up the environment just by running the following command: rye sync

If you need to set up the Python environment manually, we require the followings: - Python >= 3.9 - numpy >= 2.0.1 - cvxpy >= 1.5.2 - jupyter >= 1.0.0 - torch >= 2.8.0

Files

In the src directory, there are the following files:

  • market.py: The class definition of the matching markets, including the synthetic preference data generation and the checking function of the envy-freeness.
  • utils.py: The utility functions.
  • naive.py: The algorithm for the naive method (baseline).
  • prod.py: The algorithm for the prod method (baseline).
  • tu_matching.py: The algorithm for the TU-matching method (baseline).
  • iter_lp.py: The algorithm for the iterative LP method (baseline).
  • alternate_fw.py
    • sw_maximize: The alogirhtm for the SW maximization via the alternate Frank-Wolfe method (proposed in Section 3 of Tomita and Yokoyama [1]).
    • nsw_maximize: The alogirhtm for the NSW maximization via the alternate Frank-Wolfe method (proposed in Section 4 of Tomita and Yokoyama [1]).
    • alpha_sw_maximize: The algorithm for the α-SW maximization method (proposed in Section 6 of Tomita and Yokoyama [2]).
  • alternate_fw_sinkhorn
    • sw_sinkhorn : The approximate algorithm for the SW maximization via the Sinkhorn algorithm (proposed in Section 7 of Tomita and Yokoyama [2]).
    • nsw_sinkhorn: The approximate algorithm for the NSW maximization via the Sinkhorn algorithm (proposed in Section 7 of Tomita and Yokoyama [2]).
  • experiments.py: Conduct synthetic data experiments (Section 5.1 of Tomita and Yokoyama [1], Section 8.2-8.4 of Tomita and Yokoyama [2]).

Example Usage

cd src ```python from market import Market from alternatefw import nswmaximize

Make a market with 30 left agents and 20 right agents, and generate preferences

mkt = Market(numleft=30, numright=20) mkt.generatepreferences(prefseed=0)

Run the NSW maximization algorithm

policyforleft, policyforright = nswmaximize(mkt.preflefttoright, mkt.prefrighttoleft, mkt.vleft, mkt.v_right)

Compute the matching probabilities and check the envy-freeness

matchprob = mkt.getmatchprob(policyforleft, policyforright) print("Expected number of matches:", matchprob.sum()) envy = mkt.checkenvy(policyforleft, policyforright, matchprob=match_prob) print("Number of envies for left agents:", len(envy["left"])) print("Number of envies for right agents:", len(envy["right"])) `` For more detailed examples, see: - [notebooks/example.ipynb](https://github.com/CyberAgentAILab/FairReciprocalRecommendation/blob/main/notebooks/example.ipynb) for basic usages of the proposed algorithms. - [notebooks/experiments.ipynb`](https://github.com/CyberAgentAILab/FairReciprocalRecommendation/blob/main/notebooks/experiments.ipynb) for the synthetic data experiments.

Citations

  • Yoji Tomita and Tomohiko Yokoyama. 2024. "Fair Reciprocal Recommendation in Matching Markets." Proceedings of the 18th ACM Conference on Recommender Systems (RecSys'24). @inproceedings{tomita2024fair, title={Fair Reciprocal Recommendation in Matching Markets}, author={Tomita, Yoji and Yokoyama, Tomohiko}, booktitle={Proceedings of the 18th ACM Conference on Recommender Systems}, pages={209--218}, year={2024} }
  • Yoji Tomita and Tomohiko Yokoyama. 2025. "Balancing Fairness and High Match Rates in Reciprocal Recommender Systems: A Nash Social Welfare Approach." Working Paper. @unpublished{tomita2025balancing, title={Balancing Fairness and High Match Rates in Reciprocal Recommender Systems: A Nash Social Welfare Approach}, author={Tomita, Yoji and Yokoyama, Tomohiko}, year={2025} }

License

This repository is licensed under the MIT License.

Owner

  • Name: CyberAgent AI Lab
  • Login: CyberAgentAILab
  • Kind: organization
  • Location: Japan

GitHub Events

Total
  • Issue comment event: 4
  • Push event: 2
  • Pull request event: 1
  • Fork event: 2
Last Year
  • Issue comment event: 4
  • Push event: 2
  • Pull request event: 1
  • Fork event: 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 5.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 7 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 5.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • miiitomi (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi
  • cvxpy >=1.5.2
  • jupyter >=1.0.0
  • numpy >=2.0.1