Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VertexPriorityQueue ¶
type VertexPriorityQueue[T comparable] struct { // contains filtered or unexported fields }
VertexPriorityQueue wraps the priorityQueue type to decrease the exposes methods, and increase the type safety.
func NewVertexPriorityQueue ¶
func NewVertexPriorityQueue[T comparable]() *VertexPriorityQueue[T]
func (*VertexPriorityQueue[T]) Len ¶
func (v *VertexPriorityQueue[T]) Len() int
Len is the number of elements in the underlying queue.
func (*VertexPriorityQueue[T]) Peek ¶
func (v *VertexPriorityQueue[T]) Peek() *VertexWithPriority[T]
Peek is the number of elements in the underlying queue.
func (*VertexPriorityQueue[T]) Pop ¶
func (v *VertexPriorityQueue[T]) Pop() *VertexWithPriority[T]
Pop removes and returns the minimum element (according to Less) from the underlying heap.
func (*VertexPriorityQueue[T]) Push ¶
func (v *VertexPriorityQueue[T]) Push(in *VertexWithPriority[T])
Push adds new VertexWithPriority to the queue.
type VertexWithPriority ¶
type VertexWithPriority[T comparable] struct { // contains filtered or unexported fields }
VertexWithPriority is a vertex priority queue item that stores vertex along with its priority.
func NewVertexWithPriority ¶
func NewVertexWithPriority[T comparable](vertex *gograph.Vertex[T], priority float64) *VertexWithPriority[T]
func (VertexWithPriority[T]) Priority ¶
func (v VertexWithPriority[T]) Priority() float64
Priority returns the priority of the vertex.
func (VertexWithPriority[T]) Vertex ¶
func (v VertexWithPriority[T]) Vertex() *gograph.Vertex[T]
Vertex returns the vertex.
Click to show internal directories.
Click to hide internal directories.