Difference between stable marriage problem and assignment problem
The main difference is the optimization goal.

In classical assignement problem, there is a fitness/cost function to maximize/minimize. Each assignement possibility has a weight and you only sum up all these weights to get the best global result. Only the overall result matters even if it means some individual assignements have a very bad fitness/cost.

In the stable marriage problem, it is the opposite. You do not care about the overall optimality. You just want to guarantee that it does not exist a "male" and a "female" that would both be "happier" together rather than with their assigned partner.

The idea behind the word "stable" is that if such a couple exists, they will tend to get together breaking your initial assignement.

An exemple:
two "males" A and B and two "females" C and D

A loves hardly C (weight 10) and not D (weight 1)
B loves a little more C (weight 3) than D (weight 2)
C loves a little more B (weight 3) than A (weight 2)
D loves hardly B (weight 10) and not A (weight 1)


In assignement problem, you clearly put A&amp;C and B&amp;D to get a fitness score of 24. But this is not a stable marriage as B and C would rather like to be together. A&amp;D and B&amp;C is a stable marriage but only has a fitness score of 8.