Skip to content

chasestarr/mincut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

import (
  "fmt"

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

func main() {
  g := graph.New()
	g.AddEdge(0, 1)
	g.AddEdge(0, 2)
	g.AddEdge(0, 3)
	g.AddEdge(1, 3)
	g.AddEdge(1, 0)
	g.AddEdge(2, 0)
	g.AddEdge(2, 3)
	g.AddEdge(3, 0)
	g.AddEdge(3, 1)
	g.AddEdge(3, 2)
	g.Vertices = 4
	fmt.Println(mincut.Karger(g, true)) // 2 or 3
}

Releases

No releases published

Packages

No packages published

Languages