Skip to content

ashna-agarwal/LCS_Visualiser-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LCS Visualizer

An interactive web application for visualizing the Longest Common Subsequence (LCS) algorithm using Dynamic Programming.

The project helps students understand how the DP table is constructed, how decisions are made during computation, and how the final subsequence is derived through backtracking.


Features

Algorithm Visualization

  • Dynamic Programming matrix generation in real time
  • Step-by-step table filling animation
  • Directional indicators (↖ ↑ ←) showing transition choices
  • Animated LCS backtracking path visualization
  • Final subsequence reconstruction

Interactive Controls

  • Play / Pause execution
  • Step Forward navigation
  • Adjustable animation speed
  • Progress tracking during execution
  • Reset and restart functionality

Learning Experience

  • Pseudocode synchronized with execution
  • Visual explanation of DP state transitions
  • Educational tooltips for algorithm concepts
  • Beginner-friendly interface for understanding Dynamic Programming

UI & Accessibility

  • Responsive design
  • Dark / Light mode support
  • Keyboard-accessible controls
  • Color-blind-friendly palette
  • Smooth animations powered by Framer Motion

Tech Stack

Technology Purpose
React Frontend Framework
Vite Build Tool
Tailwind CSS Styling
Framer Motion Animations
Lucide React Icons

How the Algorithm Works

Given two strings:

String 1: ABCBDAB
String 2: BDCABA

The application:

  1. Builds the Dynamic Programming table.
  2. Computes LCS lengths for every state.
  3. Highlights matching characters.
  4. Shows transitions between states.
  5. Performs backtracking.
  6. Displays the final Longest Common Subsequence.

Installation

Clone the repository:

git clone https://github.com/ashna-agarwal/LCS_Visualiser-.git

Navigate into the project:

cd LCS_Visualiser-

Install dependencies:

npm install

Run locally:

npm run dev

Open the generated localhost URL in your browser.


Learning Outcomes

This project demonstrates:

  • Dynamic Programming
  • Algorithm Visualization
  • State Transition Analysis
  • Frontend Development with React
  • Animation Design
  • Educational Software Development

Future Enhancements

  • Multiple DP algorithm visualizations
  • Complexity analysis panel
  • Interactive quiz mode
  • Export DP table as image
  • Mobile-first optimization
  • Algorithm comparison mode

Author

Ashna Agarwal

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors