Package org.nlpub.watset.graph
Interface NodeWeighting<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph
- All Known Implementing Classes:
NodeWeighting.LabelNodeWeighting,NodeWeighting.LinearNodeWeighting,NodeWeighting.LogNodeWeighting,NodeWeighting.TopNodeWeighting
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface NodeWeighting<V,E>
Node weighting for Chinese Whispers.- See Also:
ChineseWhispers
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classNodeWeighting.LabelNodeWeighting<V,E>A trivial and not particularly useful node weighting approach that assigns the current node label as the weight.static classNodeWeighting.LinearNodeWeighting<V,E>The node weighting approach that chooses the label with the highest total edge weight in the neighborhood divided by the neighbor node degree.static classNodeWeighting.LogNodeWeighting<V,E>The node weighting approach that chooses the label with the highest total edge weight in the neighborhood divided by the logarithm of the neighbor node degree.static classNodeWeighting.TopNodeWeighting<V,E>The node weighting approach that chooses the label with the highest total edge weight in the neighborhood.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description doubleapply(org.jgrapht.Graph<V,E> graph, Map<V,Integer> labels, V node, V neighbor)Compute the weight of the node in the neighborhood graph.static <V,E>
NodeWeighting<V,E>label()A static factory method providing a convenient way to create an instance ofLabelNodeWeighting.static <V,E>
NodeWeighting<V,E>linear()A static factory method providing a convenient way to create an instance ofLinearNodeWeighting.static <V,E>
NodeWeighting<V,E>log()A static factory method providing a convenient way to create an instance ofLogNodeWeighting.static <V,E>
NodeWeighting<V,E>top()A static factory method providing a convenient way to create an instance ofTopNodeWeighting.
-
-
-
Method Detail
-
apply
double apply(org.jgrapht.Graph<V,E> graph, Map<V,Integer> labels, V node, V neighbor)
Compute the weight of the node in the neighborhood graph.- Parameters:
graph- the neighborhood graphlabels- the map of graph nodes to their labelsnode- the target nodeneighbor- the neighboring node- Returns:
- the weight of the node in the neighborhood
-
label
static <V,E> NodeWeighting<V,E> label()
A static factory method providing a convenient way to create an instance ofLabelNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
LabelNodeWeighting
-
top
static <V,E> NodeWeighting<V,E> top()
A static factory method providing a convenient way to create an instance ofTopNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
TopNodeWeighting
-
log
static <V,E> NodeWeighting<V,E> log()
A static factory method providing a convenient way to create an instance ofLogNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
LogNodeWeighting
-
linear
static <V,E> NodeWeighting<V,E> linear()
A static factory method providing a convenient way to create an instance ofLinearNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
LinearNodeWeighting
-
-