Class Knapsack01Test
java.lang.Object
topics.greedy.knapsack.Knapsack01Test
Validation Suite for 0/1 Knapsack (Greedy Trap)
These tests explicitly expect the algorithm to fail to find the global optimum, proving the necessity of Dynamic Programming for this specific problem domain.
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidsetup()(package private) void(package private) void
-
Constructor Details
-
Knapsack01Test
Knapsack01Test()
-
-
Method Details
-
setup
@BeforeAll static void setup() -
shouldDemonstrateGreedyTrap1
@Test @DisplayName("Should trap itself on simple bounds (Sub-optimal solution #1)") void shouldDemonstrateGreedyTrap1() -
shouldDemonstrateGreedyTrap2
@Test @DisplayName("Should trap itself on complex bounds (Sub-optimal solution #2)") void shouldDemonstrateGreedyTrap2()
-