an empirical study of the stable marriage problem with ties and incomplete lists (smti) ian gent...

32
An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Upload: natalie-bain

Post on 28-Mar-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

An empirical study of the stable marriage problemwith ties and incomplete lists (SMTI)

Ian Gent & Patrick Prosser

Page 2: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

The presentation in a nutshell

• What is a stable marriage problem?• How do you encode it as a constraint program?• What is a stable marriage problem with ties and incomplete lists?• A problem generator• How do you encode it as a constraint program?• An empirical study

• of the decision problem• of the optimisation problem

• Conclusion• So?

Page 3: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

What is the Stable Marriage Problem? (SM)

We have n men

BobIanJonSam

and n women

: Ian Jon Sam Bob: Jon Ian Bob Sam: Bob Jon Sam Ian: Sam Bob Ian Jon

Each man ranks the n women

: Sue Joe Liz Zoe : Liz Joe Zoe Sue: Joe Sue Liz Zoe: Zoe Sue Joe Liz

JoeLizSueZoe

and each woman ranks the men

Men Women

Each man has to marry a woman.

Bigamy is not allowed.

Marriages must be stable

Page 4: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Same thing, but with numbers!

We have n men

1234

and n women

: 2 3 4 1: 3 2 1 4: 1 3 4 2: 4 1 2 3

Each man ranks the n women

: 3 1 2 4 : 2 1 4 3: 1 3 2 4: 4 3 1 2

1234

and each woman ranks the men

Men Women

Each man has to marry a woman.

Bigamy is not allowed.

Marriages must be stable

Page 5: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Stable? An example

1234

: 2 3 4 1: 3 2 1 4: 1 3 4 2: 4 1 2 3

: 3 1 2 4 : 2 1 4 3: 1 3 2 4: 4 3 1 2

1234

man 2 prefers woman 1 to woman 4 woman 1 prefers man 2 to man 3

man 2 and woman 1 will elope

man 2 marries woman 4 <2,4>man 3 marries woman 1 <3,1>

Page 6: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

A Constraint Encoding

1234

: 2 3 4 1: 3 2 1 4: 1 3 4 2: 4 1 2 3

: 3 1 2 4 : 2 1 4 3: 1 3 2 4: 4 3 1 2

1234

(m4 = 3 w3 = 4) stable(m4,w3)

Combined nogoods: {(3,1),(3,2),(3,3),(1,4),(2,4),(4,4),(1,2),(2,2)}

Do this for all man/woman pairs

Page 7: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

What is SMTI?

We have n men

1234

and n women

: 2 3 4 1: 3 2 1 4: 1 (3 4 2): 4 2 3

Each man ranks the n women

: 3 1 2 : 2 (1 4) 3: 1 3 2 4: 4 3 1 2

1234

and each woman ranks the men

Men Women

Each person prefers to be married

Bigamy is not allowed.

Marriages must be stable

• Man 1 and woman 4 find each other unacceptable

• Man 2 is indifferent to woman 1 and 4 (I.e. women 1 and 4 tie)

• Woman 3 is indifferent to men 3, 4, and 2 (they also tie)

Page 8: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

What is SMTI?

• SM with ties is in P• SM with incomplete lists is in P• SM with ties and incomplete lists is in NP

But how does it behave?Just because it is NPC, does that mean it is hard?If so, where are the hard problems

Page 9: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

A problem generator

<n,p1,p2>

n is the number of men and women

p1 is the probability of incomplete lists• p1 = 0 lists are complete• p1 = 1 lists are empty

p2 is the probability of ties• p2 = 0 there are no ties• p2 = 1 all ties, we have a maximum matching

<n,0,0> is an SM!

NOTE: we discard any problem that has empty preference lists from this study!

Page 10: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

A complete algorithm for the decision problem

For the decision problem “Is there a stable matching of size n”

• a simple extension of the earlier O(n4) encoding• a constraint between every man and woman• disallowing unstable pairs• disallowing anything but a bijection• domain is preference list

• variable ordering• choosy person

• value ordering• most preferred partner

• coded in Choco

Page 11: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

A complete algorithm for the optimisation problem

For the optimisation problem • find the largest stable matching• find the smallest stable matching

