This commit is contained in:
MindfulMinun committed 2022-08-01 02:44:17 -05:00
1 parent bb4b783537
commit e273396609
3 files changed
+220 -7

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { Graph } from '../tools/graph.ts'
// TODO: Add real tests!
const G = new Graph<string, string>()
const a = G.createVertex('A')
const b = G.createVertex('B')
const c = G.createVertex('C')
G.createEdge(a, b, 'a-b')
G.createEdge(b, c, 'b-c')
G.createEdge(c, a, 'c-a')
// console.log(G)
console.log(JSON.stringify(G))
console.log(Graph.fromJSON(
JSON.parse(JSON.stringify(G, null, 4))
))