Skip to main content

Optimal b-matching for scored meeting assignments.

Project description

This module implements an algorithm designed for optimal matchings encouraging informal social connections between team members in a workgroup.

While our company's WFH policy was in place during the COVID-19 pandemic, my team sought ideas to strengthen social ties and help new hires feel welcomed. One very successful program involved randomly assigning weekly 15-minute meetings between team members for a quick chat. However, many participants felt these random assignments weren't ideal: Newcomers wanted more meetings early on, to meet more people. Other team members found themselves meeting with their own close teammates, or with the same person multiple times in just a few weeks!

To address this, we explored an optimal matching algorithm. The ideal approach would assign scores to each potential pairing, assigning higher scores to pairs of participants in different cities, or different subteams, and lower scores to pairs that had already been assigned recently. New hires would be assigned multiple pairings for new hires in their first few months.

After a literature review, I learned this problem is known in the literature as the maximum weighted b-matching problem. Unlike stable marriage or maximum-weighted matching, b-matching allows some nodes to be matched more than once. There is some recent research demonstrating polynomial time solutions for general b-matching, but I found no easy-to-use open source implementations. We observed that for the case of small n, a solution based on integer programming runs in only a few seconds on desktop PCs, which makes it well-suited to this application's requirements.

In addition to the integer programming solver for standard maximum-weighted b-matching -- b_matching.maximize_weighted_b_matching -- this package also includes a small wrapper b_matching.inclusive_matching enforcing the additional constraint that all nodes must be used in at least one matched pair. A short proof for the inclusive matching algorithm can be found in inclusive_b_matching.md. The toy_example provides a small example illustrating the use of inclusive matching to assign social meetings across a tiny but distributed team.

Acknowledgements: Mirkó Visontai provided helpful math research, suggestions, and code reviews. Bo Zulonas provided the score-based matching idea, original scoring functions, and useful feedback.

This is not an officially supported Google product.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

social_b_matching-0.0.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

social_b_matching-0.0.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file social_b_matching-0.0.1.tar.gz.

File metadata

  • Download URL: social_b_matching-0.0.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for social_b_matching-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8c668ec1e39ed2af061986187fdadb4ef31baf0f94e7035c8795978f5fb24f19
MD5 286d5d54f267a532fd6854ab23acd0b9
BLAKE2b-256 e166b6c63cd83c7ce1928ffdc07a331227cfe758f8dbee95b1fc127726ac1ee1

See more details on using hashes here.

File details

Details for the file social_b_matching-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for social_b_matching-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d639354b6bbfb56c8c8abbc32d1195adc47d4b94f88a505ffe548729a6b89052
MD5 b897b8ddff4c51e6abe3cf87fccaa62a
BLAKE2b-256 bb663667012f9891ce6af70895de9991a4439965241edf842e7edd99149f6677

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page