public static double[] bfs(double[][] mst, int startIndex)
	{
		double[] dist = new double[mst.length];
		
		if(startIndex < mst.length);
		{
		
			for(int i=0; i<dist.length; i++)
			{
				dist[i] = Integer.MAX_VALUE;
			}
		
			dist[startIndex] = 0;
		
			LinkedList<Integer> q = new LinkedList<Integer>();
			q.add(startIndex);
		
			while(q.size()!=0)
			{
//				System.out.println("Entered while");
			
				int u = q.removeLast();
			
				//For all edges (u,v) in E
				for(int v = 0; v < u; v++)
				{
//					System.out.println("Entered for");
//					System.out.println("mst[u][v]: "+mst[u][v]);
					if(mst[u][v] > 0)
					{
//						System.out.println("Entered first if");
						if(dist[v] == Integer.MAX_VALUE)
						{
							q.addFirst(v);
							dist[v] = dist[u] + 1;
//							System.out.println(v+": "+dist[v]);
						}
					}
				}
			
				for(int v = u+1; v < mst.length; v++)
				{
					if(mst[v][u] > 0)
					{
						if(dist[v] == Integer.MAX_VALUE)
						{
							q.addFirst(v);
							dist[v] = dist[u] + 1;
						}
					}
				}
			}
		}
		return dist;
	}