day72

package
v0.0.0-...-36687a4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrInfiniteLoop

func ErrInfiniteLoop() error

ErrInfiniteLoop returns the error if an infinite loop is detected.

func LargestPathValue

func LargestPathValue(nodes []Node, edges []Edge) (int, error)

LargestPathValue takes a slice of runes representing nodes. Edges represents all the directed edges. Returns the largest path value or an error if an infinite loop is detected.

Types

type AdjacencyMatrix

type AdjacencyMatrix map[int]map[int]struct{}

AdjacencyMatrix represents a sparse adjacency matrix.

type Edge

type Edge struct {
	From, To int
}

Edge represents a directed edge going 'From' and 'To' a different node. Nodes are represented by integers from 0..N.

type Node

type Node rune

Node is a character representation of a node in a graph.

Jump to

Keyboard shortcuts

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