Coder Social home page Coder Social logo

Unexpected output about hungarian-algorithm HOT 3 OPEN

benchaplin avatar benchaplin commented on August 17, 2024
Unexpected output

from hungarian-algorithm.

Comments (3)

PascalEconomouCoupa avatar PascalEconomouCoupa commented on August 17, 2024

I am also having the same problem. I tried to recreate it as simply as possible:

from hungarian_algorithm import algorithm

G = {
    0: {2: 4, 3: 6}, 
    1: {2: 5, 3: 7}
}

print(algorithm.find_matching(G, matching_type = 'max', return_type = 'list'))

Output:

[((1, 3), 7), ((0, 3), 6)]

On the other hand, it seems to work when I use the exact same graph structure, but I instead make the nodes str objects (though I cannot say for sure as I have not tested many examples):

H = {
    'a': {'c': 4, 'd': 6}, 
    'b': {'c': 5, 'd': 7}
}

print(algorithm.find_matching(H, matching_type = 'max', return_type = 'list'))

Output:

[(('a', 'c'), 4), (('b', 'd'), 7)]

from hungarian-algorithm.

pukanc avatar pukanc commented on August 17, 2024

Alright, thank you :)

from hungarian-algorithm.

PascalEconomouCoupa avatar PascalEconomouCoupa commented on August 17, 2024

I should mention that that I still think this is an open issue. You would expect the algorithm to work with integer nodes, and it would be a bit inconvenient to need to convert to str. Plus, it is still not entirely clear if the same problems arise with str , as it hasn't been tested.

from hungarian-algorithm.

Related Issues (7)

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.