Wolfram Function Repository (Under Development)
Instant-use add-on functions for the Wolfram Language
Find the minimal spanning tree for a given set of edges.
ResourceFunction["KruskalAlgorithm"][edges] finds the minimal spanning tree for a graph given by edges. |
|
ResourceFunction["KruskalAlgorithm"][edges,"Graph"] finds the minimal spanning tree and shows the graph. |
Return a minimal spanning tree for a given set of points:
In[1]:= |
![]() |
In[2]:= |
![]() |
Out[2]= |
![]() |
If “Graph” is specified, show the Graph:
In[3]:= |
![]() |
Out[3]= |
![]() |
The minimal spanning tree is not necessarily unique:
In[4]:= |
![]() |
Out[4]= |
![]() |
In[5]:= |
![]() |
Out[5]= |
![]() |
In[6]:= |
![]() |
Out[6]= |
![]() |