public static void M(Topic root) {
		
		ArrayList<SparseMatrix> edges = root.Get_edgeset();
		
		float[][] eijk = root.clone2df(root.Get_edgeweight());
		int ii = eijk.length; // number of edges
		int jj = eijk[0].length; // number of topics
		
		//float[] rho_z_M = root.clone1df(root.Get_rho_z());
		float[] rho_z_M = new float[eijk[0].length];
		Arrays.fill(rho_z_M, 0);
		
		for(int j = 0; j< jj; j++){
			for(int i = 0; i< ii; i ++){
				rho_z_M[j] = rho_z_M[j] + eijk[i][j];
			}
		}
		
		root.Set_rho_zM(rho_z_M);
		
		/**
		 * Setting the thetai values for each word across topics
		 */
		float[][] sumthetai = new float[root.Get_thetai().length][root.Get_thetai()[0].length];
		
		for(int i = 0; i< sumthetai[0].length; i++){
			Arrays.fill(sumthetai[i], 0);
		}
		
		Iterator<SparseMatrix> it = edges.iterator();
		int ew = 0;
		while (it.hasNext()) {
			SparseMatrix current = it.next();
			for (int t = 0; t < sumthetai[0].length; t++) {
				sumthetai[current.getwordid1() - 1][t] = sumthetai[current.getwordid1() - 1][t] + eijk[ew][t];
				sumthetai[current.getwordid2() - 1][t] = sumthetai[current.getwordid2() - 1][t] + eijk[ew][t];
			}
			ew++;
		}
		
		float[][] thetai = new float[sumthetai.length][sumthetai[0].length];
		for (int i = 0; i < sumthetai.length; i++) {
			for (int j = 0; j < sumthetai[0].length; j++) {
				thetai[i][j] = sumthetai[i][j] / rho_z_M[j];
			}
		}
		

	}