|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Gale Shapley Algorithm More...
#include <iostream>#include <vector>#include <algorithm>#include <cassert>Namespaces | |
| namespace | greedy_algorithms |
| for std::vector | |
| namespace | greedy_algorithms::stable_matching |
| Functions for the Gale-Shapley Algorithm. | |
Functions | |
| 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. | |
| static void | tests () |
| Self-test implementations. | |
| int | main () |
| Main function. | |
This implementation utilizes the Gale-Shapley algorithm to find stable matches.
Gale Shapley Algorithm aims to find a stable matching between two equally sized sets of elements given an ordinal preference for each element. The algorithm was introduced by David Gale and Lloyd Shapley in 1962.
| int main | ( | void | ) |
|
static |
Self-test implementations.