graph

package
v0.0.0-...-4abed79 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgMin

func ArgMin(array []Vertex) int

Types

type Edge

type Edge struct {
	V     int
	W     int
	Value float32
}

func (*Edge) Less

func (e *Edge) Less(other *Edge) bool

func (*Edge) String

func (e *Edge) String() string

type EdgeHeap

type EdgeHeap []Edge

func (EdgeHeap) Len

func (h EdgeHeap) Len() int

func (EdgeHeap) Less

func (h EdgeHeap) Less(i, j int) bool

func (*EdgeHeap) Pop

func (h *EdgeHeap) Pop() interface{}

func (*EdgeHeap) Push

func (h *EdgeHeap) Push(x interface{})

func (EdgeHeap) Swap

func (h EdgeHeap) Swap(i, j int)

type GraphGenerator

type GraphGenerator struct {
	AdjMap   map[string]map[string]float32
	Vertices []Vertex
}

func (GraphGenerator) Create

func (gen GraphGenerator) Create(policy common.Policy) common.Generation

type LocalSearch

type LocalSearch func(float32) ([]Vertex, float32)

type Path

type Path struct {
	Vertices []Vertex
	FitVal   float32
	AdjMap   map[string]map[string]float32
}

func (Path) ComputeFitness

func (path Path) ComputeFitness() float32

func (Path) CrossOver

func (path Path) CrossOver(other common.Instance) common.Instance

func (Path) Fitness

func (path Path) Fitness() float32

func (Path) Improve

func (path Path) Improve() common.Instance

func (Path) Less

func (path Path) Less(other common.Instance) bool

func (Path) Mutation

func (path Path) Mutation() common.Instance

func (Path) Reproduce

func (path Path) Reproduce() common.Instance

type TspPolicy

type TspPolicy struct {
	VerticesNum int
	// contains filtered or unexported fields
}

func (TspPolicy) GetCrossoverN

func (policy TspPolicy) GetCrossoverN() int

func (TspPolicy) GetMutationN

func (policy TspPolicy) GetMutationN() int

func (TspPolicy) GetPopulationSize

func (policy TspPolicy) GetPopulationSize() int

func (TspPolicy) GetReproductionN

func (policy TspPolicy) GetReproductionN() int

func (TspPolicy) GetSolutionN

func (policy TspPolicy) GetSolutionN() int

func (TspPolicy) R

func (policy TspPolicy) R() int

func (TspPolicy) SetGeneration

func (policy TspPolicy) SetGeneration(g int)

type Vertex

type Vertex struct {
	Id string
}

func (*Vertex) Less

func (p *Vertex) Less(other *Vertex) bool

func (*Vertex) String

func (p *Vertex) String() string

Jump to

Keyboard shortcuts

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