Added Prim's algorithm for MST and tests.
Optimised memory usage and tests for mst_prim