Sign in to follow this  
Ahmed Saleh Mohamed

Correlating between Cluster and Points

Recommended Posts

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<int>_IDs;
// for each cluster
for( int j = 0; j<clusters.size();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()]);

}
} Edited by Ahmed Saleh Mohamed

Share this post


Link to post
Share on other sites
[quote name='Ahmed Saleh Mohamed' timestamp='1347917660' post='4981033']
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.
[/quote]
Can you clarify exactly what you mean by "correlate between the clusters and the points ID?" I'm not quite understanding.

[quote name='Ahmed Saleh Mohamed' timestamp='1347917660' post='4981033']
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.
[/quote]
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this