How do I unit test a heuristic algorithm?

So, I wrote an implementation of the wo2 optimization meta-heuristic (ACO), and I would like to write some unit tests. However, I am not sure of the best way to test a method whose ability to return โ€œcorrectโ€ answers varies depending on various settings.

How one unit test heuristic algorithm?

The code lives on at https://github.com/rhgrant10/pants , by the way.

+3
source share
1 answer

I am testing my TSP implementation with this integration testing class , which performs 2 tests:

  • , 600 . 10 , - - . , , , . , (= smoke test) , , . , :)
  • assertionMode (FAST_ASSERT) , , 600 . assertionMode Solver ( ). (= -) ..

, , , , , this unit test .

+1

All Articles