Versions in this module Expand all Collapse all v1 v1.0.0 Jun 23, 2026 v0 v0.8.0 Jun 22, 2026 v0.6.0 Jun 17, 2026 v0.5.0 Jun 16, 2026 v0.4.1 Jun 4, 2026 Changes in this version + func AllShortestPaths(graph storage.Storage, sourceID uint64) (map[uint64]int, error) + func AverageClusteringCoefficient(graph *storage.GraphStorage) (float64, error) + func BetweennessCentrality(graph *storage.GraphStorage) (map[uint64]float64, error) + func BetweennessCentralityForTenant(graph *storage.GraphStorage, tenantID string) (map[uint64]float64, error) + func CalculateModularity(graph *storage.GraphStorage, nodeCommunity map[uint64]int) float64 + func ClosenessCentrality(graph *storage.GraphStorage) (map[uint64]float64, error) + func ClusteringCoefficient(graph *storage.GraphStorage) (map[uint64]float64, error) + func DegreeCentrality(graph *storage.GraphStorage) (map[uint64]float64, error) + func HasCycle(graph storage.Storage) (bool, error) + func HasCycleForTenant(graph storage.Storage, tenantID string) (bool, error) + func IsBipartite(graph *storage.GraphStorage) (bool, []uint64, []uint64, error) + func IsConnected(graph *storage.GraphStorage) (bool, error) + func IsDAG(graph *storage.GraphStorage) (bool, error) + func IsTree(graph *storage.GraphStorage) (bool, error) + func NodeSimilarityPair(graph storage.Storage, nodeA, nodeB uint64, opts NodeSimilarityOptions) (float64, error) + func NodeSimilarityPairForTenant(graph storage.Storage, nodeA, nodeB uint64, opts NodeSimilarityOptions, ...) (float64, error) + func PredictLinkScore(graph storage.Storage, fromNodeID, toNodeID uint64, opts LinkPredictionOptions) (float64, error) + func PredictLinkScoreForTenant(graph storage.Storage, fromNodeID, toNodeID uint64, opts LinkPredictionOptions, ...) (float64, error) + func ShortestPath(graph storage.Storage, startID, endID uint64) ([]uint64, error) + func ShortestPathForTenant(graph storage.Storage, startID, endID uint64, tenantID string) ([]uint64, error) + func TopologicalSort(graph *storage.GraphStorage) ([]uint64, error) + func WeightedShortestPath(graph storage.Storage, startID, endID uint64) ([]uint64, float64, error) + type CentralityResult struct + Betweenness map[uint64]float64 + Closeness map[uint64]float64 + Degree map[uint64]float64 + EdgeBetweenness *EdgeBetweennessResult + TopByBetweenness []RankedNode + TopByCloseness []RankedNode + TopByDegree []RankedNode + TopByEdgeBetweenness []RankedEdge + func ComputeAllCentrality(graph *storage.GraphStorage) (*CentralityResult, error) + type Community struct + Density float64 + ID int + Nodes []uint64 + Size int + type CommunityDetectionResult struct + Communities []*Community + Modularity float64 + NodeCommunity map[uint64]int + func ConnectedComponents(graph *storage.GraphStorage) (*CommunityDetectionResult, error) + func LabelPropagation(graph *storage.GraphStorage, maxIterations int) (*CommunityDetectionResult, error) + type CondensationEdge struct + EdgeCount int + FromSCCID int + ToSCCID int + func Condensation(graph storage.Storage, scc *SCCResult) ([]CondensationEdge, error) + type Cycle []uint64 + func DetectCycles(graph storage.Storage) ([]Cycle, error) + func DetectCyclesForTenant(graph storage.Storage, tenantID string) ([]Cycle, error) + func DetectCyclesWithOptions(graph storage.Storage, opts CycleDetectionOptions) ([]Cycle, error) + func DetectCyclesWithOptionsForTenant(graph storage.Storage, opts CycleDetectionOptions, tenantID string) ([]Cycle, error) + type CycleDetectionOptions struct + EdgeTypes []string + MaxCycleLength int + MinCycleLength int + NodePredicate func(*storage.Node) bool + type CycleStats struct + AverageLength float64 + LongestCycle int + SelfLoops int + ShortestCycle int + TotalCycles int + func AnalyzeCycles(cycles []Cycle) CycleStats + type EdgeBetweennessResult struct + ByEdgeID map[uint64]float64 + ByNodePair map[[2]uint64]float64 + TopEdges []RankedEdge + func EdgeBetweennessCentrality(graph *storage.GraphStorage) (*EdgeBetweennessResult, error) + func EdgeBetweennessCentralityForTenant(graph *storage.GraphStorage, tenantID string) (*EdgeBetweennessResult, error) + type KHopOptions struct + Direction NeighborDirection + EdgeTypes []string + MaxHops int + MaxResults int + func DefaultKHopOptions() KHopOptions + type KHopResult struct + ByHop map[int][]uint64 + Distances map[uint64]int + SourceNodeID uint64 + TotalReachable int + func KHopNeighbours(graph storage.Storage, sourceNodeID uint64, opts KHopOptions) (*KHopResult, error) + func KHopNeighboursForTenant(graph storage.Storage, sourceNodeID uint64, opts KHopOptions, tenantID string) (*KHopResult, error) + type LinkPrediction struct + FromNodeID uint64 + Score float64 + ToNodeID uint64 + type LinkPredictionMethod int + const LinkPredAdamicAdar + const LinkPredCommonNeighbours + const LinkPredPreferentialAttachment + type LinkPredictionOptions struct + Direction NeighborDirection + EdgeTypes []string + ExcludeExisting bool + Method LinkPredictionMethod + TopK int + func DefaultLinkPredictionOptions() LinkPredictionOptions + type LinkPredictionResult struct + Predictions []LinkPrediction + SourceNodeID uint64 + func PredictLinksFor(graph storage.Storage, sourceNodeID uint64, opts LinkPredictionOptions) (*LinkPredictionResult, error) + func PredictLinksForForTenant(graph storage.Storage, sourceNodeID uint64, opts LinkPredictionOptions, ...) (*LinkPredictionResult, error) + type NeighborDirection int + const DirectionBoth + const DirectionIn + const DirectionOut + type NodeSimilarityOptions struct + Direction NeighborDirection + EdgeTypes []string + Metric SimilarityMetric + TopK int + func DefaultNodeSimilarityOptions() NodeSimilarityOptions + type NodeSimilarityResult struct + Similar []NodeSimilarityScore + SourceNodeID uint64 + func NodeSimilarityAll(graph storage.Storage, opts NodeSimilarityOptions) ([]NodeSimilarityResult, error) + func NodeSimilarityAllForTenant(graph storage.Storage, opts NodeSimilarityOptions, tenantID string) ([]NodeSimilarityResult, error) + func NodeSimilarityFor(graph storage.Storage, sourceNodeID uint64, opts NodeSimilarityOptions) (*NodeSimilarityResult, error) + func NodeSimilarityForForTenant(graph storage.Storage, sourceNodeID uint64, opts NodeSimilarityOptions, ...) (*NodeSimilarityResult, error) + type NodeSimilarityScore struct + NodeA uint64 + NodeB uint64 + Score float64 + type PageRankOptions struct + DampingFactor float64 + MaxIterations int + Tolerance float64 + func DefaultPageRankOptions() PageRankOptions + type PageRankResult struct + Converged bool + Iterations int + Scores map[uint64]float64 + TopNodes []RankedNode + func PageRank(graph storage.Storage, opts PageRankOptions) (*PageRankResult, error) + func PageRankForTenant(graph storage.Storage, opts PageRankOptions, tenantID string) (*PageRankResult, error) + func (pr *PageRankResult) GetNodeRank(nodeID uint64) float64 + func (pr *PageRankResult) GetTopNodesByPageRank(n int) []RankedNode + type RankedEdge struct + EdgeID uint64 + FromNodeID uint64 + Score float64 + ToNodeID uint64 + type RankedNode struct + Node *storage.Node + NodeID uint64 + Score float64 + type SCCResult struct + LargestSCC *Community + SingletonCount int + func StronglyConnectedComponents(graph storage.Storage) (*SCCResult, error) + func StronglyConnectedComponentsForTenant(graph storage.Storage, tenantID string) (*SCCResult, error) + type SimilarityMetric int + const SimilarityCosine + const SimilarityJaccard + const SimilarityOverlap + type TriangleCountResult struct + ClusteringCoefficients map[uint64]float64 + GlobalCount int + PerNode map[uint64]int + TopNodes []RankedNode + func CountTriangles(graph storage.Storage) (*TriangleCountResult, error) + func CountTrianglesForTenant(graph storage.Storage, tenantID string) (*TriangleCountResult, error)