Skip to content

Rushithadatta/dynamic_programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Study Planner โ€“ Dynamic Programming Optimizer

A web-based study planner that uses Dynamic Programming (0/1 Knapsack) to optimize a studentโ€™s study schedule for maximum exam marks under limited study hours.


๐Ÿš€ Demo

Link: https://dynamic-program.vercel.app/

Features:

  • Add topics with time required and expected marks
  • Set study constraints (days & hours/day)
  • Click Optimize Study Plan to get:
    • Maximum achievable marks
    • Topics to focus on
    • Hours used
  • DP Table Visualization showing step-by-step computation

๐Ÿ’ก Problem Statement

Students often struggle to decide what topics to focus on when time is limited.
This project models the problem as a 0/1 Knapsack problem:

  • Capacity: Total available study hours
  • Items: Syllabus topics
  • Weight: Time required per topic
  • Value: Expected marks per topic

The goal is to maximize marks without exceeding available hours.


๐Ÿ›  Tech Stack

  • Frontend: React + Vite
  • Styling: Tailwind CSS
  • Logic: JavaScript (Dynamic Programming)
  • No database required (state is in-memory)

โš™๏ธ Features

  1. Topic Input
    • Name, Time required (hours), Expected Marks
  2. Constraints Input
    • Days before exam, Hours per day
  3. Optimization
    • Computes maximum marks using 0/1 Knapsack DP
    • Shows selected topics for focus
  4. DP Table Visualization
    • Step-by-step DP array evolution after each topic

๐Ÿงฉ How It Works (DP Logic)

  1. Create a 1D DP array:
dp[t] = maximum marks achievable using t hours
Iterate through topics:

for each topic:
    for t = totalHours down to topic.time:
        dp[t] = max(dp[t], dp[t-topic.time] + topic.marks)


Track which topics are selected (backtracking using choice array)

Display results and DP table in UI

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published