public class TLcdClusteredPartitioningAlgorithm extends Object implements ILcdPartitioningAlgorithm
alpha
, the larger the
partitions (and thus the smaller the number of partitions) will be.
Typical values for alpha
are between 0.2 and 0.6. If no alpha
value is provided, the
algorithm will by default use alpha=0.3
. It might be necessary to experiment with several
values for alpha
in order to obtain a good result.
Constructor and Description |
---|
TLcdClusteredPartitioningAlgorithm()
Constructs a new
TLcdClusteredPartitioningAlgorithm . |
TLcdClusteredPartitioningAlgorithm(Random aRandom)
Constructs a new
TLcdClusteredPartitioningAlgorithm . |
Modifier and Type | Method and Description |
---|---|
int |
getNrIterations()
Returns the number of iterations that is done for each partitioning.
|
<N,E> ILcdPartitionedGraph<N,E> |
partition(ILcdGraph<N,E> aGraph)
Returns a partitioned copy of the given graph.
|
<N,E> ILcdPartitionedGraph<N,E> |
partition(ILcdGraph<N,E> aGraph,
Vector<E> aConstraintedEdges)
Returns a partitioned copy of the given graph, but keeps each of the constrainted edges within
one partition (none of the constrainted edges will become a boundary edge).
|
<N,E> ILcdPartitionedGraph<N,E> |
partition(ILcdGraph<N,E> aGraph,
Vector<E> aConstraintedEdges,
double aAlpha)
Returns a partitioned copy of the given graph, but keeps each of the constrainted edges within
one partition (none of the constrainted edges will become a boundary edge).
|
<N,E> ILcdPartitionedGraph<N,E> |
partition(ILcdGraph<N,E> aGraph,
Vector<E> aConstraintedEdges,
int aMaxNrPartitioningLevels,
int aNrEdgesThreshold,
int aMinPartitions,
int aMaxPartitions)
Returns a partitioned copy of the given graph, taking into account the specified constraints.
|
void |
setNumberOfIterations(int aNrIterations)
Sets the number of iterations that should be done for each partitioning.
|
public TLcdClusteredPartitioningAlgorithm()
TLcdClusteredPartitioningAlgorithm
.public TLcdClusteredPartitioningAlgorithm(Random aRandom)
TLcdClusteredPartitioningAlgorithm
.aRandom
- the random number generator to be used by this algorithm.public void setNumberOfIterations(int aNrIterations)
aNrIterations
- the number of iterations that should be done for each partitioning.IllegalArgumentException
- if aNrIterations < 1
getNrIterations()
public int getNrIterations()
setNumberOfIterations(int)
public <N,E> ILcdPartitionedGraph<N,E> partition(ILcdGraph<N,E> aGraph)
partition
in interface ILcdPartitioningAlgorithm
aGraph
- the graph to be partitioned.public <N,E> ILcdPartitionedGraph<N,E> partition(ILcdGraph<N,E> aGraph, Vector<E> aConstraintedEdges)
aGraph
- the graph to be partitioned.aConstraintedEdges
- the edges prohibited to become boundary edges in the partitioned graph.NullPointerException
- if one of the arguments is null
.public <N,E> ILcdPartitionedGraph<N,E> partition(ILcdGraph<N,E> aGraph, Vector<E> aConstraintedEdges, int aMaxNrPartitioningLevels, int aNrEdgesThreshold, int aMinPartitions, int aMaxPartitions)
aGraph
- the graph to be partitioned.aConstraintedEdges
- the edges prohibited to become boundary edges in the partitioned graph.aMaxNrPartitioningLevels
- the maximum number of partitioning levels.aNrEdgesThreshold
- the minimum number of edges a graph should have before being further partitioned.aMinPartitions
- the minimal number of partitions in a graph, in addition to the natural partitions
(that is, the partitions that are naturally formed by converting each non-connected subgraph
of graph into a partition.)aMaxPartitions
- the maximal number of partitions in a graph, in addition to the natural partitionspublic <N,E> ILcdPartitionedGraph<N,E> partition(ILcdGraph<N,E> aGraph, Vector<E> aConstraintedEdges, double aAlpha)
aGraph
- the graph to be partitioned.aConstraintedEdges
- the edges prohibited to become boundary edges in the partitioned graph.aAlpha
- the alpha factor.NullPointerException
- if one of the arguments is null
.