@crstrskp/graph
Version:
High-performance TypeScript graph algorithms library optimized for trading bots and arbitrage detection
47 lines • 1.85 kB
TypeScript
import { Edge } from "./Edge";
import { Vertex } from './Vertex';
import { Path } from "./Path";
export declare class ThreadSafeGraphImpl {
private edges;
private vertices;
private vertexMap;
protected readWriteLock: ReadWriteLock;
constructor();
bellmanFord(src: Vertex): Promise<Map<Vertex, number>>;
protected bellmanFordInternal(src: Vertex): Map<Vertex, number>;
dijkstra_shortestPath(src: Vertex, dest: Vertex): Promise<Path>;
protected dijkstraInternal(src: Vertex, dest: Vertex): Path;
insertVertex(o: any): Promise<Vertex>;
protected insertVertexInternal(o: any): Vertex;
insertEdge(v: Vertex, w: Vertex, o: any): Promise<Edge>;
protected insertEdgeInternal(v: Vertex, w: Vertex, o: any): Edge;
removeVertex(v: Vertex): Promise<void>;
protected removeVertexInternal(v: Vertex): void;
removeEdge(e: Edge): Promise<void>;
protected removeEdgeInternal(e: Edge): void;
getVertexByLabel(label: string): Promise<Vertex | undefined>;
getAllVertices(): Vertex[];
getAllEdges(): Edge[];
getIncidentEdges(v: Vertex): Edge[];
getIncidentStartEdges(v: Vertex): Edge[];
getIncidentEndEdges(v: Vertex): Edge[];
getOpposite(v: Vertex, e: Edge): Vertex | undefined;
getVertices(e: Edge): Vertex[];
getAdjacentVertices(v: Vertex): Vertex[];
areAdjacent(v: Vertex, w: Vertex): boolean;
isOfTypeVertex(input: any): boolean;
}
declare class ReadWriteLock {
private readers;
private writers;
private readQueue;
private writeQueue;
withReadLock<T>(fn: () => Promise<T> | T): Promise<T>;
withWriteLock<T>(fn: () => Promise<T> | T): Promise<T>;
private acquireReadLock;
private releaseReadLock;
private acquireWriteLock;
private releaseWriteLock;
}
export {};
//# sourceMappingURL=ThreadSafeGraphImpl.d.ts.map