Package org.graph4j.vsp
Class VertexSeparatorBase
java.lang.Object
org.graph4j.SimpleGraphAlgorithm
org.graph4j.vsp.VertexSeparatorBase
- All Implemented Interfaces:
VertexSeparatorAlgorithm
- Direct Known Subclasses:
BacktrackVertexSeparator,GreedyVertexSeparator
public abstract class VertexSeparatorBase
extends SimpleGraphAlgorithm
implements VertexSeparatorAlgorithm
The vertex separator problem (VSP) is to find a partition of V into nonempty
three classes A, B, C such that there is no edge between A and B,
max(|A|,|B|) <= f(n) and |C| is minimum.
C is called separator, A and B are called shores.
The value of the parameter f(n) which is more used in literature is 2n/3.- Author:
- Cristian Frăsinaru
-
Field Summary
FieldsFields inherited from class org.graph4j.SimpleGraphAlgorithm
graph -
Constructor Summary
ConstructorsConstructorDescriptionVertexSeparatorBase(Graph graph) Creates an algorithm for computing a vertex separator with the default argument for the maximum shore size of2n/3, wherenis the number of vertices in the graph.VertexSeparatorBase(Graph graph, int maxShoreSize) Creates an algorithm for computing a vertex separator with the specified maximum shore size. -
Method Summary
Modifier and TypeMethodDescriptionabstract VertexSeparatorReturns a vertex separator separator.intReturns the mazimum shore size used by the algorithmS.Methods inherited from class org.graph4j.SimpleGraphAlgorithm
getGraphMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graph4j.vsp.VertexSeparatorAlgorithm
getGraph
-
Field Details
-
maxShoreSize
protected final int maxShoreSize -
solution
-
-
Constructor Details
-
VertexSeparatorBase
Creates an algorithm for computing a vertex separator with the default argument for the maximum shore size of2n/3, wherenis the number of vertices in the graph.- Parameters:
graph- the input graph.
-
VertexSeparatorBase
Creates an algorithm for computing a vertex separator with the specified maximum shore size.- Parameters:
graph- the input graph.maxShoreSize- the maximum shore size.
-
-
Method Details
-
maxShoreSize
public int maxShoreSize()Returns the mazimum shore size used by the algorithmS.- Returns:
- the maximum shore size.
-
getSeparator
Description copied from interface:VertexSeparatorAlgorithmReturns a vertex separator separator.- Specified by:
getSeparatorin interfaceVertexSeparatorAlgorithm- Returns:
- a vertex separator set.
-