MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / buildDiamondGraph

Function buildDiamondGraph

internal/graph/graph_test.go:11–22  ·  view source on GitHub ↗

buildDiamondGraph creates: A→B, A→C, B→D, C→D

()

Source from the content-addressed store, hash-verified

9
10// buildDiamondGraph creates: A→B, A→C, B→D, C→D
11func buildDiamondGraph() (*Graph[string, string], [4]NodeIndex) {
12 g := New[string, string]()
13 a := g.AddNode("A")
14 b := g.AddNode("B")
15 c := g.AddNode("C")
16 d := g.AddNode("D")
17 g.AddEdge(a, b, "ab")
18 g.AddEdge(a, c, "ac")
19 g.AddEdge(b, d, "bd")
20 g.AddEdge(c, d, "cd")
21 return g, [4]NodeIndex{a, b, c, d}
22}
23
24// buildChainGraph creates: A→B→C
25func buildChainGraph() (*Graph[string, string], [3]NodeIndex) {

Callers 11

TestIterationFunction · 0.85
TestQueryingFunction · 0.85
TestNeighborhoodFunction · 0.85
TestExternalsFunction · 0.85
TestTransformationsFunction · 0.85
TestCloneFunction · 0.85
TestDFSFunction · 0.85
TestDFSPostOrderFunction · 0.85
TestBFSFunction · 0.85
TestTopoFunction · 0.85
TestIsAcyclicFunction · 0.85

Calls 3

AddNodeMethod · 0.80
AddEdgeMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected