esa / esa/pagmo2

estimate_sparsity

Open
#116 1 comment 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
C++
Stars
935
Forks
186
PR merge metrics
No merged PRs in 30d

Description

The function [estimate_sparsity](https://github.com/esa/pagmo2/blob/691a6f9ceb9f19c4d25ed614f56975affb7abdc5/include/pagmo/utils/gradients_and_hessians.hpp#L75) currently computes the fitness by changing each component of the decision vector `x` by the same amount (default 1e-8). This causes issues for problems that are not scaled in a proper way.

A possible fix would be to pass instead the lower and upper bounds of `x` as arguments, in addition to a number `N`: the function could compute a random `x` within the bounds, then for every component of `x` change it `N` times (one by one) within the respective bounds, and check if the fitness components are constant in all of the `N` points obtained.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in include/pagmo/utils/gradients_and_hessians.hpp at estimate_sparsity, then inspect its callers and current tests. Reproduce the issue with an improperly scaled decision vector and evaluate the proposed bounds-and-sampling approach against the expected sparsity result. Done means estimates are scale-aware without regressing existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.