Loop
Call plotroutin '画出查询到的最短路径
MsgBox ("查询完毕!")
End Sub
Public Function isallyjdb() As Boolean
'判断是否所有节点都获得永久标号
Dim tempisallyjdb As Boolean
tempisallyjdb = True
For i = 1 To nNode
If yjdb(i) = False Then
tempisallyjdb = False
Exit For
End If
Next i
isallyjdb = tempisallyjdb
End Function
Public Function minnode()
'寻找具有最小临时标号的节点
Dim mindist As Double, minnodeno As Integer, i As Integer
mindist = 1E+38
For i = 1 To nNode
If yjdb(i) = False Then
If distvector(i) < mindist Then
mindist = distvector(i)
minnodeno = i
End If
End If
Next i
oldtempstartno = tempstartno
tempstartno = minnodeno
distvector(tempstartno) = mindist
'新获得永久标号的节点
yjdb(tempstartno) = True
End Function
Public Function gbdb()
'更新与刚获得永久标号节点相连的 '各节点的临时标号
|