Commit Graph

101 Commits

Author SHA1 Message Date
Michael Neumann
beef90e23b Update dependencies 2021-01-07 15:50:40 +01:00
Michael Neumann
222bd48e55 0.5.1 - include benches 2019-04-07 18:09:34 +02:00
Michael Neumann
03f14a174b Version 0.5.0 2019-04-07 17:34:13 +02:00
Michael Neumann
44026fb680 Refactor control flow of algorithm
* Get rid of enum Step
* Instead more explicity encode the control flow.
2019-04-07 17:30:57 +02:00
Michael Neumann
bd8728ce2f Fix infinte loop in case Matrix is not solvable. 2019-04-07 16:46:54 +02:00
Michael Neumann
7e07dd5941 Fix unsolvable bug, add more tests
If a column contains only invalid (e.g. infinite) weights, we cannot
solve that matrix. This resulted in an infinite loop.
2019-04-07 16:22:04 +02:00
Michael Neumann
8f04199cc0 Cleanup test cases 2019-04-07 15:25:43 +02:00
Michael Neumann
b7aedb5b3f Add WeightNum#{add_if_valid, sub_if_valid) and use them 2019-04-07 14:44:34 +02:00
Michael Neumann
fe2d4bb8af Rename WeightNum#is_disallowed() to #is_valid() 2019-04-07 14:40:15 +02:00
Michael Neumann
a870cb4cc7 MarkMatrix - Refactor 2019-04-07 14:32:22 +02:00
Michael Neumann
ec53b07747 Get rid of MarkMatrix trait again 2019-04-07 13:34:37 +02:00
Michael Neumann
10ec98b791 Fix bug in MarkMatrixBitArray 2019-04-07 13:24:48 +02:00
Michael Neumann
881bb16f65 Use FixedBitSet#ones() iterator
Improves performance by about 5%
2019-04-07 12:18:56 +02:00
Michael Neumann
841fc0c4da Use FixedBitSet#ones() iterator and rename function again
Improves performance by about 10%.
2019-04-07 12:08:38 +02:00
Michael Neumann
aa33d76281 Rename function 2019-04-07 12:00:00 +02:00
Michael Neumann
bf353be676 Invert logic in Coverage "matrix"
The idea here is to use FixedBitSet#ones() iterator in the next commit.
2019-04-07 11:55:18 +02:00
Michael Neumann
417ccc2c9f Run benchmark with N=50
N=100 takes too long (~350 seconds) when running with criterion.rs and I
don't know how to limit the number of samples taken (100).
2019-04-07 11:48:22 +02:00
Michael Neumann
8adec9a9ee Coverage: rename {rows, columns} -> covered_{rows, columns} 2019-04-07 11:23:17 +02:00
Michael Neumann
16bc0a7cbd Refactor Coverage 2019-04-07 11:19:54 +02:00
Michael Neumann
44847c04e1 Breaking API - Return Vec<Position> from solve_assignment()
Also simplify some test cases.
2019-04-07 11:02:57 +02:00
Michael Neumann
9ec92b7bff Refactor - breaking changes to API
* Rename col -> column in parameters and method names.

* Replace (usize, usize) by struct Position. This makes it more explicit
  what the row and column index is.

* Make MarkMatrix a trait and provide two implementation
  MarkMatrixByteArray and MarkMatrixBitArray.

* Add solve_assignment_generic which can be used with an alternative
  MarkMatrix implementation
