Some algorithms in go: maxflow(min-cuts or graph-cuts), edit-distance.

Overview

Algorithms

In this repository, some algorithms are implemented in go language.

GoDoc link: ed maxflow

About Max-flow problem:

A flow network is represented in a directed acyclic graph(DAG). Each edge has a nonnegative capacity, to which the flow is limited. There are a source node s and a sink node t. s has no incoming edges, and t has no outgoing edges. All other nodes are internal nodes, in which the amount of incoming flow must equal to the amount of ougoing flow. The goal of the max-flow problem is, given a flow network, to find a flow of maximum value.

max-flow GoSearch

This package implements the max-flow(min-cuts, graph-cuts) algorithm that is used to solve the labeling problem in computer vision or graphics area.

Usage:

    g := maxflow.NewGraph()
    
    nodes := make([]*maxflow.Node, 2)
    
    for i := range(nodes) {
        nodes[i] = g.AddNode()
    } // for i
    
    g.SetTweights(nodes[0], 1, 5)
    g.SetTweights(nodes[1], 2, 6)
    g.AddEdge(nodes[0], nodes[1], 3, 4)
    
    g.Run();

    flow := g.Flow()

    isSource0 := g.IsSource(nodes[0])

ed GoSearch

This package implements the edit-distance algorithm that is used to compute the similarity between two strings, or more generally defined lists.

  1. For computing the standard edit-distance of two strings, call ed.String or ed.StringFull function.

  2. For generally defined lists, implement the ed.Interface, and use ed.EditDistance or ed.EditDistanceFull function.

LICENSE

BSD license

You might also like...
Go implementation to calculate Levenshtein Distance.

levenshtein Go package to calculate the Levenshtein Distance The library is fully capable of working with non-ascii strings. But the strings are not n

:pushpin: State of the art point location and neighbour finding algorithms for region quadtrees, in Go
:pushpin: State of the art point location and neighbour finding algorithms for region quadtrees, in Go

Region quadtrees in Go Region quadtrees and efficient neighbour finding techniques in Go Go-rquad proposes various implementations of region quadtrees

Go implementation of C++ STL iterators and algorithms.

iter Go implementation of C++ STL iterators and algorithms. Less hand-written loops, more expressive code. README translations: 简体中文 Motivation Althou

Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching.

Trie Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching. Usage Create a Trie with: t := trie.New() Add Keys with:

Data Structure Libraries and Algorithms implementation

Algorithms Data Structure Libraries and Algorithms implementation in C++ Disclaimer This repository is meant to be used as a reference to learn data s

 Data structure,Algorithms implemented in Go (for education)
Data structure,Algorithms implemented in Go (for education)

Data structure,Algorithms implemented in Go (for education) List of Content : 1. Math - 2. String - 3. Conversions - 4. Sort - 5. Search - 6. Data str

Tree algorithms in Golang

Tree Algorithms in Golang This is my humble attempt to share some of the tree algorithms in Golang. Pull requests are always welcome! :) Contents Tree

Algorithms and Data Structures Solved in Golang

Algorithms and Data Structures Solved in Golang Hi! I'm Bruno Melo and this repository contains a lot challenges solved on many plataforms using go as

Golang examples of algorithms according to its time complexity.

big-o-notation-go Examples of algorithms and explanation for each Big O Notation category. Some examples are based in this video. If you didn't manage

Releases(1.9.4)
Owner
Yi Deng
Yi Deng
Levenshtein distance and similarity metrics with customizable edit costs and Winkler-like bonus for common prefix.

A Go package for calculating the Levenshtein distance between two strings This package implements distance and similarity metrics for strings, based o

AGExt 74 Dec 15, 2022
Go implementation of Count-Min-Log

Count-Min-Log Count-Min-Log sketch: Approximately counting with approximate counters - Guillaume Pitel & Geoffroy Fouquier TL;DR: Count-Min-Log Sketch

Seif Lotfy 59 Jan 4, 2023
Go translations of the algorithms and clients in the textbook Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

Overview Go translations of the Java source code for the algorithms and clients in the textbook Algorithms, 4th Edition by Robert Sedgewick and Kevin

youngzy 175 Dec 13, 2022
Graph algorithms and data structures

Your basic graph Golang library of basic graph algorithms Topological ordering, image by David Eppstein, CC0 1.0. This library offers efficient and we

Algorithms to Go 616 Jan 2, 2023
Graph algorithms written in Go

Graph Algorithms in Go This repository contains implementations of various graph algorithms written in Go. I’ve written them to learn about these algo

Thomas Cyron 59 Dec 26, 2022
Graph algorithms and data structures

Your basic graph Golang library of basic graph algorithms Topological ordering, image by David Eppstein, CC0 1.0. This library offers efficient and we

Algorithms to Go 9 Jan 25, 2021
fim is a collection of some popular frequent itemset mining algorithms implemented in Go.

fim fim is a collection of some popular frequent itemset mining algorithms implemented in Go. fim contains the implementations of the following algori

Paul Fedorow 7 Jul 14, 2022
Some data structures and algorithms using golang

Some data structures and algorithms using golang

null 62 Aug 13, 2022
This repo is where I'll be attempting to capture some generic algorithms written in Go

Go Generic Algorithms Welcome friends! ?? This repo is where I'll be attempting

TutorialEdge 27 Apr 13, 2022
A Connected Graph Generator tool that construct graphs of some given size

graph graph is a Connected Graph Generator tool that construct graphs of some given size. Notice that it generates all possible connected, undirected

Nicolas A Perez 0 Nov 5, 2021