Class Knapsack01Test

java.lang.Object
topics.greedy.knapsack.Knapsack01Test

@DisplayName("0/1 Knapsack - Greedy Trap Demonstrations") class Knapsack01Test extends Object

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 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()