All Projects → heetch → Lapjv

heetch / Lapjv

Licence: mit
Go implementation of the LAPJV algorithm

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Lapjv

Lab Notes
😍 有趣的想法 & 有意思灵感 & 小算法实验室,犄角旮旯乱七八糟代码杂货铺,新奇好玩都在这里。
Stars: ✭ 37 (-26%)
Mutual labels:  algorithm
Awesome Competitive Programming
💎 A curated list of awesome Competitive Programming, Algorithm and Data Structure resources
Stars: ✭ 9,119 (+18138%)
Mutual labels:  algorithm
Algorithmmap
建立你的算法地图:如何高效学习算法;算法工程师:从小白到专家
Stars: ✭ 47 (-6%)
Mutual labels:  algorithm
Awesome Algorithm Question Solution
LeetCode,《剑指offer》中的算法题的题目和解法以及常见算法的实现
Stars: ✭ 988 (+1876%)
Mutual labels:  algorithm
Simple Cryptography
Scripts that illustrate basic cryptography concepts based on Coursera Standford Cryptography I course and more.
Stars: ✭ 40 (-20%)
Mutual labels:  algorithm
Wyhash Rs
wyhash fast portable non-cryptographic hashing algorithm and random number generator in Rust
Stars: ✭ 44 (-12%)
Mutual labels:  algorithm
Data Structures Questions
golang sorting algorithm and data construction.
Stars: ✭ 977 (+1854%)
Mutual labels:  algorithm
Vsalert
An drop-in replacement for UIAlertController with more power and better looks.
Stars: ✭ 48 (-4%)
Mutual labels:  algorithm
Algorithms And Data Structures
Algorithms and Data Structures implemented in Java
Stars: ✭ 41 (-18%)
Mutual labels:  algorithm
Al Go Rithms
🎵 Algorithms written in different programming languages - https://zoranpandovski.github.io/al-go-rithms/
Stars: ✭ 1,036 (+1972%)
Mutual labels:  algorithm
Vchsm
C++ 11 algorithm implementation for voice conversion using harmonic plus stochastic models
Stars: ✭ 38 (-24%)
Mutual labels:  algorithm
Ios Crosswords Generator
A simple algorithm for generating crosswords written on Swift. Based on Python Crossword Puzzle Generator.
Stars: ✭ 40 (-20%)
Mutual labels:  algorithm
Flatbush
A very fast static spatial index for 2D points and rectangles in JavaScript
Stars: ✭ 1,031 (+1962%)
Mutual labels:  algorithm
Gpwfc
openCL-accelerated python implementation of the Wave Function Collapse procgen algorithm
Stars: ✭ 37 (-26%)
Mutual labels:  algorithm
Leetcode
正确的姿势,学习的态度来刷 LeetCode:高效的代码、简洁的注释、精炼的总结。
Stars: ✭ 1,043 (+1986%)
Mutual labels:  algorithm
Google Hash Code 2020
More Pizza : Solution for the Practice Round of Google Hash Code 2020
Stars: ✭ 36 (-28%)
Mutual labels:  algorithm
Algorithms
Solved algorithms and data structures problems in many languages
Stars: ✭ 1,021 (+1942%)
Mutual labels:  algorithm
Algo Explorer
Android app for learning algorithms in Computer Science
Stars: ✭ 49 (-2%)
Mutual labels:  algorithm
Data Structure And Algorithms
A complete and efficient guide for Data Structure and Algorithms.
Stars: ✭ 48 (-4%)
Mutual labels:  algorithm
Jobinterviewalgorithms
A directory of classic algorithms that you will find when interviewing for software engineering jobs.
Stars: ✭ 46 (-8%)
Mutual labels:  algorithm

LAPJV - Go Implementation

GoDoc

This repository is the Golang implementation of the LAPJV algorithm for assignment problem and includes tools to ease testing and library usage.


Overview

The repository contains the library that solves a matrix using the LAPJV algorithm. It also contains a wrapper divided in two:

  • A generator that generates a matrix and saves it on a file.
  • A solver that uses a file containing a matrix.

These two commands are available over the CLI. The solver can also be used directly as explained below.

Installation

The library can be installed using the go get command:

$ go get github.com/heetch/lapjv/...

Library

Include Lapjv in your project:

import "github.com/heetch/lapjv"

Tool

You now can use the lapjv command and see the usage. (If nothing appears check that the $GOPATH/bin folder is in your PATH env variable.

Getting Started

Using the Library

package main

import (
        "fmt"
        "math/rand"

        "github.com/heetch/lapjv"
)

func main() {

        // Create your matrix here and fill it with values.
        m := make([][]int, 10)
        for i := 0; i < 10; i++ {
                m[i] = make([]int, 10)
                for j := 0; j < 10; j++ {

                        // You could fill your matrix here with cost values
                        m[i][j] = rand.Intn(10000)
                }
        }

        res := lapjv.Lapjv(m)

        //Here you now can use fields of the res variable to check the result.
        //Fields are:
        // - Cost: the cost of the resolution
        // - InRow: the solution, based on rows.
        // - InCol: the solution, based on cols.

        fmt.Println(res.Cost)
}

Using the Tool

Usage: Usage

Generator

The generator can be used, in the simplest way, with:

$ lapjv generator

This command will generate a file named example.json with the JSON format of a 10*10 randomly filled matrix.

Interactive mode

You can use the interactive mode to specify options of the matrix you want to generate:

$ lapjv generator -i

This mode also generates an example.json file in the current directory.

Manual mode

You can use the manual mode to specify options of the matrix you want to generate:

$ lapjv generator -s size -t constant

This mode generates an example.json file in the current directory using only options given as parameter.

Specifying an output file

You can specify the file in which you want to write the matrix using the -f option. This option is available in both manual and interactive modes. You can do it with:

$ lapjv generator -f filename

This one option can be combined with ones above.

Solver

The solver can be used using:

$ lapjv solver

You can launch it without any option. In this case , the solver will read from the stdin, waiting for a JSON-formated matrix.

Using with the generator

You can generate a matrix and solve it in the same time using options of the generator.

Example:

$ lapjv solver -i

This command will prompt you for options and solve the matrix just after.

Issue

Please open issues if you encounter any problem.

License

The library is released under the MIT license. See LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].