public SocialGraph CreateDG(String sFileName, List<User> userList) {
		// return social graph
		SocialGraph sg = new SocialGraph();

		// get social information between users
		List<String> infoList = ReadFileUtil.ReadFileByLine(sFileName);

		// key is one user id, value is a list of all his directly connected user id
		Map<Integer, List<Integer>> socialMap = new HashMap<Integer, List<Integer>>();
		List<Integer> socialList;

		ArcNode p;
		int arcNum = 0;
		int i = 0, j = 0;
		int size = infoList.size();
		int uData;
		StringTokenizer st;

		// process social list and save in socialMap
		for (i = 0; i < size; i++) {
			// remove blank lines
			if (!infoList.get(i).equals("")) {
				socialList = new ArrayList<Integer>();
				// split data by "\t"
				st = new StringTokenizer(infoList.get(i), "\t");

				if (st.countTokens() == 2) {
					// one user id
					uData = Integer.parseInt(st.nextToken());

					// a list of all his directly connected user id
					socialList.add(Integer.parseInt(st.nextToken(",").trim()));
					while (st.hasMoreElements()) {
						socialList.add(Integer.parseInt(st.nextToken()));
					}
					
					socialMap.put(uData, socialList);
				}
				
				// free memory space
				socialList = null;
			}
		}

		sg.vexNum = userList.size();
		sg.vextices = new VertexNode[sg.vexNum];

		int uSize = userList.size();

		// initialize vextices
		for (i = 0; i < uSize; i++) {
			sg.vextices[i] = new VertexNode();
			sg.vextices[i].vexId = userList.get(i).userId;
			sg.vextices[i].vexData = userList.get(i).userData;
			sg.vextices[i].firstarc = new ArcNode();
			sg.vextices[i].firstarc = null;
		}

		// create adjacency list
		List<Integer> toList = new ArrayList<Integer>();
		int toSize;
		
		for (int from : socialMap.keySet()) {
			toList = socialMap.get(from);
			toSize = toList.size();
			j = UserBase.GetIdByUserData(userList, from);
			if(j == -1) {
				System.out.println(from + " has no id.");
				return null;
			}

			// linked list operations
			for (i = 0; i < toSize; i++) {
				p = new ArcNode();
				p.adjvex = UserBase.GetIdByUserData(userList, toList.get(i));
				if(p.adjvex == -1) {
					System.out.println("from = " + from + " and " + toList.get(i) + " has no id.");
					return null;
				}
				p.nextarc = sg.vextices[j].firstarc;
				sg.vextices[j].firstarc = p;
				arcNum++;
			}
		}

		sg.arcNum = arcNum;

		// free memory space
		infoList = null;
		socialList = null;
		socialMap = null;
		userList = null;
		toList = null;
		p = null;

		return sg;
	}