grf
Graph data structure and algorithms.
Load with: use grf
Quick example
use grf
result = grfne("value")
prn(result)
Functions
Graph
grfne(dr)
Creates a new instance. Takes dr.
grfdn(g, id, dt)
Performs the operation. Takes g, id, dt.
grfrm(g, id)
Removes an item. Takes g, id.
grfnd(g, id)
Performs the operation. Takes g, id.
grfnb(g, id)
Performs the operation. Takes g, id.
grfed(g)
Performs the operation. Takes g.
Traversal
grfbf(g, st, fn)
Performs the operation. Takes g, st, fn.
grfd0(g, st, fn)
Performs the operation. Takes g, st, fn.
grfdf(g, cid, fn, vs)
Performs the operation. Takes g, cid, fn, vs.
Shortest path
grfdj(g, sr)
Performs the operation. Takes g, sr.
grfpt(g, sr, tg, ps)
Performs the operation. Takes g, sr, tg, ps.
MST
grfpr(g)
Processes or prints. Takes g.
Cycle detection
grfcy(g)
Performs the operation. Takes g.
grfc1(g, cid, vs, rs, pa)
Performs the operation. Takes g, cid, vs, rs, pa.
Topological sort
grftp(g)
Performs the operation. Takes g.
Components
grfcc(g)
Performs the operation. Takes g.
grfc0(g, cid, vs, cm)
Performs the operation. Takes g, cid, vs, cm.
Notes
- Graph data structures - nodes, edges, traversal (BFS/DFS), shortest path.