T - the actual type of the nodespublic abstract class GraphBuilder<T> extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_K
Default number of neighbors.
|
| Constructor and Description |
|---|
GraphBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Graph<T> |
computeGraph(List<T> nodes)
Compute the graph.
|
protected abstract Graph<T> |
computeGraph(List<T> nodes,
int k,
SimilarityInterface<T> similarity) |
int |
getComputedSimilarities() |
int |
getK() |
SimilarityInterface |
getSimilarity() |
static LinkedList<String> |
readFile(String path) |
void |
setK(int k)
Define k the number of edges per node.
|
void |
setSimilarity(SimilarityInterface<T> similarity) |
void |
test(List<T> nodes)
Build the approximate graph, then use brute-force to build the exact
graph and compare the results.
|
public static final int DEFAULT_K
public final int getK()
public final void setK(int k)
k - public final SimilarityInterface getSimilarity()
public final void setSimilarity(SimilarityInterface<T> similarity)
similarity - public final int getComputedSimilarities()
public final Graph<T> computeGraph(List<T> nodes)
nodes - public final void test(List<T> nodes)
nodes - public static LinkedList<String> readFile(String path) throws FileNotFoundException, IOException
path - FileNotFoundException - if file does not existIOException - if file cannot be readCopyright © 2017. All rights reserved.