import java.io.*;
import java.util.*;
import java.lang.*;

//To Start, read edges only
class ReadClusterList 
{



 public static void main(String args[])
  {
 
  }

public Map getClusterMap(String filelocation)
 {
Map ClusterMap = new HashMap();
 try
	{
//System.out.println("Running Method");
  	// Open the file 
  	FileInputStream fstream = new FileInputStream(filelocation);
  	// Get the object of DataInputStream
  	DataInputStream in = new DataInputStream(fstream);
  	BufferedReader br = new BufferedReader(new InputStreamReader(in));
  	String line = br.readLine();
  	//Read File Line By Line, add each line to our map
		

  	while (line != null)   
		{//This part involves separating out node and cluster, then adding each to Map
//System.out.println("Read line:" + line);
		//separate node from edge
		String[] temporaryline = line.split("V");//get ride of V at end of line
		String actualline = temporaryline[1];//take just the line, not the vertex market

		String[] tokens = actualline.split(" "); //split line (based on space delimination)

		String nodeID = tokens[0];//get nodeID (string form)
//System.out.println("Found node:" + nodeID);
		Integer node = Integer.valueOf(nodeID);//convert nodeID to int

		String clusterID = tokens[1];//get cluster (string form)
//System.out.println("Found cluster:" + clusterID);
		Integer cluster = Integer.valueOf(clusterID);//convert cluster to int
		

		//place pair in Map (key = nodeID, value = cluster)
		ClusterMap.put(node, cluster);

		line=br.readLine(); //get next line
  		}
  	//Close the input stream
  	in.close();
	
    	}

	catch (Exception e)
	{//Catch exception if any
  	System.err.println("Error: " + e.getMessage());
  	}
//System.out.println("Got ClusterMap");
return ClusterMap;
 }
}