15.11.2013 Views

Esqueleto Algorítmico - ulpgc

Esqueleto Algorítmico - ulpgc

Esqueleto Algorítmico - ulpgc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Implementación Secuencial y Paralela de Técnicas Algorítmicas:<br />

Aplicación a Problemas de Optimización Combinatoria<br />

Seminario Invitado: Dpto Métodos Cuantitativos en Economía y Gestión<br />

Introducción<br />

Interfaz de<br />

Usuario<br />

Patrones<br />

Secuenciales<br />

Patrones Paralelos<br />

Experimentos<br />

Computacionales<br />

Conclusiones<br />

Ejemplo: EL Problema de la Mochila 0/1<br />

void SubProblem::initSubproblem (const Problem& pbm)<br />

{<br />

Crest = pbm.C;<br />

obj = 0;<br />

profit = 0;<br />

}<br />

Interfaz de Usuario<br />

de MaLLBa<br />

Interfaz Ramificación<br />

y Acotación<br />

Interfaz Divide y<br />

Vencerás<br />

Clases<br />

Proporcionadas<br />

Mª Isabel Dorta González<br />

Marzo, 2007<br />

void SubProblem::branch (const Problem& pbm,<br />

container& subpbms)<br />

{<br />

SubProblem spNO = SubProblem(CRest,obj+1,profit);<br />

subpbms.insert(spNO);<br />

Number newC = CRest - pbm.w[obj];<br />

if (newC >= 0) {<br />

SubProblem spYES = SubProblem (newC, obj+1, profit +<br />

pbm.p[obj]);<br />

subpbms.insert(spYES);<br />

}<br />

}

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

Saved successfully!

Ooh no, something went wrong!