cover

package module
v0.0.0-...-dead5c0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

README

cover

Using the "Set Cover Problem" as a context to play with Go.

The initial plan is to mix some algorithms to build a solver for weighted covering problems with strictly positive costs. I haven't decided if the focus will be on general covers or exact covers (also known as the "set partitioning problem").

License

This project is under AGPL-3.0-only license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	// The number of elements in the set X to be covered, indexed
	// 0 ... M-1.
	M int
	// Subsets of X. The inner slices must only contain element indices in
	// [0, M-1]. The indices must be sorted and each subset must be include
	// at most once. Empty Subsets are not allowed.
	Subsets [][]int
	// The cost of each subset. Each cost must be strictly positive.
	// The length of subsets and Costs must be equal.
	// The restrictions on the Costs reasonable for many problems and
	// suit certain algorithms.
	Costs []float64
}

func MakeRandomInstance

func MakeRandomInstance(m int, n int, seed int64) Instance

Directories

Path Synopsis
cmd
brute
A brute force solver for the "Weighted Exact Cover Problem".
A brute force solver for the "Weighted Exact Cover Problem".
internal
solvers
A brute force solver for the "Weighted Exact Cover Problem".
A brute force solver for the "Weighted Exact Cover Problem".

Jump to

Keyboard shortcuts

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