If (NoNode(k) =
LineNode(2, j)) Then
temp = k
Exit For
End If
Next k
flagMatrix(i, temp) = True
'无向图,对称矩阵
flagMatrix(temp, i) = True
ElseIf (NoNode(i) = LineNode(2, j)) Then
For q = 1 To nNode
If (NoNode(q) =
LineNode(1, j)) Then
temp = q
Exit For
End If
Next q
flagMatrix(i, temp) = True
flagMatrix(temp, i) = True
End If
Next j
Next i
maxlen = 1E+38 'distmatrix邻接距离矩阵
For i = 1 To nNode
For j = 1 To nNode
If flagMatrix(i, j) = True Then
distmatrix(i, j) = 111.199 *
Sqr((LatNode(i) - LatNode(j)) ^ 2 +
((LonNode(i) - LonNode(j)) * Cos((LatNode(i) + LatNode(j)) * 0.00872665)) ^ 2)
Else '节点不邻接
distmatrix(i, j) = maxlen
End If
Next j
Next i
End Sub
Private Sub selectstartendnode_Click()
|