Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong solution result for non square matrix. #10

Closed
Gluttton opened this issue Dec 7, 2013 · 5 comments
Closed

Wrong solution result for non square matrix. #10

Gluttton opened this issue Dec 7, 2013 · 5 comments
Assignees

Comments

@Gluttton
Copy link
Contributor

Gluttton commented Dec 7, 2013

Based on test: MunkresTest.solve_3x2_NonObviousSolutionCase001_Success solution result for non square matrix is wrong.

Possibly reason (in my opinion):

  1. Wrong test case.
  2. Algorithm designed only for square matrix (so special assertion is required).
  3. Error in algorithm.
@ghost ghost assigned saebyn Dec 7, 2013
@saebyn
Copy link
Owner

saebyn commented Dec 7, 2013

This test passes when I disable the row/column minimization functions, so I'm going to start by looking in there to see if that's the problem.

@saebyn
Copy link
Owner

saebyn commented Dec 7, 2013

Nope, I never bothered to add support for non-square input matrices (and now I've discovered that fact), so that seems to have been the problem.

@saebyn saebyn closed this as completed Dec 7, 2013
@saebyn
Copy link
Owner

saebyn commented Dec 7, 2013

Commit ae77d7e adds support for rectangular inputs.

@Gluttton
Copy link
Contributor Author

The problem have not solved completely.

Here is the related issue.
Also commits
0acab86
5b66cd7
were added and related to the issue.

The problem is required more deeper research.

P.S. If input into the Google search field "the assignment problem no" the Google will prompt "n square matrix". So it looks like that such problem is really exists ;) .

@Gluttton Gluttton reopened this Mar 28, 2016
@Gluttton
Copy link
Contributor Author

Gluttton commented Apr 3, 2016

I've simplified test data with preserving their behaviour.
Instead of:

  Matrix<double> etalon_matrix{
    {-1.0, -1.0, -1.0, -1.0},
    { 0.0, -1.0, -1.0, -1.0},
    {-1.0,  0.0, -1.0, -1.0},
    {-1.0, -1.0, -1.0, -1.0},
    {-1.0, -1.0, -1.0,  0.0},
    {-1.0, -1.0,  0.0, -1.0}
  };
  Matrix<double> test_matrix{
    {1.79769e+308, 7.33184e+08,  9.41561e+08,  2.79247e+08},
    {3.06449e+08,  1.79769e+308, 3.3464e+08,   7.06878e+08},
    {9.93296e+08,  1.9414e+08,   1.79769e+308, 1.14174e+08},
    {3.51623e+08,  2.48635e+08,  7.81242e+08,  1.79769e+308},
    {7.02639e+08,  8.51663e+08,  9.37382e+08,  4.96945e+07},
    {7.58851e+08,  8.58445e+08,  8.7235e+07,   5.47076e+08}
  };

I use:

  Matrix<double> etalon_matrix{
    {-1.0, -1.0},
    { 0.0, -1.0},
    {-1.0,  0.0}
  };
  Matrix<double> test_matrix{
    {1.0e+17, 3},
    {2,       1.0e+17},
    {4,       1}
  };

etc...

After playing with simple tests I found out that my test cases for 7x5 and 5x7 matrices was wrong.

So it looks like the problem was fixed with commit 0acab86 .

@Gluttton Gluttton closed this as completed Apr 3, 2016
Gluttton added a commit to Gluttton/munkres-cpp that referenced this issue May 10, 2021
Test: check building of tests,
      $ mkdir build
      $ cd build
      $ cmake -DMUNKRESCPP_DEVEL_MODE=ON ..
      $ make benchmarks
Issue: saebyn#10.
Signed-off-by: Gluttton <[email protected]>
Gluttton added a commit to Gluttton/munkres-cpp that referenced this issue May 10, 2021
Test: check building of tests,
      $ mkdir build
      $ cd build
      $ cmake -DMUNKRESCPP_DEVEL_MODE=ON ..
      $ make benchmarks
Issue: saebyn#10.
Signed-off-by: Gluttton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants