Greedy by value density animated: take the densest items whole, split the last one — and see exactly why splitting is what makes greedy optimal here.
Tip: use samples, upload, copy, download, and send-to actions inside the workspace where available.
Fractional Knapsack Visualizer is a free, browser-based tool that helps you turn raw numbers into clear charts. Greedy by value density animated: take the densest items whole, split the last one — and see exactly why splitting is what makes greedy optimal here. It's built for speed and privacy: Everything runs locally in your browser — your data is never uploaded to a server. No sign-up, no installs, and no daily limits.
Visualize the dataset after it has been cleaned enough for reliable labels and numeric values.
Review the preview, copy or download the result, and keep everything local in your browser.
0/1 Knapsack Visualizer: The 0/1 knapsack DP table animated cell by cell: skip-or-take decisions with the exact cells each value reads from, ending at the optimal bottom-right answer.
Open toolActivity Selection Visualizer: The classic greedy scheduling problem animated: sort by finish time, sweep, and select every compatible activity — with the exchange-argument intuition.
Open toolAlgorithm Academy: 35+ classic algorithms animated step by step — searching, counting/radix/bucket sort, dynamic programming tables, greedy, backtracking, KMP, graph algorithms, max flow, and convex hull — with auto-play, next/prev stepping, adjustable interval, and pseudocode that highlights the running line.
Open tool1Fractional knapsack, capacity 40kg. GREEDY KEY: sort by value density ($/kg) — because items can be split, taking the densest first is optimal.
sort by value/weight descfor each item:if it fits: take allelse:take the fitting fraction; stopreturn total value
Items can be split → take by value density. Splitting is exactly what makes greedy safe (contrast 0/1 knapsack).