solver

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package solver provides a high-level interface for solving linear programming problems using the revised simplex method.

It exposes a configurable Solver type and related options that allow users to control how problems are solved, including tolerances, iteration limits, and output handling.

Index

Constants

Re-export constants

Variables

This section is empty.

Functions

func NewSolverConfig

func NewSolverConfig(opts ...SolverOption) *common.SolverConfig

NewSolverConfig builds a SolverConfig applying all options on defaults.

func Solve

func Solve(prog *lp.LinearProgram, opts ...SolverOption) *lp.LinearProgram

Solve takes a linear program and an optional configuration, and attempts to solve it using the revised simplex method.

Types

type BranchingStrategy

type BranchingStrategy = common.BranchingStrategy

type HeuristicStrategy

type HeuristicStrategy = common.HeuristicStrategy

type SolverMethod

type SolverMethod = common.SolverMethod

type SolverOption

type SolverOption func(*common.SolverConfig)

SolverOption defines a function that modifies SolverConfig.

func WithBranchingStrategy

func WithBranchingStrategy(bs common.BranchingStrategy) SolverOption

WithBranchingStrategy sets the branching strategy.

func WithGapSensitivity

func WithGapSensitivity(gap float64) SolverOption

WithGapSensitivity sets the gap sensitivity.

func WithHeuristicStrategy

func WithHeuristicStrategy(hs common.HeuristicStrategy) SolverOption

WithHeuristicStrategy sets the heuristic strategy.

func WithLogging

func WithLogging(enabled bool) SolverOption

WithLogging enables or disables logging.

func WithMaxIterations

func WithMaxIterations(max int) SolverOption

WithMaxIterations sets the maximum number of iterations.

func WithRandomSeed

func WithRandomSeed(seed int) SolverOption

WithRandomSeed sets the random seed.

func WithSolverMethod

func WithSolverMethod(m common.SolverMethod) SolverOption

WithSolverMethod sets the solver method.

func WithStrongBranchingDepth

func WithStrongBranchingDepth(depth int) SolverOption

WithStrongBranchingDepth sets the strong branching depth.

func WithThreads

func WithThreads(n int) SolverOption

WithThreads sets the number of threads to use.

func WithTolerance

func WithTolerance(t float64) SolverOption

WithTolerance sets the tolerance.

func WithUseCuttingPlanes

func WithUseCuttingPlanes(enabled bool) SolverOption

WithUseCuttingPlanes enables or disables cutting planes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL