Documentation
¶
Overview ¶
Package graph provides a generic implementation of a Graph data structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph[T any] struct { // for optimization this is public Edges [][]Edge[T] // contains filtered or unexported fields }
Graph is a generic graph structure where each edge holds a value of type T.
func (*Graph[T]) AddEdgeDefault ¶
AddEdgeDefault adds a new edge to the graph with a default value of T.
func (*Graph[T]) AddEdges ¶
AddEdges adds a slice of edges to the graph at the specified vertex int.
func (*Graph[T]) AddEdgesDefault ¶ added in v0.2.0
AddEdgesDefault adds new edges to the graph with a default value of T.
func (*Graph[T]) IsDirected ¶
IsDirected checks and returns whether the graph is directed or not.
Click to show internal directories.
Click to hide internal directories.