Kruskal Algorithm
by Nickolas Cheilakos
20 Dec 2006
Kruskal's algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connect
|
Watch this File
|
| File Information |
| Description |
Kruskal's algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected un directed weighted graph
The zip file contains
kruskal.m iscycle.m fysalida.m connected.m
If we want to find the minimum spanning tree. We call function kruskal.
% Input: PV = nx3 martix. 1st and 2nd row's define the edge (2 vertices) and
% the 3rd is the edge's weight
% Output: w = Minimum spanning tree's weight
% T = Minimum spanning tree's adjacency matrix
example :
>>PV = PV = [ 1 2 5;1 3 8;1 5 10;2 3 10;3 4 4;3 5 7;4 5 6];
>>[w T] = kruskal(PV)
w =
23
T =
0 1 1 0 0
1 0 0 0 0
1 0 0 1 0
0 0 1 0 1
0 0 0 1 0 |
| MATLAB release |
MATLAB 6.5 (R13)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (12) |
| 21 Dec 2006 |
Nick Cheilakos
|
|
|
| 29 Jan 2007 |
Anima Kumar
|
|
|
| 08 Feb 2007 |
John Litmaier
|
|
|
| 18 Feb 2007 |
Greg Mardis
|
|
|
| 25 Apr 2007 |
Guillaume Bouchard
|
|
|
| 29 Sep 2007 |
Jonathan Primof
|
|
|
| 11 May 2008 |
kadri mourad
|
|
|
| 31 May 2008 |
Lai Wei
|
|
|
| 15 Oct 2008 |
kheroua mohalled reda
|
|
|
| 15 Oct 2008 |
kheroua mohammed reda
|
|
|
| 23 Dec 2008 |
Billal merabti
|
|
|
| 26 Jun 2011 |
Rosiana Prabandari
|
|
|
|
Contact us at files@mathworks.com