Skip to content

Leiden Algorithm 1.0.1: work without the UI, in filtered views and on any graph - #368

Merged
mbastian merged 4 commits into
master-forgefrom
fix/leiden-defaults-and-filtered-views
Nov 8, 2026
Merged

mbastian merged 4 commits into
master-forgefrom
fix/leiden-defaults-and-filtered-views

Conversation

@mbastian

@mbastian mbastian commented Nov 8, 2026

Copy link
Copy Markdown
Member

Found by the SPI contract tests of gephi-plugins-tests (StatisticsContractTest), run against Gephi 0.11.4.

  • Defaults: the settings (algorithm, qualityFunction, resolution, iterations, ...) were only set by RunClusteringUI, so a RunClustering run any other way (scripts, the statistics controller) threw NullPointerException on algorithm. The fields now start with the values the UI's defaults use.
  • Progress: progress.start() / progress() / finish() threw when there is no progress ticket. Now uses Progress.start(progress, ...) and friends, which are null-safe.
  • Filtered views: the network used node.getStoreId() as the node index, but a filtered view has fewer nodes than the highest store id (ArrayIndexOutOfBoundsException). Nodes are now mapped to consecutive indices, also when writing the Cluster column back.
  • Empty graph: the clustering library throws NegativeArraySizeException on a network without nodes. Returns an empty clustering instead.
  • Zero or negative edge weights: Network.createReducedNetwork threw ArrayIndexOutOfBoundsException. The algorithms need positive weights, so such edges are left out.
  • Version 1.0.0 → 1.0.1.

Verified: the contract tests (gephi-plugins-tests 1.1.1) pass, apart from existing columns of another type, which becomes a warning in the next gephi-plugins-tests release. Short-lived branch off master-forge, 2 files.

The settings were only initialized by the user interface, so the statistics threw a NullPointerException when run without it. Use the same defaults. Progress can be null, use the null-safe Progress helper. The network used node store ids as indices, which are out of range in a filtered view, use consecutive indices. An empty graph and edges with a zero or negative weight crashed the clustering library, skip them. Version 1.0.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mbastian mbastian closed this Nov 8, 2026
@mbastian mbastian reopened this Nov 8, 2026
mbastian and others added 3 commits November 8, 2026 18:38
@mbastian
mbastian merged commit 5c404a6 into master-forge Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant