Stable Match Algorithm in Procurement

Intro

Both Suppliers and Project Coordinators have their own preferences against each other. Algorithm helps to match a coordinator with a supplier so that all the partnerships could remain stable and bring mutual benefit.

The idea was derived from Stable Marriage Problem.

Due to wikipedia:

The stable marriage problem has been stated as follows:
Given n men and n women, where each person has ranked all members of the opposite sex in order of preference, marry the men and women together such that there are no two people of opposite sex who would both rather have each other than their current partners. When there are no such pairs of people, the set of marriages is deemed stable.

Features

App includes following features:

  • UML diagram
  • OOP

Demo

  • The company have launched 6 new projects. For each project there were cooridnators assigned to who need to choose one supplier to co-work with.
  • In the example there are 6 Project Coordinators.
  • In the example there are 6 Suppliers.
  • Each single coordinator and supplier is called 'party' in the script.
  • Number of parties can be set in the script.
  • Constraints: number of coordinators = number of suppliers.
  • Each party has its own 6 items list of preferences.
  • Project Coordinators chooses preffered Suppliers in the descending order of preference starting from the most preffred one and vice versa.
  • Script uses random library to shuffle prefrerences for each party.
  • Script matches coordinator-suppliers pairs according to their preferences list.
  • Script continues matching and breaking matches till we have all the parties matched up and, what is most important, no one from the pairs has better preffered option - it's called a stable match.
  • Supplier S4 and S5 were the most preferred suppliers to co-work with among the coordinaotrs.
  • Due to randomness suppliers have a big difference of the most preffered coordinator to co-work with.
  • Script needed to break 5 paris in order to assign parties to better options.
  • Script matched all parites successfully ensuring stable match.

Setup

No specific installation required.

Source Code

You can view the source code: HERE