common

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: 0 Imported by: 0

Documentation

Overview

Package common provides shared utility types and functions used across multiple internal packages.

This package is intended for internal use only and serves as a place for reusable logic that does not belong to a specific domain or module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSolverConfig

func ValidateSolverConfig(cfg *SolverConfig) error

validateSolverConfig checks if the SolverConfig is valid.

Types

type BranchingStrategy

type BranchingStrategy string

BranchingStrategy represents the strategy used for branching in integer programming.

const (
	FirstFractional BranchingStrategy = "first-fractional"
	MostFractional  BranchingStrategy = "most-fractional"
	LeastFractional BranchingStrategy = "least-fractional"
	RandomBranching BranchingStrategy = "random-branching"
)

type HeuristicStrategy

type HeuristicStrategy string

HeuristicStrategy represents the strategy used for heuristics in integer programming.

const (
	RandomHeuristic      HeuristicStrategy = "random"
	LargestInfeasibility HeuristicStrategy = "largest-infeasibility"
)

type SolverConfig

type SolverConfig struct {
	// TimeLimit        // TODO: Add time.Duration field later
	Tolerance     float64
	MaxIterations int

	GapSensitivity       float64
	UseCuttingPlanes     bool
	BranchingStrategy    BranchingStrategy
	HeuristicStrategy    HeuristicStrategy
	StrongBranchingDepth int
	Threads              int

	RandomSeed   int
	SolverMethod SolverMethod
	Logging      bool
}

SolverConfig holds the actual configuration with no pointers.

func DefaultSolverConfig

func DefaultSolverConfig() *SolverConfig

DefaultSolverConfig returns the default solver configuration.

func (*SolverConfig) String

func (opts *SolverConfig) String() string

type SolverMethod

type SolverMethod string

SolverMethod represents the method used for solving linear programming problems or the LP relaxation of integer programming problems.

const (
	SimplexMethod SolverMethod = "simplex" // Currently the only option is the simplex method
)

Jump to

Keyboard shortcuts

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