Versions in this module Expand all Collapse all v2 v2.12.0 May 13, 2024 v2.11.0 May 10, 2024 Changes in this version + func InfWeight[N Number, S Number](sign S) N + func MaxWeight[N Number]() N + type AdjacencyMatrix = Matrix[DistanceT] + type BFSResult struct + func (bfs *BFSResult[V, E, W]) Distance(v *Vertex[V, E, W]) DistanceT + func (bfs *BFSResult[V, E, W]) Predecessor(v *Vertex[V, E, W]) *Vertex[V, E, W] + func (bfs *BFSResult[V, E, W]) ShortestPath(result []*Vertex[V, E, W], v *Vertex[V, E, W]) []*Vertex[V, E, W] + func (bfs *BFSResult[V, E, W]) WeightedDistance(v *Vertex[V, E, W]) W + type DAGSearchResult struct + func (dags *DAGSearchResult[V, E, W]) ShortestPath(result []*Vertex[V, E, W], v *Vertex[V, E, W]) []*Vertex[V, E, W] + type DFSResult struct + func (dfs *DFSResult[V, E, W]) TopologicalSort(result []*Vertex[V, E, W]) []*Vertex[V, E, W] + type Digraph struct + Vertexes []*Vertex[VertexT, EdgeT, WeightT] + func New[VertexT any, EdgeT any, WeightT Number]() *Digraph[VertexT, EdgeT, WeightT] + func (d *Digraph[V, E, W]) AddEdge(from *Vertex[V, E, W], to *Vertex[V, E, W], value E) + func (d *Digraph[V, E, W]) AddUniqueEdge(from *Vertex[V, E, W], to *Vertex[V, E, W], value E) bool + func (d *Digraph[V, E, W]) AddUniqueEdgeFiltered(from *Vertex[V, E, W], to *Vertex[V, E, W], value E, ...) bool + func (d *Digraph[V, E, W]) AddUniqueWeightedEdge(from *Vertex[V, E, W], to *Vertex[V, E, W], value E, weight W) bool + func (d *Digraph[V, E, W]) AddUniqueWeightedEdgeFiltered(from *Vertex[V, E, W], to *Vertex[V, E, W], value E, weight W, ...) bool + func (d *Digraph[V, E, W]) AddVertex(value V) *Vertex[V, E, W] + func (d *Digraph[V, E, W]) AddWeightedEdge(from *Vertex[V, E, W], to *Vertex[V, E, W], value E, weight W) + func (d *Digraph[V, E, W]) Adjacency(mat *AdjacencyMatrix, a *Vertex[V, E, W], b *Vertex[V, E, W]) int + func (d *Digraph[V, E, W]) AdjacencyMatrix(mat *AdjacencyMatrix) *AdjacencyMatrix + func (d *Digraph[V, E, W]) AdjacencyMatrixFiltered(mat *AdjacencyMatrix, filter func(e *E) bool) *AdjacencyMatrix + func (d *Digraph[V, E, W]) BreadthFirstSearch(bfs *BFSResult[V, E, W], start *Vertex[V, E, W], maxDepth DistanceT, ...) *BFSResult[V, E, W] + func (d *Digraph[V, E, W]) BreadthFirstSearchWeightedGeneral(bfs *BFSResult[V, E, W], start *Vertex[V, E, W]) (*BFSResult[V, E, W], bool) + func (d *Digraph[V, E, W]) ContainsCycles(dfs *DFSResult[V, E, W]) bool + func (d *Digraph[V, E, W]) ContainsLoops(mat *AdjacencyMatrix) bool + func (d *Digraph[V, E, W]) DAGSearchWeighted(dags *DAGSearchResult[V, E, W], start *Vertex[V, E, W], ...) *DAGSearchResult[V, E, W] + func (d *Digraph[V, E, W]) DepthFirstSearch(dfs *DFSResult[V, E, W]) *DFSResult[V, E, W] + func (d *Digraph[V, E, W]) DistanceMatrix(mat *Matrix[int]) *Matrix[W] + func (d *Digraph[V, E, W]) DistanceMatrixFiltered(mat *Matrix[int]) *Matrix[W] + func (d *Digraph[V, E, W]) FindEdge(from *Vertex[V, E, W], to *Vertex[V, E, W]) *Edge[V, E, W] + func (d *Digraph[V, E, W]) FindEdgeFiltered(from *Vertex[V, E, W], to *Vertex[V, E, W], f func(e *E) bool) *Edge[V, E, W] + func (d *Digraph[V, E, W]) Indegree(mat *AdjacencyMatrix, v *Vertex[V, E, W]) int + func (d *Digraph[V, E, W]) Inputs(mat *AdjacencyMatrix, result Path[V, E, W], v *Vertex[V, E, W]) Path[V, E, W] + func (d *Digraph[V, E, W]) IsComplete() bool + func (d *Digraph[V, E, W]) IsFiniteDistance(e DistanceT) bool + func (d *Digraph[V, E, W]) IsFiniteWeightedDistance(w W) bool + func (d *Digraph[V, E, W]) IsForest() bool + func (d *Digraph[V, E, W]) IsInfiniteDistance(e DistanceT) bool + func (d *Digraph[V, E, W]) IsInfiniteWeightedDistance(w W) bool + func (d *Digraph[V, E, W]) IsSimple(mat *AdjacencyMatrix) bool + func (d *Digraph[V, E, W]) IsStronglyConnected() bool + func (d *Digraph[V, E, W]) IsTournament() bool + func (d *Digraph[V, E, W]) IsTree() bool + func (d *Digraph[V, E, W]) IsWeaklyConnected() bool + func (d *Digraph[V, E, W]) Outdegree(mat *AdjacencyMatrix, v *Vertex[V, E, W]) int + func (d *Digraph[V, E, W]) Roots(mat *AdjacencyMatrix, result []*Vertex[V, E, W]) []*Vertex[V, E, W] + func (d *Digraph[V, E, W]) SortEdges(lessThan func(*Vertex[V, E, W], *Edge[V, E, W], *Edge[V, E, W]) bool) + func (d *Digraph[V, E, W]) SortRoots(adjacencyMatrix *AdjacencyMatrix, ...) + func (d *Digraph[V, E, W]) WeightedAdjacency(mat *Matrix[W], a *Vertex[V, E, W], b *Vertex[V, E, W]) W + func (d *Digraph[V, E, W]) WeightedAdjacencyMatrix(mat *Matrix[W], reducer *EdgeWeightReducer[W]) *Matrix[W] + func (d *Digraph[V, E, W]) WeightedAdjacencyMatrixFiltered(mat *Matrix[W], reducer *EdgeWeightReducer[W], filter func(e *E) bool) *Matrix[W] + func (d *Digraph[V, E, W]) WeightedDistanceMatrix(mat *Matrix[int]) *Matrix[W] + func (d *Digraph[V, E, W]) WeightedDistanceMatrixFiltered(mat *Matrix[int]) *Matrix[W] + type DistanceMatrix = Matrix[DistanceT] + type DistanceT int + type Edge struct + Target *Vertex[VertexT, EdgeT, WeightT] + Value EdgeT + Weight WeightT + type EdgeDontCare = any + type EdgeWeightReducer struct + Identity W + Reduce func(W, W) W + func NewEdgeWeightReducerMaximum[W Number]() *EdgeWeightReducer[W] + func NewEdgeWeightReducerMinimum[W Number]() *EdgeWeightReducer[W] + func NewEdgeWeightReducerSum[W Number]() *EdgeWeightReducer[W] + type Matrix struct + type Number interface + type Path []PathVertex[VertexT, EdgeT, WeightT] + type PathVertex struct + Vertex *Vertex[VertexT, EdgeT, WeightT] + Via *Edge[VertexT, EdgeT, WeightT] + type Vertex struct + Edges []Edge[VertexT, EdgeT, WeightT] + Value VertexT + func (v *Vertex[V, E, W]) ID() VertexID + type VertexID int32 + type WeightDontCare = int