01.07.2013 Views

9. Anexos.

9. Anexos.

9. Anexos.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Dim TiempoSol As Single<br />

Dim IteracionSol As Integer<br />

Dim Origen As Integer<br />

Dim ProfundidadSol As Integer<br />

Origen = 1<br />

TiempoSim = Timer<br />

Solucion = Vector<br />

VectorRecal = Vector<br />

Calcular_MST Solucion()<br />

Calcular_Pesos Solucion(), VectorRecal(), CosteActual<br />

PrimeraSolucion Solucion(), Problema<br />

Iteracion = 0<br />

ReDim CosteSolucion(1)<br />

CosteSolucion(1) = CosteActual<br />

TiempoSol = Timer - TiempoSim<br />

ProfundidadSol = 1<br />

While CosteOptimo < CosteActual And Iteracion < 35 And ProfundidadSol < 10<br />

Iteracion = Iteracion + 1<br />

Hallar_CamMin_Dijkstra VectorRecal(), NumeroNodos, NodosOrigen(), Solucion(), Origen<br />

Depura_MST Solucion()<br />

Calcular_Pesos Solucion(), VectorRecal(), CosteActual<br />

ReDim Preserve CosteSolucion(UBound(CosteSolucion) + 1)<br />

If Iteracion = 1 Then<br />

TiempoSol = Timer - TiempoSim<br />

IteracionSol = 1<br />

ElseIf CosteActual CosteSolucion(Iteracion - 1) Then<br />

TiempoSol = Timer - TiempoSim<br />

IteracionSol = Iteracion<br />

End If<br />

CosteSolucion(UBound(CosteSolucion)) = CosteActual<br />

If CosteSolucion(UBound(CosteSolucion)) = CosteSolucion(UBound(CosteSolucion) - 1) Then<br />

ProfundidadSol = ProfundidadSol + 1<br />

Else<br />

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

27

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

Saved successfully!

Ooh no, something went wrong!