Skip to content

Computational cost of the Fraction module #2

@nikohansen

Description

@nikohansen

moarchiving uses the Fraction type to avoid rounding errors when computing HV differences. When used to build an archive with more and more dense points, the Fraction module will become more and more computational expensive, quite likely proportional to the archive size or to the iteration count.

Timing of repeated computation of a = (a + b) / 2 with Fraction and with float:

Details Screen Shot 2020-05-04 at 13 14 01

The "fix" to prevent using Fraction

import moarchiving
moarchiving.BiobjectiveNondominatedSortedList.hypervolume_final_float_type = float
moarchiving.BiobjectiveNondominatedSortedList.hypervolume_computation_float_type = float

will reduce the computational demand problem but also turn off arbitrary precision.

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