In the model I am currently developing is a graph/network based model and the diameter is required. Is it possible for the diameter to be calculated? The diameter will be found using links. For example a line graph of 5 nodes would have a diameter of 4, this becomes more complex with random graph's.
This is a qoute of the diamter:
The shortest distance between the two most distant nodes in the
network. In other words, once the shortest path length from every node
to all other nodes is calculated, the diameter is the longest of all
the calculated path lengths.
I have tried to design this but unable to implement this. Any advice or examples would be appreciated.
Have a look at the networks extension for NetLogo (see http://ccl.northwestern.edu/netlogo/docs/nw.html). Unfortunately, it doesn't have the diameter as one of the built-in functions, but you can calculate the distances between each pair of nodes and take the maximum.
Related
I have a greyscale image, represented by a histogram below (x and y axes are pixels, z axis is pixel intensity).
Each cluster of bars represents an object, with the local maxima fairly approximating the centroid of the object. My goal is to find the Full Width Half Max of each object – so I'm roughly approximating each object as a Gaussian distribution.
How can I detect each cluster individually? I understand how to mathematically calculate the FWHM, but I'm not sure how to detect each cluster based on its (roughly) Gaussian features. (e.g., in the example below I would want to detect 6 clusters. One can see a small cluster in the middle but its amplitude is so small that I am okay with missing it).
I appreciate any advice - and efficiency is not a major issue, so I can implement relatively expensive solutions.
To find the centers of each of these groupings you could use a type of A* search algorithm, or similar linear optimization algorithm.
It will find its way to the maxima of a grouping. The issue after that is you wont know if you are at a local maxima (which in your scenario is likely). After your current search has bottomed out at the highest point, and you have calculated the FWHM for that area, you could set all the nodes your A* has traversed to 0, (or mark each node as visited so as to not be visited again), and start the A* algorithm again, until all nodes have been seen, and all groupings found.
I'm trying to calculate degree centrality of each node in a small-world network using NetLogo tool. I'm using network extension "nw". I calculated closeness, betweenness and eigne vector easily using this extension.
but I don't know how to code for degree centrality. Any help plz.
I am reading about applications of clustering in human motion analysis. I started out with random numbers and applied k-means clustering algorithm but I wanted to have some graphs that circle the clusters as shown in the picture. Basically, the lines represent the motion trajectory. I will appreciate ideas on how to obtain motion trajectory of a person. Application is patient monitoring where the trajectory will be used in abnormal behavior activity.
I will be using a kinect and recording the motion trajectory based on skeleton tracking. So, I will be recording the 4 quaternion values of Head, Shoulder and Torso joints and the RGBD (Red green blue Depth) that is combined as 1 value for these joints. So, a total of 4*3 + 3 = 15 time series. So, there are 15 variables. How do I convert them to represent the trajectories shown below and then apply clustering to cluster trajectories. The clusters will allow in classification.
Can somebody please show how to obtain the diagram similar to the one attached? and how do I fuse and convert the 15 time series from each person into a single trajectory.
The picture illustrates the number of clusters that are generated for the time series. Thank you in advance.
K-means is a bad fit for trajectories.
It needs to be able to compute the mean (which is why it is called "k-means"). Having a stable, sensible mean is important. But how meaningful is the mean of some time series, even if you could define it (and the series weren't e.g. of different length, and different movement speed)?
Try hierarchical clustering, and multivariate dynamic time warping.
I've been studying about k-means clustering, and one big thing which is not clear is what Silhouette function really tell to me?
i know it shows that what appropriate k should be detemine but i cant understand what mean of silhouette function really say to me?
i read somewhere, if the mean of silhouette is less than 0.5 your clustering is not valid.
thanks for your answers in advance.
From the definition of silhouette :
Silhouette Value
The silhouette value for each point is a measure of how similar that
point is to points in its own cluster compared to points in other
clusters, and ranges from -1 to +1.
The silhouette value for the ith point, Si, is defined as
Si = (bi-ai)/ max(ai,bi) where ai is the average distance from the ith
point to the other points in the same cluster as i, and bi is the
minimum average distance from the ith point to points in a different
cluster, minimized over clusters.
This method just compares the intra-group similarity to closest group similarity. If any data member average distance to other members of the same cluster is higher than average distance to some other cluster members, then this value is negative and clustering is not successful. On the other hand, silhuette values close to 1 indicates a successful clustering operation. 0.5 is not an exact measure for clustering.
#fatihk gave a good citation;
additionally, you may think about the Silhouette value as a degree of
how clusters overlap with each other, i.e. -1: overlap perfectly,
+1: clusters are perfectly separable;
BUT low Silhouette values for a particular algorithm does NOT mean that there are no clusters, rather it means that the algorithm used cannot separate clusters and you may consider tune your algorithm or use a different algorithm (think about K-means for concentric circles, vs DBSCAN).
There is an explicit formula associated with the elbow method to automatically determine the number of clusters. The formula tells you about the strength of the elbow(s) being detected when using the elbow method to determine the number of clusters, see here. See illustration here:
Enhanced Elbow rule
I am working with data-set having 2 co-ordinates. Currently I am calculating density by at first calculating total distance from each point to other points and then dividing it by total points. I want to know is this the correct method to calculate density as I am not getting desired result.
This is the cluster file https://dl.dropboxusercontent.com/u/45772222/samp.txt
this cluster should have 3 cluster -> 2 ellipse and one pipe connecting them
any idea how can I separate them?
Now that is a total toy example.
DBSCAN cannot separate clusters of different densities that touch each other. By definition of density connectedness, they must be separated by an area of low density. In your toy example, the two large clusters are actually connected by an area of higher density.
So essentially, this is an example of non-density based clusters... If you want density based clustering to be able to separate these clusters, you must reduce the density of the connecting bar to have a lower density than the clusters. (But maybe don't even bother to use such toy examples at all)