|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mascoptDev.algos.graph.PrimPreproc2
This algorithm called Boruvka's Algorithm is used to preprocess graphs before using the Prim's Algorithm. It can be run iteratively to generate a Minimum Spanning Tree itself.
At each node the minimum weight edge incident on it is selected and the corresponding neighbour is added to the initial node's component. The graph is then reconstructed with components representing the nodes and edges between nodes in the same component removed.
constructMst
Field Summary | |
static String |
edgeW
The string used to store values on edges for capcities. |
Constructor Summary | |
PrimPreproc2(Graph g)
Default Constructor. |
Method Summary | |
void |
constructMst()
This function constructs the Minimum Spanning Tree for the graph in iterations. |
int |
getMinEdgeWt(Vertex n1,
Vertex n2,
EdgeSet e)
Returns the least weight found among the edges connecting two nodes in an EdgeSet |
int |
getMinEdgeWt(Vertex n1,
Vertex n2,
Graph g)
Returns the least weight found among the edges connecting two nodes in a given graph. |
int |
getMinWeight()
This function is used to find the weight of the Minimum Spanning Tree constructed |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String edgeW
Constructor Detail |
public PrimPreproc2(Graph g)
g
- the graph to be usedMethod Detail |
public void constructMst()
public int getMinEdgeWt(Vertex n1, Vertex n2, Graph g)
n1
- Node 1n2
- Node 2g
- The Graph to be usedpublic int getMinEdgeWt(Vertex n1, Vertex n2, EdgeSet e)
e
- The EdgeSet to be used.public int getMinWeight()
constructMst
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |