MCPcopy Index your code
hub / github.com/gonum/plot / newTarjan

Function newTarjan

plotter/johnson.go:136–150  ·  view source on GitHub ↗

newTarjan returns a tarjan with the sccs field filled with the strongly connected components of the directed graph g.

(g graph)

Source from the content-addressed store, hash-verified

134// newTarjan returns a tarjan with the sccs field filled with the
135// strongly connected components of the directed graph g.
136func newTarjan(g graph) *tarjan {
137 t := tarjan{
138 g: g,
139
140 indexTable: make([]int, len(g)),
141 lowLink: make([]int, len(g)),
142 onStack: make([]bool, len(g)),
143 }
144 for v := range t.g {
145 if t.indexTable[v] == 0 {
146 t.strongconnect(v)
147 }
148 }
149 return &t
150}
151
152// strongconnect is the strongconnect function described in the
153// wikipedia article.

Callers 2

cyclesInFunction · 0.85
TestTarjanFunction · 0.85

Calls 1

strongconnectMethod · 0.95

Tested by 1

TestTarjanFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…