Package jline.lib.perm
Class HeuristicPermanent
java.lang.Object
jline.lib.perm.PermSolver
jline.lib.perm.HeuristicPermanent
Heuristic approximation to the permanent of a positive matrix.
This implementation uses Sinkhorn scaling to make the matrix approximately
doubly stochastic, then applies a mean-field approximation with van der Waerden
bounds combined with a Gurvits-like capacity bound.
The algorithm:
1. Uses Sinkhorn scaling to make A approximately doubly stochastic
2. Applies a mean-field approximation with van der Waerden bounds
3. Combines with a Gurvits-like capacity bound
4. Scales the result back to the original matrix scale
This is a heuristic approximation suitable for large matrices where exact
computation is computationally prohibitive. The approximation quality depends
on the structure of the input matrix.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionHeuristicPermanent(Matrix matrix) Constructor with just matrix parameter.HeuristicPermanent(Matrix matrix, boolean solve) Constructor with just matrix and solve parameters.HeuristicPermanent(Matrix matrix, double tolerance, int maxIterations, boolean solve) Constructor with all parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidcompute()Compute the permanent or approximation for the given matrix.
-
Constructor Details
-
HeuristicPermanent
Constructor with all parameters.- Parameters:
matrix- The matrix for which to compute the permanent (must be strictly positive)tolerance- Convergence threshold for Sinkhorn scalingmaxIterations- Maximum number of Sinkhorn iterationssolve- Whether to automatically run solve() after construction- Throws:
IllegalArgumentException- if matrix contains non-positive elements
-
HeuristicPermanent
Constructor with just matrix and solve parameters. Uses default tolerance (1e-10) and maxIterations (1000). -
HeuristicPermanent
Constructor with just matrix parameter. Uses default tolerance (1e-10), maxIterations (1000), and solve (false).
-
-
Method Details
-
compute
public void compute()Description copied from class:PermSolverCompute the permanent or approximation for the given matrix. This method must be implemented by all concrete solver classes. The result should be stored in the value field.- Specified by:
computein classPermSolver
-