A Graph is a collection of nodes (vertices) and edges that connect pairs of nodes, used to represent relationships between objects.
import { Graph } from "collection-kit";
import { Graph } from "collection-kit";
const graph = new Graph();
graph.addVertex("A");
graph.addVertex("B");
graph.addVertex("C");
graph.addEdge("A", "B");
graph.addEdge("B", "C");
console.log("Neighbors of B:", graph.getNeighbors("B"));