• a simple extension the the earlier O(n4) encoding• a constraint between every man and woman• disallowing unstable pairs• disallowing anything but a bijection• domain is preference list

• + a person that anyone can marry• a set of 0/1 variables Z

• Zi = 0 if Mi is unmarried• maximise or minimise the sum of Z

• variable ordering• choosy person• ignore Z variables!

• value ordering• most preferred partner

• Coded in Choco

Page 12: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Given an SMTI <10,p1,p2>

As I vary ties (p2) what is the effort todetermine if there is a stable marriage of size n?Will problems become harder or easier as ties increases?How do ties influence solubility?

Questions: for the decision problem

Given an SMTI <10,p1,p2>

Do we see the familiar phase transition behaviour?

Given an SMTI <n,p1,p2>

How does computational effort scale with problem size n?

Page 13: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Is there a stable matching of size n?

Probability of ties

Pro

port

ion s

olu

ble

As ties increase solubility increases. Incompleteness reduces solubility

Page 14: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Rather than p2 (ties) on the x axis, how about kappa?

Page 15: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

What is kappa?

N

Solk

)log(1

<Sol> is expected number of solutionsN is log of the size of the state space

• k = 0 if all states are solutions, therefore easy & soluble• k = infinity if no states are solutions, therefore easy & insoluble• k = 1 there is one solution on average, on the knife edge & hard

We can compute this instance by instance

Kappa is a measure of constrainedness!

Page 16: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Solubility against constrainedness

Kappa (constrainedness)

Pro

port

ion s

olu

ble

We see a familiar phase transition

Page 17: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

What is the cost of the decision problem?

Page 18: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

The cost of the decision problem

Probability of Ties (p2)

Nodes

explo

red

As ties increase so does search effort. Why? More choice, less determined

As incompleteness increases search cost decreases (less choice)

But look, only 9 nodes maximum for n=10

Page 19: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Search cost against kappa. What does that look like?

Page 20: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Search cost against kappa

Constrainedness (kappa)

Nodes

vis

i ted

Woops! What happened to the much loved complexity peak?

Page 21: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

How does search cost grow with problem size?

Page 22: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Median search effort for <n,0.5,p2>

Probability of ties (p2)

Media

n s

earc

h n

odes

explo

red

It appears search effort increases polynomially with problem size

Page 23: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Given an SMTI <10,p1,p2>

As I vary ties (p2) how will this influence the size of thelargest and the smallest stable matchings?

Questions: for the optimisation problem

Given an SMTI <10,p1,p2>

Is it easier to find the smallest matching or the largest matching?

Given an SMTI <n,p1,p2>

How does computational effort grow with problem size n?

Page 24: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

What is the size of the largest and smallest stable matchings?

Note: this is an interpolating parameter!

Note: can’t plot against kappa (not defined for optimisation)

Page 25: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

The average size of the largest and smallest stable matchings <10,0.5,p2>

Probability of ties p2

Avera

ge s

ize o

f st

able

matc

hin

g

Smallest matching

Largest matching

As ties increase the difference between largest and smallest matchings increases

Page 26: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

What is harder

• (a) finding the largest stable matching?• (b) finding the smallest stable matching?

Place your bets!Betting ends

Page 27: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

The average cost of finding the LARGEST stable matching

Probability of ties p2

Log o

f m

ean s

earc

h e

ffort

in n

odes

It appear to be easy!

Page 28: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

The average cost of finding the SMALLEST stable matching

Probability of ties p2

Log o

f avera

ge s

earc

h c

ost

in n

odes

It is hard! Conjecture: proving optimality is hard

Page 29: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

How does search effort scale with problem size nas we look for the largest and smallest stable matching?

Read the paper

Page 30: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

You have just had a first taste of the smti• what it feels like• how it is influenced by p1 and p2

• I spared you n in optimisation

The experiments took in excess of 2 months cpu• at least 766MHz

Lots more to be done• higher dimensionality

• more than 2 sexes• different levels of stability• kappa for smti

• theory based heuristics• real problems• transition from P to NPC

Conclusion and future work

Page 31: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Thanks to the APES, David & Rob

Page 32: An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser

Questions?