GithubHelp home page GithubHelp logo

yongyanghz / lapjv-algorithm-c Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 10.0 20 KB

Jonker-Volgenant / LAPJV algorithm for the linear assignment problem, in C language

C++ 62.46% C 8.36% CMake 29.18%

lapjv-algorithm-c's People

Contributors

conorwilliams avatar yongyanghz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lapjv-algorithm-c's Issues

Misleading comments in example

The comments in the example are misleading:

// A array to store row solution, 0 means not selected, 1 means selected 
// A array to store column solution, 0 means not selected, 1 means selected 

The arrays contain the picked indices within the row/column (so it is not 0 and 1).

Ported to Javascript

Hello, I've just ported your implementation to Javascript here https://github.com/Fil/lap-jv

I had to work around rounding errors that were leading to infinite loops โ€” I don't know if they also appear in the CPP version.

Thank you!

type issues that can lead to possible overflows

During algorithm execution, according to cost nature and range of values in assigncost, some variables can overflow, noticeably d, v.

For instance, if cost is std::uintxx_t I observed that some negative values can occurred when reducing cost. On the tests I did, it happened to work anyway due to modulo arithmetic with integers but I'm not sure that larger overflows can not occur, leading failure in the algorithm.

Even if cost is double or the largest possible integer, some computations may overflow (typically the final total cost).

Besides BIG is not large enough. Why not set it to std::numeric_limits<cost>::max()?

I don't understand the algorithm (neither from the code, nor the original paper) and I'm enable yet to determine if it has properties that limits the range of possible internal values according to input costs range.

Could it be possible to do this analysis and improve the computation safety (wrt overflows)?

Btw, free could be holding booleans? Am I right? And it should be rename as it collisions with a langage keyword.

modernize code

The code is actually almost C and not C++. Would a translation to C++ be feasible (especially using modern data structures instead of dynamically allocated plain arrays)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.