use of org.eclipse.elk.alg.common.Tree in project elk by eclipse.
the class MaxSTPhase method process.
@Override
public void process(final Graph graph, final IElkProgressMonitor progressMonitor) {
progressMonitor.begin("Maximum spanning tree construction", 1);
// inverted cost function
ICostFunction invertedCF = e -> {
return -graph.costFunction.cost(e);
};
KVector root;
if (graph.preferredRoot != null) {
root = graph.preferredRoot.vertex;
} else {
root = graph.vertices.get(0).vertex;
}
Tree<KVector> tree;
if (graph.getProperty(InternalProperties.DEBUG_SVG)) {
tree = NaiveMinST.createSpanningTree(graph.tEdges, root, invertedCF, ElkUtil.debugFolderPath("spore") + "20minst");
} else {
tree = NaiveMinST.createSpanningTree(graph.tEdges, root, invertedCF);
}
// convert result to a Tree that can be used in the execution phase
convert(tree, graph);
progressMonitor.done();
}
Aggregations