buildChainGraph creates: A→B→C
()
| 23 | |
| 24 | // buildChainGraph creates: A→B→C |
| 25 | func buildChainGraph() (*Graph[string, string], [3]NodeIndex) { |
| 26 | g := New[string, string]() |
| 27 | a := g.AddNode("A") |
| 28 | b := g.AddNode("B") |
| 29 | c := g.AddNode("C") |
| 30 | g.AddEdge(a, b, "ab") |
| 31 | g.AddEdge(b, c, "bc") |
| 32 | return g, [3]NodeIndex{a, b, c} |
| 33 | } |
| 34 | |
| 35 | // collectValues collects the values from an iter.Seq2 into a slice. |
| 36 | func collectValues[K comparable, V any](seq iter.Seq2[K, V]) []V { |