グラフアルゎリズムIntermediate

プリム法

開始頂点から朚を成長させるこずで最小党域朚MSTを芋぀けたす。垞に朚の頂点ず倖郚の頂点を接続する最小重み蟺を远加したす。効率的な蟺遞択に優先床付きキュヌを䜿甚したす。密なグラフに理想的です。

#graph#mst#greedy#priority-queue

Complexity Analysis

Time (Average)

O(E log V)

Expected case performance

Space

O(V)

Memory requirements

Time (Best)

O(E log V)

Best case performance

Time (Worst)

O(E log V)

Worst case performance

📚 CLRS Reference

Introduction to Algorithms•Chapter 23•Section 23.2

Presets:
Step: 1 / 0
500ms
SlowFast
Keyboard Shortcuts
Space Play/Pause← → StepR Reset1-4 Speed

Real-time Statistics

Algorithm Performance Metrics

Progress0%
Comparisons
0
Swaps
0
Array Accesses
0
Steps
1/ 0

Algorithm Visualization

Step 1 of 0

Initialize array to begin

Default
Comparing
Swapped
Sorted

Code Execution

Currently executing
Previously executed

Implementation

Prim's Algorithm - Algorithm Vision | Algorithm Vision