public class KMedoids
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
long |
gedTime |
int |
numberOfGedCalcs |
Constructor and Description |
---|
KMedoids(FastGraph targetGraph,
int numberOfClusters,
int maxIterations)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.util.ArrayList<FastGraph>> |
cluster(java.util.ArrayList<FastGraph> subgraphs)
Clusters the subgraphs
|
double |
comparisonScore(FastGraph g1,
FastGraph g2)
Returns the comparison score of the two graphs.
|
void |
saveClusters(java.util.ArrayList<java.util.ArrayList<FastGraph>> clusters)
Save clusters to disk
|
public KMedoids(FastGraph targetGraph, int numberOfClusters, int maxIterations)
targetGraph
- The target graphnumberOfClusters
- The number of clustersmaxIterations
- The maximum number of iterationspublic java.util.ArrayList<java.util.ArrayList<FastGraph>> cluster(java.util.ArrayList<FastGraph> subgraphs) throws FastGraphException
subgraphs
- The subgraphs to clusterFastGraphException
- If the random selection cannot be obtained (i.e. k is too big)public double comparisonScore(FastGraph g1, FastGraph g2)
g1
- The first graphg2
- The second graphpublic void saveClusters(java.util.ArrayList<java.util.ArrayList<FastGraph>> clusters) throws java.io.IOException
clusters
- The clusters to savejava.io.IOException