go-algs

module
v0.0.0-...-fe23fab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2018 License: BSD-2-Clause-Views

README

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

Directories

Path Synopsis
ed package provides some functions for generalized edit-distance calculation.
ed package provides some functions for generalized edit-distance calculation.
Maxflow package implements the max-flow(min-cuts, graph-cuts) algorithm that is used to solve the labeling problem in computer vision or graphics area.
Maxflow package implements the max-flow(min-cuts, graph-cuts) algorithm that is used to solve the labeling problem in computer vision or graphics area.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL