Find the Minimum Spanning Tree in a Graph Program in Java