public HashMap<Integer, Double> computeMatrixEigenVector(HashMap<Integer, HashMap<Integer, Double>> matrix, int maxIterator)
	{
		HashMap<Integer, Double> result = new HashMap<Integer, Double>();
		//init
		Iterator<Integer> it = matrix.keySet().iterator();
		while(it.hasNext())
		{	
			int key = it.next();
			result.put(key, 1.0);
		}
		
		for(int i = 0 ; i < maxIterator; i++)
		{
			double diff = 0;
			// calculate the matrix-by-vector product Ab
			HashMap<Integer, Double> newResult = new HashMap<Integer, Double>();
			Iterator<Integer> it2 = matrix.keySet().iterator();
			while(it2.hasNext())
			{
				double rowSum = 0;
				int key2 = it2.next();
				HashMap<Integer, Double> map = matrix.get(key2);
				Iterator<Integer> it3 = map.keySet().iterator();
				while(it3.hasNext())
				{
					int key3 = it3.next();
					rowSum += map.get(key3).doubleValue()*result.get(key3);
				}
				newResult.put(key2, rowSum);
			}
			// calculate the length of the resultant vector
			double norm=0;
			Iterator<Integer> it4 = newResult.keySet().iterator();
			while(it4.hasNext())
			{
				norm += newResult.get(it4.next());
			}
			Iterator<Integer> it5 = newResult.keySet().iterator();
			while(it5.hasNext())
			{
				int it5_key = it5.next();
				newResult.put(it5_key,  newResult.get(it5_key)/norm);
			}		
			//diff
			Iterator<Integer> it6 = result.keySet().iterator();
			while(it6.hasNext())
			{
				int key6 = it6.next();
				diff += absDiff(result.get(key6), newResult.get(key6));
			}
		
			System.out.println("diff:"+diff);
			if(diff < 0.01)
			{
				System.out.println("computeMatrixEigenVector method finished: diff="+diff+ "after iterator :" + i);
				return newResult;
			}else
			{
				result.clear();
				result = newResult;
			}
		}
		System.gc();
		return result;
	}