Documentation
¶
Index ¶
- func Giant[V comparable](g gograph.Graph[V]) (gograph.Graph[V], error)
- func Invert[V comparable](graph gograph.Graph[V]) gograph.Graph[V]
- func InvertWeight[V comparable](graph gograph.Graph[V]) gograph.Graph[V]
- func Keep[V comparable](g gograph.Graph[V], toKeep []V) (gograph.Graph[V], error)
- func MST[K comparable](graph gograph.Graph[K]) (gograph.Graph[K], *union.UnionFind[K])
- func Mimic[K comparable](g gograph.Graph[K], overrideOptions ...gograph.GraphOptionFunc) gograph.Graph[K]
- func Purge[V comparable](g gograph.Graph[V], toRemove []V) (gograph.Graph[V], error)
- func RemoveCycles[V comparable](g gograph.Graph[V]) (gograph.Graph[V], error)
- func RemoveDangling[V comparable](g gograph.Graph[V]) (gograph.Graph[V], error)
- func ReverseTopologicalOrder[V comparable](graph gograph.Graph[V]) ([]*gograph.Vertex[V], error)
- func TopologicalOrder[V comparable](graph gograph.Graph[V]) ([]*gograph.Vertex[V], error)
- func Undirected[V comparable](g gograph.Graph[V]) (gograph.Graph[V], error)
- func WeaklyConnectedComponents[T comparable](g gograph.Graph[T]) ([][]*gograph.Vertex[T], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Giant ¶
Giant returns the giant component of the graph. The giant component is the largest connected component of the graph. If the graph is directed, it returns the largest strongly connected component.
func Invert ¶
func Invert[V comparable](graph gograph.Graph[V]) gograph.Graph[V]
Invert inverts the direction of the edges in the graph.
func InvertWeight ¶ added in v0.1.0
func InvertWeight[V comparable](graph gograph.Graph[V]) gograph.Graph[V]
InvertWeight returns a new graph with the same vertices and edges as the original graph, but with the weights inverted using an exponential kernel function.
func Mimic ¶
func Mimic[K comparable](g gograph.Graph[K], overrideOptions ...gograph.GraphOptionFunc) gograph.Graph[K]
Mimic returns a new graph with the same properties as the original graph.
func RemoveCycles ¶
RemoveCycles returns a graph with its cycles removed. The returned graph is a DAG.
func RemoveDangling ¶
RemoveDangling returns a new graph with no dangling vertices
func ReverseTopologicalOrder ¶
ReverseTopologicalOrder returns the reverse topological order of the graph.
func TopologicalOrder ¶
TopologicalOrder returns the topological order of the graph.
func Undirected ¶
Undirected returns a new graph with the same vertices and edges as the original graph, but with all edges undirected.
func WeaklyConnectedComponents ¶
WeaklyConnectedComponents returns the weakly connected components of the graph.
Types ¶
This section is empty.