public static void main(String[] args) {
		// TODO Auto-generated method stub
		int i, j, k, min, temp;
		int b = (int)Math.pow(2, n-1);
		
		//ʼD
		init();
		
		int[][] F = new int[n][b];  //Ž׶ֵ
		int[][] M = new int[n][b];	//Ų
		
		//ʼF[][] M[][]
		for(i = 0; i < n; i++)
			for(j = 0; j < n; j++) {
				F[j][i] = -1;
				M[j][i] = -1;
			}
		
		//Fĵ0иֵ
		for(i = 0; i < n; i++)
			F[i][0] = D[i][0];
		
		//
		for(i = 1; i < b - 1; i++)
			for(j = 1; j < n; j++) {
				if(((int)Math.pow(2, j - 1) & i) == 0) {
					min = 65535;
					for(k = 1; k < n; k++)
						if(((int)Math.pow(2, k-1) & i) != 0)  {
							temp = D[j][k] + F[k][i-(int)Math.pow(2, k-1)];
							if(temp < min) {
								min = temp;
								F[j][i] = min;
								M[j][i] = k;
							}
							
						}
				}
			}
		
		
		//һУֵļ  
	    min=65535;  
	    for(k=1;k<n;k++)  
	    {  
	        //b-1Ķȫ1ʾ{1,2,3,4,5}ȥk㼴kӦĶλ0  
	        temp = D[0][k] + F[k][b-1 - (int)Math.pow(2,k-1)];  
	        if(temp < min)  
	        {  
	            min = temp;  
	            F[0][b-1] = min;//Ž  
	            M[0][b-1] = k;  
	        }  
	    }  
	    
	    System.out.println("·Ϊ"+ F[0][b-1]);
	    
	    
	  //ݲM·(0~n-1)  
	    System.out.println("·");  
	    for(i=b-1,j=0; i>0; )//iĶ51ʾ{1,2,3,4,5}  
	    {  
	        j = M[j][i];//һȥĸ  
	        i = i - (int)Math.pow(2,j-1);//iȥj  
	        System.out.println("->" + j);  
	    }  
	    
	    System.out.println("->0");
	}