2019-04-07 10:35:52 +02:00
Michael Neumann
0a9551aaf1 Upgrade ndarray version 2019-04-06 22:53:44 +02:00
Michael Neumann
9be159c4fd Use criterion for benchmarks
We no longer need nightly rust to run benchmarks (or tests).
2019-04-06 20:36:00 +02:00
Michael Neumann
c1b4498a65 Rust rustfmt 2019-04-06 20:10:57 +02:00
Michael Neumann
9ef1acacd8 Use WeightNum into separate module 2019-04-06 20:10:41 +02:00
Michael Neumann
2824a1123f Changes for Cargo edition 2018 2019-04-06 20:05:22 +02:00
Michael Neumann
d52fb6c257 And avoid line breaks within the string 2018-02-05 10:13:45 +01:00
Michael Neumann
5ed0b6b394 Slightly shorten the description 2018-02-05 10:12:59 +01:00
Michael Neumann
812942832b Release version 0.4.0 2018-01-30 15:17:12 +01:00
Michael Neumann
73910f7dde Return Error enum instead of static str 2018-01-30 15:16:47 +01:00
Michael Neumann
c7dd965658 Get rid of panics. Return Result instead 2018-01-30 15:12:51 +01:00
Michael Neumann
46599ee62a Reformat source code using "cargo fmt" 2018-01-30 15:09:27 +01:00
Michael Neumann
75f19c85cd Document time complexity O(n^3) of the algorithm 2018-01-30 15:03:03 +01:00
Michael Neumann
4e6ba86258
Merge pull request #6 from mjkillough/disallowed
Support for disallowed assignments.
2018-01-30 14:51:37 +01:00
Michael Neumann
fcdd4e4b79
Merge pull request #5 from Antti/switch-to-ndarray
Switch to ndarray crate for the SquareMatrix
2018-01-30 12:41:41 +01:00
Michael Killough
d3e2c23415 Support for disallowed assignments.
Add support for disallowed assignments, and include a check to avoid
attempting to solve unsolvable matrices (where a row only has disallowed
values).

For now only allow `f32`/`f64`, as we can use `INFINITY` to encode a
disallowed assignment.

This is a re-implementation of most of bmc/munkres#20, but is missing
the changes to `step6`, which attempt to detect when we're not making
progress. I couldn't implement this without regressing performance and I
am not sure they add much given we're checking `is_solvable()` before
attempting to solve.
2017-11-07 12:21:19 +00:00
Andrii Dmytrenko
ad0d85a2c4 Remove square_matrix module 2017-11-07 11:26:00 +00:00
Michael Neumann
9596e3eef1 Merge pull request #4 from olleolleolle/patch-1
README: Use SVG for shiny badge
2017-10-25 16:57:42 +02:00
Andrii Dmytrenko
092818ab88 Use ndarray to implement SquareMatrix 2017-10-16 16:34:14 +01:00
Olle Jonsson
9a52140c0c README: Use SVG for shiny badge
- [ci skip]
2017-08-22 16:06:53 +02:00
Michael Neumann
b34aa6b2eb Remove unstable feature zero_one (Zero trait)
This allows this library to be build with a stable Rust release.
2016-07-16 13:40:13 +02:00
Michael Neumann
5f90104607 Update version to 0.2.0 2016-02-27 22:48:09 +01:00
Michael Neumann
9e72192398 Slightly improve performance by reusing path 2016-02-27 22:43:08 +01:00
Michael Neumann
ba128c0c93 Add is_zero() to trait WeightNum 2016-02-27 22:36:04 +01:00
Michael Neumann
ed7c417013 Remove benchmarks with 1000 or 2000. It's too slow 2016-02-27 22:30:53 +01:00
Michael Neumann
7ab7269164 Some minor changes 2016-02-27 22:30:06 +01:00
Michael Neumann
92b390ce88 Add some more test cases which detected the bug fix in
51c5b7638f
2016-02-27 20:46:35 +01:00
Michael Neumann
7feb1fcdaf unmark() need not be public. 2016-02-27 20:45:46 +01:00
Michael Neumann
a3a79cc599 Add some more debug assertions 2016-02-27 20:45:11 +01:00
Michael Neumann
51c5b7638f BUG FIX! If we cover a row and column, we have to leave the column
loop.

This degrades performance by a LOT!
2016-02-27 20:44:02 +01:00