Skip to main content
GameDev.net gamedev.net
🔒 Locked

Correlating between Cluster and Points

Started by Ahmed Saleh Mohamed Sep 17, 2012 at 9:34 PM 2 replies 1k views
Original Post
Ahmed Saleh Mohamed
Ahmed Saleh Mohamed
I'm clustering a set of points using DBScan algorithm. I have a set of IDs for a set of points and I have a set of clusters, where each cluster has a set of points. I would like to correlate between the clusters and the points ID.

For example I have a set of ids { 1,2,3,4}, Now if I have two cluster and two clusters has two points, then those two points of the first cluster should have the ids 1,2 and for the second one 3,4. Also If I have 4 clusters and each cluster has one point, then the Ids of the points should be 1,2,3, and 4. Furthermore, If I have two clusters but one cluster has 3 points and the other one has one point, then the Ids of the points should be 1,2,3 for the first cluster's points and for the second cluster's point is 4.

I tried to code it, but I'm stopped at calculating the formula to achieve that scenario.

std::vector_IDs;
// for each cluster
for( int j = 0; j {
// for each point in that cluster
for ( int i=0; i < clusters[j].m_Points.size(); i++)
{
// assign its ID from the _IDs array based and save it in Clusters Vector
clusters[j].m_IDs.push_back(_IDs[j+ i*clusters[j].m_Points.size()]);

}
}
Cornstalks
Cornstalks

I'm clustering a set of points using DBScan algorithm. I have a set of IDs for a set of points and I have a set of clusters, where each cluster has a set of points. I would like to correlate between the clusters and the points ID.

Can you clarify exactly what you mean by "correlate between the clusters and the points ID?" I'm not quite understanding.


For example I have a set of ids { 1,2,3,4}, Now if I have two cluster and two clusters has two points, then those two points of the first cluster should have the ids 1,2 and for the second one 3,4. Also If I have 4 clusters and each cluster has one point, then the Ids of the points should be 1,2,3, and 4. Furthermore, If I have two clusters but one cluster has 3 points and the other one has one point, then the Ids of the points should be 1,2,3 for the first cluster's points and for the second cluster's point is 4.

You lost me here (starting right after the list of IDs). So many clusters and IDs... could you create an image or clear, well formatted example or something that would clarify this? It'd help everyone to know how to help you out.
jefferytitan
jefferytitan
Agreed. I'm unclear what the clustering criteria are. The IDs, 2D co-ordinates, 3D co-ordinates, other? Are the clusters known ahead of time, or are you trying to dynamically create clusters from the points?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.