The AMPL statements that you show do not have any obvious errors. Can you be more specific about the problems you are having? It would help to give an example of the AMPL statements you tried to write, and an explanation of why they did not work. Also give the complete text of any error messages, and data if needed to run the example.
From:
am...@googlegroups.com [mailto:
am...@googlegroups.com] On Behalf Of
sahebe...@gmail.com
Sent: Wednesday, April 26, 2017 5:29 AM
To: AMPL Modeling Language
Subject: [AMPL 13932] Clustering
I must use Kmeans clustering algorithm in part of my project. As you may know, in this algorithm, based on the number of clusters we are going to create, we make random cluster head in the network. In the first stage, we measure up the distance between the sensor points and these cluster heads so that those sensors which are located in a shorter distance of there cluster heads are placed in one cluster. In the second stage, the average of sensor points of each cluster are calculated and through this point being determined, the cluster head in each cluster is changed to the point . Now, the first and the second stage are repeated as many times as the new clusters center equals with the old clusters center, the previous stage, and this needs using a while circle.
I have done the calculations in the first round. however, I have some problems using the while circle. please help me.