For the problem “Stable Marriage”, implement the presented iterative improvement algorithm to solve the problem.
Create Python classes Man, Woman to store following information of each person:
Create two lists of unmatched men and women, respectively, in the above example.
Write a Python function select to arbitrarily select a man who is free from an input list of men.
Write a Python function propose to model proposing process. The function takes lists of men and women and a currently considered man. It returns the changed lists of men and women with their corresponding changed status.
Write a complete program to solve the Stable Marriage problem.
Test the program on the example.
For the problem “Stable Marriage”, implement the presented iterative improvement algorithm to solve the problem.
Create Python classes Man, Woman to store following information of each person: Create two lists of unmatched men and women, respectively, in the above example. Write a Python function select to arbitrarily select a man who is free from an input list of men. Write a Python function propose to model proposing process. The function takes lists of men and women and a currently considered man. It returns the changed lists of men and women with their corresponding changed status. Write a complete program to solve the Stable Marriage problem. Test the program on the example.