data

package
v0.0.0-...-f23b78b Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package data contains functions for loading problem test cases

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphColors

func GraphColors(cfg *GraphColoring) []string

GraphColors returns graph colors

func GraphEdges

func GraphEdges(graph *ds.Graph) []string

GraphEdges returns graph edge names

func GraphNumbers

func GraphNumbers(cfg *GraphColoring) []int

GraphNumbers returns numbers as graph colors

func GraphVertices

func GraphVertices(graph *ds.Graph) []string

GraphVertices returns graph vertices

func SortBySchedStart

func SortBySchedStart(a, b SlotSched) int

func SortByStartTime

func SortByStartTime(a, b TimeRange) int

func SpanTerminals

func SpanTerminals(graph *Graph) []string

SpanTerminals returns graph terminals

func SpanVertices

func SpanVertices(graph *Graph) []string

SpanVertices returns graph vertices

Types

type AssignmentCfg

type AssignmentCfg struct {
	Workers    []string
	Capacity   []float64
	Tasks      []string
	Cost       [][]float64
	Value      [][]float64
	Teams      [][]string
	MaxPerTeam int
}

func NewAssignment

func NewAssignment(name string, mustBeEqual bool) *AssignmentCfg

NewAssignment creates a new AssignmentCfg

type Bins

type Bins struct {
	Bins     []int
	Capacity float64
	Weight   []float64
}

func NewBins

func NewBins(name string) *Bins

NewBins loads a Bins config

type CarSequence

type CarSequence struct {
	OptionMax    []int
	OptionWindow []int
	Cars         []string
	CarOptions   map[string][]bool
}

func NewCarSequence

func NewCarSequence(name string) *CarSequence

NewCarSequence loads a CarSequence config

type Cars

type Cars struct {
	Cars      []string
	Sequence  []string
	CarColors []string
	MaxShift  int
}

func NewCars

func NewCars(name string) *Cars

NewCars loads a Cars config

type Graph

type Graph struct {
	*ds.Graph
	K            int
	EdgeWeight   []float64
	EdgeColor    []string
	VertexWeight []float64
	VertexColor  []string
	Terminals    []string
	Groups       [][]string
}

func NewDirectedGraph

func NewDirectedGraph(name string) *Graph

NewDirectedGraph loads a directed Graph config

func NewUndirectedGraph

func NewUndirectedGraph(name string) *Graph

NewUndirectedGraph loads an undirected Graph config

type GraphColoring

type GraphColoring struct {
	*ds.Graph
	Colors  []string
	Numbers []int
}

func NewGraphColoring

func NewGraphColoring(name string) *GraphColoring

NewGraphColoring loads a GraphColoring config

type GraphColorsFn

type GraphColorsFn[T any] = func(*GraphColoring) []T

type GraphPartition

type GraphPartition struct {
	*ds.Graph
	EdgeWeight    []float64
	NumPartitions int
	MinSize       int
}

func NewGraphPartition

func NewGraphPartition(name string) *GraphPartition

NewGraphPartition laods a GraphPartition config

type GraphPath

type GraphPath struct {
	Start         int         // index of start vertex in vertices list
	End           int         // index of end vertex in vertices list
	OriginalIndex map[int]int // map VariableIndex => OriginalIndex
	Vertices      []ds.Vertex
	Between       []ds.Vertex // list of vertices that are not start, end
	Distance      [][]float64
	Items         []string
	Cost          [][]float64
	FromOrigin    []float64
	ToOrigin      []float64
}

func NewGraphPath

func NewGraphPath(name string) *GraphPath

NewGraphPath loads a GraphPath config

func NewGraphTour

func NewGraphTour(name string) *GraphPath

NewGraphTour loads a GraphPath config with only vertices and distance matrix

type GraphSpanFn

type GraphSpanFn = func(*Graph) []string

type GraphVariablesFn

type GraphVariablesFn = func(*ds.Graph) []string

type Intervals

