public class GreedyGourmetPartitioning extends Object
Modifier and Type | Field and Description |
---|---|
protected MatchingAdjacencyMatrix |
adjMatrix |
(package private) double |
limit |
protected boolean |
maxWeights |
(package private) HashMap<Integer,Vector<MTBGraphNode<PartitGraphNodeID>>> |
partitions |
private Vector<MTBGraph> |
subgraphs |
Constructor and Description |
---|
GreedyGourmetPartitioning(MatchingAdjacencyMatrix adjMatrix,
boolean maximizeWeights,
double limit)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Vector<MTBGraph> |
computeSubgraphs()
Compute subgraphs with greedyGourmet algorithm.
|
private boolean |
connectNodesCase1(MTBGraphNode<PartitGraphNodeID> n1,
MTBGraphNode<PartitGraphNodeID> n2,
MTBGraphNode<PartitGraphNodeID> nstar1,
MTBGraphNode<PartitGraphNodeID> nstar2,
boolean do_connect)
Connect nodes if case 1
|
private MTBGraphNode<PartitGraphNodeID> |
getGraphNode(int subgraphID,
int partitionID)
Get the graph node from partition 'partitionID' in subgraph 'subgraphID'.
|
private MTBGraphNode<PartitGraphNodeID> |
getOptimalNeighbor(MTBGraphNode<PartitGraphNodeID> currentNode,
int partitionID)
Get node of partition 'partitionID' which is connected to current node and has optimal weight
|
private int |
numOfConnectedNodes(PartitGraphNodeID currentNode,
int partitionID)
Get number of nodes from partition 'partitionID' connected to current node
|
protected MatchingAdjacencyMatrix adjMatrix
protected boolean maxWeights
HashMap<Integer,Vector<MTBGraphNode<PartitGraphNodeID>>> partitions
double limit
public GreedyGourmetPartitioning(MatchingAdjacencyMatrix adjMatrix, boolean maximizeWeights, double limit)
adjMatrix
- adjacency matrix of the multipartite graphmaximizeWeights
- flag if sum of weights are to be maximizedlimit
- only edge weights larger (maximize weights) or smaller (minimize weights) are consideredpublic Vector<MTBGraph> computeSubgraphs()
private boolean connectNodesCase1(MTBGraphNode<PartitGraphNodeID> n1, MTBGraphNode<PartitGraphNodeID> n2, MTBGraphNode<PartitGraphNodeID> nstar1, MTBGraphNode<PartitGraphNodeID> nstar2, boolean do_connect)
private MTBGraphNode<PartitGraphNodeID> getOptimalNeighbor(MTBGraphNode<PartitGraphNodeID> currentNode, int partitionID)
currentNode
- current nodepartitionID
- ID of partitionlimit
- optimal neighbors must have edge weights larger (max weight) or smaller (min weight) than limit to be consideredprivate MTBGraphNode<PartitGraphNodeID> getGraphNode(int subgraphID, int partitionID)
private int numOfConnectedNodes(PartitGraphNodeID currentNode, int partitionID)
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.