MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / AddEdge

Method AddEdge

graph/graph.go:36–39  ·  view source on GitHub ↗

AddEdge will add a new edge between the provided vertices in the graph

(one, two int)

Source from the content-addressed store, hash-verified

34
35// AddEdge will add a new edge between the provided vertices in the graph
36func (g *Graph) AddEdge(one, two int) {
37 // Add an edge with 0 weight
38 g.AddWeightedEdge(one, two, 0)
39}
40
41// AddWeightedEdge will add a new weighted edge between the provided vertices in the graph
42func (g *Graph) AddWeightedEdge(one, two, weight int) {

Callers 4

FindAllCyclesMethod · 0.95
TestHasCycleFunction · 0.95
TestFindAllCyclesFunction · 0.95
KahnFunction · 0.95

Calls 1

AddWeightedEdgeMethod · 0.95

Tested by 2

TestHasCycleFunction · 0.76
TestFindAllCyclesFunction · 0.76