Minimum spanning tree for a weighted square grid

1.2k Views Asked by At

I have a particular grid with weighted edges connecting each vertex:

grid

From this I'm looking for an easy method to obtain a Minimum Spanning Tree.

I can easily check columns or rows and remove all but the lowest weight, but this will only provide me with a regular spanning tree instead of the desired MST. Columns, for example:

columns

I do know I can use the various classic algorithms such as Kruskal's, Prim's, or Boruvka's, but I'm wondering if there's an easier method for grids specifically since it was easy enough to get a regular tree (and if the easiest method happens to be one of the classic algorithms, which might be the best suited for grids).