TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Functions for the Gale-Shapley Algorithm. More...
Functions | |
std::vector< std::uint32_t > | gale_shapley (const std::vector< std::vector< std::uint32_t > > &secondary_preferences, const std::vector< std::vector< std::uint32_t > > &primary_preferences) |
The main function that finds the stable matching between two sets of elements using the Gale-Shapley Algorithm. | |
Functions for the Gale-Shapley Algorithm.
std::vector< std::uint32_t > greedy_algorithms::stable_matching::gale_shapley | ( | const std::vector< std::vector< std::uint32_t > > & | secondary_preferences, |
const std::vector< std::vector< std::uint32_t > > & | primary_preferences ) |
The main function that finds the stable matching between two sets of elements using the Gale-Shapley Algorithm.
primary_preferences | the preferences of the primary set should be a 2D vector |
secondary_preferences | the preferences of the secondary set should be a 2D vector |
Definition at line 46 of file gale_shapley.cpp.