API Reference ​
Complete API documentation for @graphty/algorithms.
Core ​
Graph ​
The primary data structure for all algorithms.
typescript
import { Graph } from "@graphty/algorithms";
const graph = new Graph<string>();
const directed = new Graph<string>({ directed: true });- Graph API Reference - Complete Graph class documentation
Types ​
TypeScript type definitions for algorithm inputs and outputs.
- Types Reference - All type definitions
Algorithm Categories ​
Traversal ​
Visit nodes in a systematic order.
bfs()- Breadth-First Searchdfs()- Depth-First SearchiterativeDeepeningDfs()- Iterative Deepening DFSbidirectionalSearch()- Bidirectional BFStopologicalSort()- Topological ordering (DAG)
Shortest Path ​
Find optimal paths between nodes.
dijkstra()- Weighted non-negative edgesbellmanFord()- Handles negative weightsfloydWarshall()- All pairs shortest pathsaStar()- Heuristic-guided search
Centrality ​
Measure node importance.
degreeCentrality()- Connection countbetweennessCentrality()- Bridge positionclosenessCentrality()- Proximity to all nodeseigenvectorCentrality()- Influential connectionspageRank()- Link analysishits()- Hub/Authority scoreskatzCentrality()- Influence with base score
Connected Components ​
Find connected subgraphs.
connectedComponents()- Undirected componentsstronglyConnectedComponents()- Directed componentsweaklyConnectedComponents()- Directed (ignoring direction)isConnected()- Check connectivityisStronglyConnected()- Check strong connectivity
Minimum Spanning Tree ​
Find minimum-weight spanning trees.
kruskal()- Kruskal's algorithmprim()- Prim's algorithmminimumSpanningTree()- Auto-selects best algorithm
Community Detection ​
Identify node communities.
louvain()- Fast modularity optimizationgirvanNewman()- Edge betweenness removallabelPropagation()- Near-linear time detectionkCliqueCommunities()- Overlapping communitiesmodularity()- Partition quality measure
Clustering ​
Analyze local graph structure.
clusteringCoefficient()- Local clusteringaverageClusteringCoefficient()- Global averagetransitivity()- Global clusteringtriangles()- Triangle count per nodekCore()- K-core subgraphcoreNumber()- Core decomposition
Flow Algorithms ​
Network flow and cuts.
maxFlow()- Maximum flowfordFulkerson()- Augmenting path methodedmondsKarp()- BFS-based flowminCut()- Minimum cut
Matching ​
Bipartite matching algorithms.
maxBipartiteMatching()- Maximum matchinghungarianAlgorithm()- Weighted matchinghopcroftKarp()- Fast bipartite matching
Link Prediction ​
Predict missing or future edges.
commonNeighbors()- Shared neighborsjaccardCoefficient()- Relative overlapadamicAdar()- Weighted common neighborspreferentialAttachment()- Degree-basedresourceAllocation()- Resource distribution
Data Structures ​
Internal data structures available for advanced use.
PriorityQueue- Min/max heapUnionFind- Disjoint set unionBitSet- Efficient boolean array
typescript
import { PriorityQueue, UnionFind } from "@graphty/algorithms";Generated TypeDoc ​
For complete TypeScript API documentation including all interfaces, types, and function signatures, see the Generated TypeDoc section in the sidebar.