Discover Packages
github.com/kaeawc/krit
internal
graph
package
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: May 11, 2026
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
FanIn returns the in-degree for every node in the graph.
FanOut returns the out-degree for every node in the graph.
FindSCCs returns strongly connected components with size > 1 using
Tarjan's algorithm. Each SCC is sorted alphabetically, and the list
of SCCs is sorted by first element for deterministic output.
Graph is a directed graph with string-labeled nodes.
NewGraph creates an empty directed graph.
AddEdge adds a directed edge from -> to, creating both nodes if absent.
AddNode adds a node to the graph. Duplicate calls are safe.
Neighbors returns the sorted successors of a node.
Nodes returns all node names sorted alphabetically.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.