Interface VertexProcessorPrim


public interface VertexProcessorPrim

Interface declaring minimal set of operations to be applied to the vertices of an undirected graph during a run of Prim's algorithm for constructing a minimal spanning tree.

Recording and/or visualizing information arising in a run that is processed by this VertexProcessorPrim may be recorded suitably by VisitorPrim. The VertexPropertyItemPrim provides an adequat datastructure for manipulating relevant information.

See Also:
Vertex, Edge, VisitorPrim, VertexPropertyItemPrim

Method Summary
 boolean adjacency(Vertex v, Edge e)
          Scans a vertex, that is proposes to relate it to the growing forest via the given edge, where getTarget(e)==v is assumed.
 boolean init(Vertex v)
          Initializes a vertex as not being adjacent to the growing forest.
 boolean process(Vertex v)
          Processes a vertex, that is makes it part of the growing forest, and hereby fixes it definitively.
 

Method Detail

init

public boolean init(Vertex v)
Initializes a vertex as not being adjacent to the growing forest.
Parameters:
v - the vertex to be initialized

adjacency

public boolean adjacency(Vertex v,
                         Edge e)
                  throws java.lang.IllegalArgumentException
Scans a vertex, that is proposes to relate it to the growing forest via the given edge, where getTarget(e)==v is assumed.
Parameters:
v - the vertex with new adjacency possibility
e - the edge making the vertex adjacent to the growing forest
Throws:
java.lang.IllegalArgumentException - if getTarget(e)!=v
java.lang.IllegalStateException - if process(Vertex) has already been called for v

process

public boolean process(Vertex v)
                throws java.lang.IllegalStateException
Processes a vertex, that is makes it part of the growing forest, and hereby fixes it definitively.
Parameters:
v - the vertex to be processed, i.e. adjoint to the forest
Throws:
java.lang.IllegalStateException - if adjacency(Vertex, Edge) has not yet been called for v