10.05.2013 Views

El “problema de los matrimonios estables”

El “problema de los matrimonios estables”

El “problema de los matrimonios estables”

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

{OJO: SE USAN VARIABLES GLOBALES}<br />

algoritmo escribir_solución<br />

variables h:hombre; rh,rm:entero<br />

principio<br />

rh:=0; rm:=0;<br />

para h:=1 hasta n hacer<br />

escribir(x[h]);<br />

rh:=rh+rhm[h,x[h]];<br />

rm:=rm+rmh[x[h],h]<br />

fpara;<br />

escribir(rh,rm)<br />

fin<br />

Nota:<br />

rh<br />

=<br />

n<br />

∑ rhm<br />

h=<br />

1<br />

[ h,<br />

x[<br />

h ] rm rmh[<br />

x[<br />

h]<br />

, h]<br />

= ∑<br />

=<br />

n<br />

h 1<br />

la solución con mínimo valor <strong>de</strong> rh se llama “solución<br />

masculina estable óptima” y<br />

la <strong>de</strong> mínimo rm es la “óptima estable femenina”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!