type Intervals struct {
	Activities []string
	Start      []float64
	End        []float64
	Weight     []float64
}

func NewIntervals

func NewIntervals(name string) *Intervals

NewIntervals loads an Intervals config

type ItemAllocation

type ItemAllocation struct {
	Persons []string
	Items   []string
	Value   map[string][]float64
}

func NewItemAllocation

func NewItemAllocation(name string) *ItemAllocation

NewItemAllocation creates a new ItemAllocation config

type Knapsack

type Knapsack struct {
	Capacity  float64
	Items     []string
	Weight    []float64
	Value     []float64
	PairBonus map[[2]string]float64
}

func NewKnapsack

func NewKnapsack(name string) *Knapsack

NewKnapsack loads a Knapsack config

type Numbers

type Numbers struct {
	Numbers []int
	Weight  []float64
	Target  int
	NumBins int
}

func NewNumbers

func NewNumbers(name string) *Numbers

NewNumbers creates a new Sequence config

type NurseSchedule

type NurseSchedule struct {
	Nurses              []string
	Days                []string
	Shifts              []string
	ShiftMin            []int
	ShiftMax            []int
	MaxConsecutiveShift int
	MaxTotalShift       int
	DailyLimit          int
	PreferShifts        map[string][]string
	PreferDays          map[string][]string
}

func NewNurseSchedule

func NewNurseSchedule(name string) *NurseSchedule

NewNurseSchedule creates a new NurseSchedule config

type QuadraticAssignment

type QuadraticAssignment struct {
	Count    int
	Distance [][]float64
	Flow     [][]float64
}

func NewQuadraticAssignment

func NewQuadraticAssignment(name string) *QuadraticAssignment

NewQuadraticAssignment creates a new Quadratic Assignment config

type Resource

type Resource struct {
	Budget float64
	Items  []string
	Count  []int
	Cost   []float64
	Value  []float64
}

func NewResource

func NewResource(name string) *Resource

NewResource creates a new Resource config

type Scene

type Scene struct {
	NumDays     int
	DayMin      []int
	DayMax      []int
	DailyCost   map[string]float64
	Scenes      []string
	SceneActors map[string][]string
}

func NewScene

func NewScene(name string) *Scene

NewScene creates a new Scene config

type ShopSchedule

type ShopSchedule struct {
	Machines    []string
	Jobs        []string
	TaskTimes   map[string][]int
	JobTasks    map[string][]Task
	MaxMakespan int
}

func NewShopSchedule

func NewShopSchedule(name string) *ShopSchedule

NewShopSchedule creates a new ShopSchedule config

func (*ShopSchedule) GetTasks

func (s *ShopSchedule) GetTasks() []Task

type SlotSched

type SlotSched struct {
	Start int
	End   int
	Name  string
}

type Subsets

type Subsets struct {
	Universal []string
	Names     []string
	Subsets   [][]string
	Limit     int
	Weight    map[string]float64
	Budget    float64
	Value     []float64
}

func NewSubsets

func NewSubsets(name string) *Subsets

NewSubsets loads a Subsets config

type Task

type Task struct {
	Job      string
	Name     string
	Machine  string
	Duration int
}

func (Task) GetDuration

func (t Task) GetDuration() int

type TimeRange

type TimeRange [2]int

func (TimeRange) Tuple

func (t TimeRange) Tuple() (int, int)

type Warehouse

type Warehouse struct {
	Stores        []string
	Warehouses    []string
	Capacity      []int
	WarehouseCost []float64
	StoreCost     [][]float64
	Count         int
	Distance      [][]float64
}

func NewWarehouse

func NewWarehouse(name string) *Warehouse

NewWarehouse creates a new Warehouse config

type Weapons

type Weapons struct {
	Weapons []string
	Count   []int
	Targets []string
	Value   []float64
	Chance  [][]float64
}

func NewWeapons

func NewWeapons(name string) *Weapons

NewWeapons creates a new Weapons config

Jump to

Keyboard shortcuts

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