|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uci.ics.jung.algorithms.importance.VoltageRanker
public class VoltageRanker
Ranks vertices in a graph according to their 'voltage' in an approximate solution to the Kirchoff equations. This is accomplished by tying "source" vertices to specified positive voltages, "sink" vertices to 0 V, and iteratively updating the voltage of each other vertex to the (weighted) average of the voltages of its neighbors.
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:
| Field Summary | |
|---|---|
protected double |
convergence_threshold
|
protected NumberEdgeValue |
edge_weights
|
protected int |
max_iterations
|
protected NumberVertexValue |
voltages
|
| Constructor Summary | |
|---|---|
VoltageRanker(NumberEdgeValue edge_weights,
NumberVertexValue voltages,
int num_iterations,
double convergence_threshold)
Creates an instance of VoltageRanker which uses the
edge weights specified by edge_weights, and which stores
the voltages (ranks) as specified by voltages. |
|
VoltageRanker(NumberVertexValue voltages,
int num_iterations,
double threshold)
Creates an instance of VoltageRanker which treats the
edges as though they were unweighted, and which stores
the voltages (ranks) as specified by voltages. |
|
| Method Summary | |
|---|---|
void |
calculateVoltages(Graph g,
Map source_voltages,
Set sinks)
Calculates the voltages for g based on the specified source
and sink vertex sets. |
void |
calculateVoltages(Graph g,
Set sources,
Set sinks)
Calculates the voltages for g based on assigning each of the
vertices in source a voltage of 1 V. |
void |
calculateVoltages(Vertex source,
Vertex target)
Calculates an approximation of the solution of the Kirchhoff equations for voltage, given that source supplies 1 V and target
is tied to ground (O V). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected NumberEdgeValue edge_weights
protected NumberVertexValue voltages
protected int max_iterations
protected double convergence_threshold
| Constructor Detail |
|---|
public VoltageRanker(NumberEdgeValue edge_weights,
NumberVertexValue voltages,
int num_iterations,
double convergence_threshold)
VoltageRanker which uses the
edge weights specified by edge_weights, and which stores
the voltages (ranks) as specified by voltages.
public VoltageRanker(NumberVertexValue voltages,
int num_iterations,
double threshold)
VoltageRanker which treats the
edges as though they were unweighted, and which stores
the voltages (ranks) as specified by voltages.
| Method Detail |
|---|
public void calculateVoltages(Graph g,
Set sources,
Set sinks)
g based on assigning each of the
vertices in source a voltage of 1 V.
sources - vertices tied to 1 Vsinks - vertices tied to 0 VcalculateVoltages(Graph, Map, Set)
public void calculateVoltages(Graph g,
Map source_voltages,
Set sinks)
g based on the specified source
and sink vertex sets.
g - the graph for which voltages will be calculatedsource_voltages - a map from vertices to source voltage valuessinks - a set of vertices to tie to 0 V
public void calculateVoltages(Vertex source,
Vertex target)
source supplies 1 V and target
is tied to ground (O V). Each other vertex will be assigned a voltage (rank)
in the range [0,1].
source - the vertex whose voltage is tied to 1 Vtarget - the vertex whose voltage is tied to 0 V
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||