Class AdaPartSampler

  • All Implemented Interfaces:

    
    public final class AdaPartSampler
    extends PermSolver
                        

    Sampling method to approximate the permanent using Adaptive Partitioning (AdaPart).

    The AdaPart algorithm uses importance sampling with adaptive partitioning to estimate the permanent. It iteratively refines the sampling space by partitioning based on upper bounds, leading to more efficient sampling than naive approaches.

    The algorithm provides three sampling modes:

    • Classic: Samples until reaching maximum accepted samples

    • Time: Samples for a maximum time duration

    • Sample: Samples for a maximum total number of samples

    • Constructor Detail

      • AdaPartSampler

        AdaPartSampler(Matrix matrix, Integer maximumAcceptedSamples, Long maximumTime, Integer maximumSamples, String mode, Boolean solve)
        Parameters:
        matrix - The matrix for which to compute the permanent approximation
        maximumAcceptedSamples - Maximum number of accepted samples for classic mode (default: 100)
        maximumTime - Maximum time in seconds for time mode (default: 30)
        maximumSamples - Maximum total samples for sample mode (default: 450)
        mode - Sampling mode: "classic", "time", or "sample" (default: "classic")
        solve - Whether to automatically run solve() after construction (default: false)