module1.bas

来自「vb实现最短路径Dijkstra算法」· BAS 代码 · 共 61 行

BAS
61
字号
Attribute VB_Name = "Module1"
'  ==========================================
'  Dijkstra's algorithm to find Shortest Path
'  ==========================================
'
' E.W. Dijkstra is a Dutch professor in Computer
' Science, who did a lot of research in graphs.
'
' Dijkstra's algorithm is of use when working with
' directional graphs. It constructs the shortest path
' between a starting-node and a goal-node.
' It is assumed that every link between two nodes
' has a certain cost, and this algorithm finds the
' path between the two given nodes with the lowest cost.
'
' The idea of this VB project was to show the
' work of this algorithm in a visual way.
'
'    Screen-shot: dijkstra.gif
'
'
'    Visit my Homepage:
'    http://www.geocities.com/emu8086/vb/
'
'
'    Last Update: Saturday, July 20, 2002
'
'
'    Copyright 2002 Alexander Popov Emulation Soft.
'               All rights reserved.
'        http://www.geocities.com/emu8086/


Option Explicit

Public MAX_SHAPE As Integer
Public MAX_LINE As Integer
Public SELECTED_SHAPE As Integer
Public PREV_SELECTED_SHAPE As Integer
Public DRAGGED_SHAPE As Integer

Public Const SW_SHOWDEFAULT = 10

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

' 020720
Function Add_BackSlash(sPath As String) As String
  
    If (sPath <> "") Then
        If (Mid(sPath, Len(sPath), 1) <> "\") Then
          Add_BackSlash = sPath & "\"
          Exit Function
        End If
    End If
 
 
    Add_BackSlash = sPath
  
End Function

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?