01.07.2013 Views

9. Anexos.

9. Anexos.

9. Anexos.

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.

ProfundidadSol = 1<br />

End If<br />

Wend<br />

TiempoSim = Timer - TiempoSim<br />

Anadir_Resul_Informe Problema, TiempoSim, IndiceFila, TiempoSol, IteracionSol, CosteSolucion<br />

End Sub<br />

<strong>9.</strong>2.2.2. La primera solución.<br />

Módulo: Kruskal_MST.bas<br />

Option Explicit<br />

Option Base 1<br />

Dim Conj_Mst() As Reg_Conj<br />

Dim ContaConj As Long<br />

Dim Tamano As Long<br />

Public Sub Calcular_MST(ByRef Entrada() As Reg_Arcos)<br />

Dim i As Long<br />

Dim SolucionMST() As Reg_Arcos<br />

Tamano = 0<br />

ReDim SolucionMST(1)<br />

QuickSort Entrada, 1, UBound(Entrada)<br />

Cargar_Arco_Kruskal 1, Entrada(), SolucionMST()<br />

ContaConj = 1<br />

ReDim Conj_Mst(2)<br />

i = 1<br />

Conj_Mst(i).Nodo = Entrada(1).Origen<br />

Conj_Mst(i).Conjunto = ContaConj<br />

i = 2<br />

Conj_Mst(2).Nodo = Entrada(1).Destino<br />

Conj_Mst(2).Conjunto = ContaConj<br />

<strong>Anexos</strong>.<br />

28

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

Saved successfully!

Ooh no, something went wrong!