Skip to content
START WITH A QUESTION

What would you like to understand?

Find an answer. See the moment it becomes clear. Follow the idea further.

← Concept directory

Answers for “Prim 算法中的贪心选择规则是什么?”

1 keyword matches

Understanding your question. You can explore the search results below now.

Find a method

↗

To start Prim's algorithm, create an empty list called 'visited' to track touched nodes, then pick an arbitrary starting node and add it to the visited list.

Conditions: The graph is weighted and connected.; You have a mechanism to track visited vertices (e.g., a list or set).