Skip to content

Commit

Permalink
Nodes have to be sorted with insertion sort.
Browse files Browse the repository at this point in the history
  • Loading branch information
soerendomroes committed Aug 19, 2024
1 parent b35b534 commit 78539e5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void process(final LGraph graph, final IElkProgressMonitor progressMonito
ModelOrderNodeComparator comparator = new ModelOrderNodeComparator(previousLayer,
graph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_STRATEGY),
graph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY));
Collections.sort(layer.getNodes(), comparator);
SortByInputModelProcessor.insertionSort(layer.getNodes(), comparator);
for (LNode node : layer.getNodes()) {
if (node.getProperty(LayeredOptions.PORT_CONSTRAINTS) != PortConstraints.FIXED_ORDER
&& node.getProperty(LayeredOptions.PORT_CONSTRAINTS) != PortConstraints.FIXED_POS) {
Expand All @@ -86,7 +86,7 @@ public void process(final LGraph graph, final IElkProgressMonitor progressMonito
comparator = new ModelOrderNodeComparator(previousLayer,
graph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_STRATEGY),
graph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_LONG_EDGE_STRATEGY));
Collections.sort(layer.getNodes(), comparator);
SortByInputModelProcessor.insertionSort(layer.getNodes(), comparator);

progressMonitor.log("Layer " + layerIndex + ": " + layer);
layerIndex++;
Expand Down

0 comments on commit 78539e5

Please sign in to comment.