Skip to content

Conversation

@SUJALGOYALL
Copy link
Contributor

Prim’s Minimum Spanning Tree Visualizer — Frontier and Visited Panels

Description

This pull request introduces a complete Prim’s Minimum Spanning Tree (MST) Visualizer to the Graph Algorithms module.

Key Features Added

  • Interactive graph building:
    • Double-click to add nodes
    • Click two nodes to add weighted edges
  • Start Node Selector for Prim’s algorithm
  • Step-by-step visualization using a generator-based animation flow
  • Real-time UI panels:
    • ✅ Visited Nodes Panel
    • ✅ Frontier (Min-Edge Priority Queue) Panel
  • Edge color transitions:
    • Blue → considering
    • Green → added to MST
    • Red → skipped (cycle prevention)
  • Status indicator + step counter
  • Reset option to clear the canvas
  • Styling and behavior fully match the existing Kruskal / BFS / DFS visualizers

This implementation follows the existing project architecture (/algorithms/graph, /components/graph, /pages/graph) and integrates seamlessly within GraphPage.jsx through the dropdown-based algorithm selector.

Screenshot 2025-11-08 154314

Semver Changes

  • Patch (bug fix, no new features)
  • Minor (new features, no breaking changes)
  • Major (breaking changes)

Issues

This PR closes the feature request for:
Prim’s Minimum Spanning Tree Visualizer

Closes #83


Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add Prim’s Minimum Spanning Tree (MST) Visualizer

2 participants