graphs

package
v0.0.0-...-b41d64d Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	V []Node
}

func New

func New() Graph

func (*Graph) AddLine

func (g *Graph) AddLine(from, to string, peso int)

func (*Graph) AddNode

func (g *Graph) AddNode(name string)

func (Graph) BFS

func (g Graph) BFS(a, b string) int

func (Graph) DFS

func (g Graph) DFS(begin string) string

func (Graph) Dijkstra

func (g Graph) Dijkstra(a, b string) (int, string)

type Line

type Line struct {
	Dest string
	Peso int
}

type Node

type Node struct {
	Name  string
	Nears []Line
}

func (*Node) AddLine

func (n *Node) AddLine(dest string, peso int)

Jump to

Keyboard shortcuts

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