public class VoltageScorer<V,E> extends AbstractIterativeScorer<V,E,Double> implements VertexScorer<V,Double>
The resultant voltages will all be in the range [0, max]
where max
is the largest voltage of any source vertex (in the
absence of negative source voltages; see below).
A few notes about this algorithm's interpretation of the graph data:
Modifier and Type | Field and Description |
---|---|
protected Collection<V> |
sinks |
protected Map<V,? extends Number> |
source_voltages |
edge_weights, graph, hyperedges_are_self_loops, max_delta, max_iterations, output_reversed, tolerance, total_iterations
Constructor and Description |
---|
VoltageScorer(Hypergraph<V,E> g,
Collection<V> sources,
Collection<V> sinks)
Creates an instance with the specified graph, source vertices
(each of whose 'voltages' are tied to 1), and sinks.
|
VoltageScorer(Hypergraph<V,E> g,
com.google.common.base.Function<? super E,? extends Number> edge_weights,
Collection<V> sources,
Collection<V> sinks)
Creates an instance with the specified graph, edge weights, source vertices
(each of whose 'voltages' are tied to 1), and sinks.
|
VoltageScorer(Hypergraph<V,E> g,
com.google.common.base.Function<? super E,? extends Number> edge_weights,
Map<V,? extends Number> source_voltages,
Collection<V> sinks)
Creates an instance with the specified graph, edge weights, source voltages,
and sinks.
|
VoltageScorer(Hypergraph<V,E> g,
com.google.common.base.Function<? super E,? extends Number> edge_weights,
V source,
V sink)
Creates an instance with the specified graph, edge weights, source, and
sink.
|
VoltageScorer(Hypergraph<V,E> g,
Map<V,? extends Number> source_voltages,
Collection<V> sinks)
Creates an instance with the specified graph, source voltages,
and sinks.
|
VoltageScorer(Hypergraph<V,E> g,
V source,
V sink)
Creates an instance with the specified graph, edge weights, source, and
sink.
|
Modifier and Type | Method and Description |
---|---|
void |
initialize()
Initializes the state of this instance.
|
double |
update(V v)
Updates the value for
v . |
acceptDisconnectedGraph, afterStep, collectDisappearingPotential, done, evaluate, getAdjustedIncidentCount, getCurrentValue, getEdgeWeight, getEdgeWeights, getIterations, getMaxIterations, getOutputValue, getTolerance, getVertexScore, isDisconnectedGraphOK, setCurrentValue, setEdgeWeights, setHyperedgesAreSelfLoops, setMaxIterations, setOutputValue, setTolerance, step, swapOutputForCurrent, updateMaxDelta
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getVertexScore
protected Collection<V> sinks
public VoltageScorer(Hypergraph<V,E> g, com.google.common.base.Function<? super E,? extends Number> edge_weights, Map<V,? extends Number> source_voltages, Collection<V> sinks)
g
- the input graphedge_weights
- the edge weights, representing conductivitysource_voltages
- the (fixed) voltage for each sourcesinks
- the vertices whose voltages are tied to 0public VoltageScorer(Hypergraph<V,E> g, com.google.common.base.Function<? super E,? extends Number> edge_weights, Collection<V> sources, Collection<V> sinks)
g
- the input graphedge_weights
- the edge weights, representing conductivitysources
- the vertices whose voltages are tied to 1sinks
- the vertices whose voltages are tied to 0public VoltageScorer(Hypergraph<V,E> g, Collection<V> sources, Collection<V> sinks)
g
- the input graphsources
- the vertices whose voltages are tied to 1sinks
- the vertices whose voltages are tied to 0public VoltageScorer(Hypergraph<V,E> g, Map<V,? extends Number> source_voltages, Collection<V> sinks)
g
- the input graphsource_voltages
- the (fixed) voltage for each sourcesinks
- the vertices whose voltages are tied to 0public VoltageScorer(Hypergraph<V,E> g, com.google.common.base.Function<? super E,? extends Number> edge_weights, V source, V sink)
g
- the input graphedge_weights
- the edge weights, representing conductivitysource
- the vertex whose voltage is tied to 1sink
- the vertex whose voltage is tied to 0public VoltageScorer(Hypergraph<V,E> g, V source, V sink)
g
- the input graphsource
- the vertex whose voltage is tied to 1sink
- the vertex whose voltage is tied to 0public void initialize()
initialize
in class AbstractIterativeScorer<V,E,Double>
public double update(V v)
AbstractIterativeScorer
v
.update
in class AbstractIterativeScorer<V,E,Double>
v
- the vertex whose value is to be updatedAbstractIterativeScorer.update(Object)
Copyright © 2015. All rights reserved.