public static LinkedList<Integer> shareLocationCount() {
		long t_start = System.currentTimeMillis();
		System.out.println("shareLocationCount starts ...");
		HashMap<Integer, User> users = User.allUserSet;
		int cnt = 0;
		
		// get the first level iterator
		Object[] array = users.values().toArray();
		for (int i = 0; i < array.length; i++) {
			cnt ++;
			User ui = (User) array[i];

			// get the second level iterator
			if (ui.friends.size() > 0) {
				for (int j : ui.friends) {
					if (! users.containsKey(j)) {
						System.out.println(String.format("Error: friend ID %d does not exist!", j));
					} else {
						User uj = users.get(j);
						
						HashSet<String> ui_loc = ui.getLocations();
						HashSet<String> uj_loc = uj.getLocations();
						// get intersection of two sets
						HashSet<String> colocations = new HashSet<String>(ui_loc);
						colocations.retainAll(uj_loc);
						numOfColocations.add(colocations.size());
						
						// record the pair that share more than 1 common locations
						if (colocations.size() >= 1) {
							int[] p = new int[3];
							p[0] = ui.userID;
							p[1] = uj.userID;
							p[2] = colocations.size();
							FrequentPair.add(p);
							FrequentPair_CoLocations.add(colocations);
						}
					}	
				}
			}
			
			// monitor the process
			if (cnt % (users.size()/10) == 0)
				System.out.println(String.format("Process - shareLocationCount finished %d0%%", cnt/(users.size()/10)));
		}
		// output
		try {
			BufferedWriter fout = new BufferedWriter(new FileWriter("res/colocation-cnt.txt"));
			BufferedWriter foutpair = new BufferedWriter(new FileWriter("res/pair-meetcnt.txt"));
		
			for (int i : numOfColocations) {
				fout.write(Integer.toString(i) + "\n");
			}
			
			for (int[] j : FrequentPair) {
				foutpair.write(Integer.toString(j[0]) + " " + Integer.toString(j[1]) + " "
						+ Integer.toString(j[2]) + "\n" );
			}
			fout.close();
			foutpair.close();
			} catch (IOException e) {
				e.printStackTrace();
		}
		long t_end = System.currentTimeMillis();
		System.out.println(String.format("Finish shareLocationCount in %d seconds", (t_end - t_start)/1000));
		return numOfColocations;
	}