pathgraph

package
v0.0.0-...-8f4d57c Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PathGraph

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

PathGraph represents a weighted directed graph of navigation paths

func NewPathGraph

func NewPathGraph() *PathGraph

NewPathGraph creates a new instance of PathGraph

func (*PathGraph) AddJump

func (g *PathGraph) AddJump(sourcePath, destPath string) float64

AddJump adds or updates a path transition in the graph

func (*PathGraph) GetAllPaths

func (g *PathGraph) GetAllPaths() []string

GetAllPaths returns all unique paths in the graph

func (*PathGraph) GetDestinations

func (g *PathGraph) GetDestinations(sourcePath string) map[string]float64

GetDestinations returns all destinations and their weights for a given source path

type PathVertex

type PathVertex struct {
	Path   string
	Weight float64
}

PathVertex represents a vertex in the graph

Jump to

Keyboard shortcuts

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