Draw your graph:

q = graph.getEdges().sortAscending()
mst = []
while(mst < graph.numVertices()-1)
  next = q.popFirst()
  if(!formsCycle(mst, next))
    mst.push(next)
SHORT EXPLANATION
---------------------
1. Sort all edges by weight (non-decreasing).
2. Pick the edge with the smallest weight.
3. Check if adding that edge to the MST forms a cycle. If it doesn't, add it.
4. Repeat steps 2 and 3 until MST has a lenght of (number of Vertices - 1).

To draw a new vertex, simply click anywhere on the canvas above.
To create an edge between two vertices, click on the first vertex and then on the second one.
You can create a random graph by clicking on the 'Random' button above the canvas.
To clear the canvas, use the 'Clear' button.
Speed:
Slow   Fast