Skip to content

Obsolete continuation of inner loop in ApproximateBestSubset #7182

@murchandamus

Description

@murchandamus

vValue is sorted into ascending order before ApproximateBestSubset(...) is called.

Currently, after a new best set is found, the final element that was added gets removed from the set, and the inner loop continues to search through the remainder of vValue for a better set. It is however impossible for a better set to be achieved with a later element in vValue: As vValue is sorted in ascending order, any set formed with a later element will be of same size or bigger.

Therefore, the lines 1628 & 1629 are obsolete, and the inner loop should also stop on fReachedTarget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions