MCPcopy
hub / github.com/arnauddri/algorithms / IsEdge

Method IsEdge

data-structures/graph/graph.go:156–165  ·  view source on GitHub ↗
(from, to VertexId)

Source from the content-addressed store, hash-verified

154}
155
156func (g *graph) IsEdge(from, to VertexId) bool {
157 connected, ok := g.edges[from]
158
159 if !ok {
160 return false
161 }
162
163 weight := connected[to]
164 return weight > 0
165}
166
167func (g *graph) Order() int {
168 return len(g.edges)

Callers 4

GetPredecessorsMethod · 0.95
GetSuccessorsMethod · 0.95
TestUndirectedGraphFunction · 0.80
TestDirectedGraphFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestUndirectedGraphFunction · 0.64
TestDirectedGraphFunction · 0.64