dijkstrapq

package
v0.0.0-...-23e9799 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DijkstraSolver

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

func NewDijkstraSolver

func NewDijkstraSolver(vinf Value, less Less, estimate Estimate) *DijkstraSolver

func (*DijkstraSolver) Dijkstra

func (ds *DijkstraSolver) Dijkstra(S []StartPoint, n int, AG [][]Edge) []Value

verified by [ABC143-E](https://atcoder.jp/contests/abc143/tasks/abc143_e)

type Edge

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

edge of graph

type Estimate

type Estimate func(cid int, cv Value, e Edge) Value

Estimate returns next value considered by transition.

type Less

type Less func(l, r Value) bool

Less returns l < r, and shared with pq.

type StartPoint

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

for initializing start points of dijkstra algorithm

type Value

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

DP value type

type Vertex

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

Definitions of a priority queue

type VertexPQ

type VertexPQ []*Vertex

func NewVertexPQ

func NewVertexPQ() *VertexPQ

func (VertexPQ) Len

func (pq VertexPQ) Len() int

func (VertexPQ) Less

func (pq VertexPQ) Less(i, j int) bool

func (*VertexPQ) Pop

func (pq *VertexPQ) Pop() interface{}

func (*VertexPQ) Push

func (pq *VertexPQ) Push(x interface{})

func (VertexPQ) Swap

func (pq VertexPQ) Swap(i, j int)

type Weight

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

weight of edge

Jump to

Keyboard shortcuts

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