tsp

package
v0.0.0-...-198821d Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalEdge

func CalEdge(c1, c2 City) int

calculates edge weight (euclidiean distance)

Types

type City

type City struct {
	X, Y float64
}

type FileTSP

type FileTSP struct {
	// contains filtered or unexported fields
}

func (*FileTSP) GetDistanceMatrix

func (t *FileTSP) GetDistanceMatrix() IntMatrix

func (*FileTSP) GetLocations

func (t *FileTSP) GetLocations() []City

func (*FileTSP) GetNNIdx

func (t *FileTSP) GetNNIdx(i, j int) int

func (*FileTSP) GetName

func (t *FileTSP) GetName() string

func (*FileTSP) GetSize

func (t *FileTSP) GetSize() int

type IntMatrix

type IntMatrix [][]int

type Matrix

type Matrix [][]float64

type NNData

type NNData struct {
	// contains filtered or unexported fields
}

type TSP

type TSP interface {
	//Init()
	GetSize() int
	GetName() string
	GetLocations() []City
	GetDistanceMatrix() IntMatrix
	GetNNIdx(i, j int) int
}

func NewFileTSP

func NewFileTSP(fname string) TSP

Jump to

Keyboard shortcuts

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