private static List<List<Livraison>> kmeans(List<Livraison> livraisons, int k)
	{
		List<List<Livraison>> clusters = new ArrayList<List<Livraison>>();
		for(int i = 0 ; i < k ; i++)
		{
			clusters.add(new ArrayList<Livraison>());
		}
		List<Double> centroidX = new ArrayList<Double>();
		List<Double> centroidY = new ArrayList<Double>();
		Double eps = Double.POSITIVE_INFINITY;
		
		List<Livraison> tempLiv = new ArrayList<Livraison>(livraisons);
		
		for(int i = 0 ; i < k ; i++) 
		{
			int index = (int)(Math.random()*tempLiv.size());
			Livraison l = tempLiv.get(index);
			centroidX.add((double)l.getAdresse().getX());
			centroidY.add((double)l.getAdresse().getY());
			tempLiv.remove(index);
		}
		
		while(eps > 1.0)
		{
			for(int i = 0 ; i < k ; i++)
			{
				clusters.get(i).clear();
			}
			Double delta = 0.0;
			//Clusters
			for(Livraison l : livraisons)
			{
				Double lowestDistance = Double.POSITIVE_INFINITY;
				int closestCentroid = -1;
				for(int i = 0 ; i < k ; i++)
				{
					Double x = l.getAdresse().getX() - centroidX.get(i);
					Double y = l.getAdresse().getY() - centroidY.get(i);
					Double distance = Math.sqrt(x*x + y*y);
					if(distance < lowestDistance)
					{
						lowestDistance = distance;
						closestCentroid = i;
					}
				}
				clusters.get(closestCentroid).add(l);
			}
			//Recompute centroid
			for(int i = 0 ; i < k ; i++)
			{
				Double averageX = 0.0;
				Double averageY = 0.0;
				for(Livraison l : clusters.get(i))
				{
					averageX += l.getAdresse().getX();
					averageY += l.getAdresse().getY();
				}
				averageX /= clusters.get(i).size();
				averageY /= clusters.get(i).size();
				
				delta += averageX-centroidX.get(i) + averageY-centroidY.get(i);
				
				centroidX.set(i, averageX);
				centroidY.set(i,averageY);
			}
			eps = delta;
		}
		
		return clusters;
	}