Skip to content
/ scc Public

scc function returns an array of leader nodes with graph

Notifications You must be signed in to change notification settings

chasestarr/scc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

import (
  "fmt"

  "github.com/chasestarr/scc"
  "github.com/chasestarr/scc/graph"
)

func main() {
  g := graph.New()
	g.AddNode(1)
	g.AddNode(2)
	g.AddNode(3)
	g.AddNode(4)
	g.AddNode(5)
	g.AddEdge(2, 1)
	g.AddEdge(1, 3)
	g.AddEdge(3, 2)
	g.AddEdge(1, 4)
	g.AddEdge(4, 5)
	sscs := scc.Search(g)
	fmt.Println(len(sccs)) // 3
}

About

scc function returns an array of leader nodes with graph

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages