|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable fr.inria.opengve.bridge.algorithms.StepAlgo<V,E> fr.inria.opengve.bridge.algorithms.undirected.Kruskal<V,E,G>
public abstract class Kruskal<V,E extends Edge<V>,G extends Graph<V,E>>
This class implement the Kruskal algorithms to compute minimum spanning tree, it work only on non directed graph. The complexity of this implementation is O(|V||E|) where V and E are respectivly the set of vertices and edges of the graph. When this class run in StepMode the map given by user is modified to store "color" of edge (Demo mode) and the graph is also modified (some edges are deleted.).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class fr.inria.opengve.bridge.algorithms.StepAlgo |
---|
StepAlgo.StepAlgoMessage, StepAlgo.StepAlgoMessageType |
Constructor Summary | |
---|---|
Kruskal(G g,
Map map)
Constructor. |
|
Kruskal(G g,
Map map,
boolean demoMode)
Constructor. |
Method Summary | |
---|---|
protected abstract G |
createGraph(G g)
Create a new empty subgraph of a given graph. |
G |
getMST()
Return a minimum spanning tree. |
void |
run()
Compute the minimum spanning tree of graph. |
void |
setLengthContext(java.lang.Object context)
Set the context used to load edge length in the map. |
void |
setLengthName(java.lang.String name)
Set the name used to load value of edge length in the map. |
Methods inherited from class fr.inria.opengve.bridge.algorithms.StepAlgo |
---|
ends, getDemoMode, getStepMode, isEnded, nextStep, notifyGraphDisplayRequest, notifyGraphDisplayRequest, notifyLabelEdgesRequest, notifyLabelVerticesRequest, pause, setPauseMode, setTime, start |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Kruskal(G g, Map map)
g
- The graph on which Kruskal algorithm msut be apply.map
- The map containing length of edges.public Kruskal(G g, Map map, boolean demoMode)
g
- The graph on which Kruskal algorithm msut be apply.map
- The map containing length of edges.demoMode
- Set the demoMode of the algorithms.Method Detail |
---|
protected abstract G createGraph(G g)
g
- The given graph.
public void setLengthName(java.lang.String name)
name
- The new name used to load edge length in the map.public void setLengthContext(java.lang.Object context)
null
is given default context is used.
context
- The new context used to load edge length in the map.public void run()
run
in interface java.lang.Runnable
run
in class StepAlgo<V,E extends Edge<V>>
public G getMST()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |