import java.applet.Applet; import java.awt.event.*; import java.awt.*; import java.util.Arrays; public class SpanningTree { int SIZE; int GROUPS; int EDGE_COUNT,ROOT; int[][] EDGE=new int[100][2]; //list of edges in the tree int[] G=new int[100]; //list or groups int[][] P=new int[100][2]; //predecessors: (dist from root, neighbor nearer to root) double[] X=new double[10000]; //for sorting purposes double[][] WEIGHT=new double[100][100]; //list of graph weights int[] VALENCE=new int[100]; public SpanningTree() {} /**fixing lists*/ public static int[] trim(int[] list1,int count) { int[] list2=new int[count]; for(int i=0;imark) --G[k]; } --GROUPS; assignEdge(i,j); return(true); } //joins group i to group j if((G[i]!=-1)&&(G[j]!=-1)&&(G[j]mark) --G[k]; } --GROUPS; assignEdge(i,j); return(true); } return(false); } public void computeValences() { for(int i=0;i