Stable Marriage

Discuss all kind of algorithms and data structures from their mathematical and programming sides.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Postby Punkis » Fri Apr 25, 2008 10:36 am

well, the thing i have to do is to translate the algorithm:

Initially all the men and women are free.There is a man "a" which is free and has not made proposal in any of the women.
Choose a such man "a".
Be it "g" the woman who has a higher ranking in the preferences of "a" and in which "a" has still not made proposal.
If the "g" is free then
"a" and "g" becomes pair.
Otherwise if the "g" is already pair with man "a'" then
If the g prefers more the "a'" from the "a" then
the "a" remains free.
Otherwise the g abandons the "a' " and becomes pair with the "a".
the "a" is henceforth free.
End If
End If
End While.




into the code..
i found some hints over the net, and i add code of mine.
Punkis
 
Posts: 10
Joined: Fri Apr 18, 2008 6:32 am

Postby Punkis » Sat Apr 26, 2008 8:43 am

...:)
Punkis
 
Posts: 10
Joined: Fri Apr 18, 2008 6:32 am

Postby Punkis » Tue Apr 29, 2008 6:49 pm

anyone?
Punkis
 
Posts: 10
Joined: Fri Apr 18, 2008 6:32 am

Postby Alvaro » Tue Apr 29, 2008 7:04 pm

I see no clear question in your last post. You just stated what your task is. Did you do it already?
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Previous

Return to Algorithms & Data Structures

Who is online

Users browsing this forum: No registered users and 0 guests