flowchart TD
A[Init distances INF] --> B[Push start to min heap]
B --> C{Heap empty}
C -- No --> D[Pop shortest node]
D --> E{Stale distance}
E -- Yes --> C
E -- No --> F[Relax outgoing edges]
F --> G{Better distance found}
G -- Yes --> H[Update dist and push heap]
G -- No --> I[Skip]
H --> C
I --> C
C -- Yes --> J[Return distance table]
sequenceDiagram
participant H as MinHeap
participant D as DistTable
participant G as Graph
H->>H: pop min node
H->>G: neighbors node
G-->>H: neighbor weight
H->>D: compare and relax
D-->>H: updated dist
H->>H: push updated node