Skip to content

Commit

Permalink
Minor bugfix in coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophDoll committed Jan 22, 2024
1 parent f92047c commit bb931ed
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,15 @@ private void paintNodes(Cover cover, int maxNodeColors) {
if (maxNodeColors > 0) {
final Node n = node;
HashMap<String, Double> belongingColors = new HashMap<>();
communityIndices.sort((i1, i2) -> cover.getBelongingFactor(n, i2) < cover.getBelongingFactor(n, i1) ? -1 : 1);
communityIndices.sort((i1, i2) -> {
double factor1 = cover.getBelongingFactor(n, i1);
double factor2 = cover.getBelongingFactor(n, i2);
if (factor1 == factor2) {
return 0;
} else {
return factor1 < factor2 ? -1 : 1;
}
});
if (maxNodeColors < communityIndices.size()) {
double sum = 0;
for (int i = 0; i < maxNodeColors; i++) {
Expand Down

0 comments on commit bb931ed

Please sign in to comment.