Class Knapsack01Test
java.lang.Object
topics.dynamic.knapsack.Knapsack01Test
Validation Suite for 0/1 Knapsack
Ensures the Dynamic Programming algorithm correctly identifies the mathematical maximum values without fractional breaking.
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidsetup()(package private) void(package private) void(package private) void(package private) void(package private) void
-
Constructor Details
-
Knapsack01Test
Knapsack01Test()
-
-
Method Details
-
setup
@BeforeAll static void setup() -
shouldFindOptimalValueWhenGreedyFails
@Test @DisplayName("Case 1: Standard bounds where Greedy fails") void shouldFindOptimalValueWhenGreedyFails() -
shouldHandleHeavyCapacityWithVariedSpread
@Test @DisplayName("Case 2: Heavy capacity with varied item spread") void shouldHandleHeavyCapacityWithVariedSpread() -
shouldHandleSmallCapacityWithCompetitiveItems
@Test @DisplayName("Case 3: Small capacity, highly competitive items") void shouldHandleSmallCapacityWithCompetitiveItems() -
shouldHandleExactFitBoundaries
@Test @DisplayName("Case 4: Exact fit boundaries") void shouldHandleExactFitBoundaries() -
shouldHandleFractionalBenefitValues
@Test @DisplayName("Case 5: Fractional benefit values") void shouldHandleFractionalBenefitValues()
-