Skip to content

[Feature]: Job Sequencing with Deadlines Visualizer for Greedy Algorithms #681

@khushalkks

Description

@khushalkks

Problem or limitation
urrently, the Greedy Algorithms section is limited to Huffman Coding and the Fractional Knapsack problem. While these are great starting points, they do not cover the concept of scheduling and timeline slots (Gantt Chart tracking), which is a key concept in computer science curriculum and greedy optimization.

It is difficult to understand how time-slots are greedily searched backwards from a job's deadline without an interactive visual walkthrough showing which jobs get packed and which ones are skipped due to expired deadlines.

Proposed solution
AlgoScope should support an interactive visualizer for Job Sequencing with Deadlines.

The visualization will feature:

Interactive Job Directory: A card deck of jobs showing their IDs, profits, and deadlines.
Gantt Chart Time-Slot Grid: A timeline showing available time slots (e.g., [0-1], [1-2], [2-3], etc.).
Step-by-step Greedy Search Animation:
Sorting jobs in descending order of their profit.
For each job, searching backwards from its deadline to find the first available free time slot.
Visual transitions showing jobs sliding into time-slots, or getting highlighted as "expired/skipped" if no slots are free.
Live Metrics Panel: Displaying accumulated total profit, scheduled jobs, and missed jobs in real-time.

Alternatives considered
Scheduling algorithms in Operating Systems section: Although AlgoScope has CPU Scheduling visualizers (FCFS, SJF, etc.), those focus on operating system resource allocation policies, whereas Job Sequencing is a pure greedy optimization problem focused on maximizing profit under hard deadline constraints. Keeping it in the Greedy Algorithms section makes the most pedagogical sense.

Use case
This would help when students and programmers are studying Greedy optimization strategies.

Specifically, it clarifies:

Why jobs must be sorted by profit first.
How the algorithm searches from deadline backwards to 0 to allocate a slot, maximizing the chance of scheduling earlier jobs.
The concept of Gantt Chart scheduling in greedy strategies.

Additional context
Example Inputs:
json
[
{ "id": "J1", "deadline": 2, "profit": 100 },
{ "id": "J2", "deadline": 1, "profit": 19 },
{ "id": "J3", "deadline": 2, "profit": 27 },
{ "id": "J4", "deadline": 1, "profit": 25 },
{ "id": "J5", "deadline": 3, "profit": 15 }
]
Expected Result: Jobs scheduled: J3 in slot [0-1], J1 in slot [1-2], J5 in slot [2-3]. Total profit: 27 + 100 + 15 = 142. J2 and J4 are skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions