Repository navigation
[34/N] Add unit tests for Graph, BFS, DFS, Dijkstras, Prims, Kruskals, Floyd, CreateGraph, and LVA algorithms - #125
Open
karkir0003 wants to merge 34 commits into
Conversation
…de, and AnimatedCircularlyLinkedListNode
…ttern matching algorithms
…Sort, MergeSort, Quicksort, Quickselect, and HeapSort algorithms
… MiracleSort, and SleepSort algorithms
…, CreateGraph, and LVA algorithms
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack
Addresses #93
Context
Adds comprehensive unit test coverage for graph algorithm visualizers and graph management components:
Graph.js: Core base class for all graph algorithm visualizers managing logical representation, adjacency list, and adjacency matrix view layers, directed/undirected modes, and small (8 nodes) vs large (18 nodes) graph layouts.BFS.js: Breadth-First Search traversal with start vertex validation, FIFO queue animation, and visited set updates.DFS.js: Depth-First Search supporting both recursive call stack visualization and iterative explicit stack traversal modes.Dijkstras.js: Dijkstra's single-source shortest path algorithm utilizingPriorityQueue, dynamic distance map table entries, and shortest path tree construction.Prims.js: Prim's Minimum Spanning Tree algorithm tracking visited cut partitions, priority queue edges, and highlighted MST edge formatting.Kruskals.js: Kruskal's Minimum Spanning Tree algorithm using Disjoint Sets data structures (setData), edge weight sorting, and cycle detection.Floyd.js: Floyd-Warshall all-pairs shortest paths algorithm computing 2D cost and path tables via dynamic programming relaxation passes.CreateGraph.js: Interactive graph designer with textarea adjacency list parser, live character sanitization, and matrix reconstruction.LVA.js: Lowest Value Adjacent tree visualizer with insert, delete, find, print traversals, and Left-LVA / Right-LVA rotational balancing.Changes Made
src/algo/__tests__/Graph.test.js:src/algo/__tests__/BFS.test.js:src/algo/__tests__/DFS.test.js:stackCallback).doDFSRecursiveanddoDFSStack.src/algo/__tests__/Dijkstras.test.js:src/algo/__tests__/Prims.test.js:src/algo/__tests__/Kruskals.test.js:src/algo/__tests__/Floyd.test.js:src/algo/__tests__/CreateGraph.test.js:src/algo/__tests__/LVA.test.js:Test Plan
npm test -- --watchAll=false(all 9 new test suites pass, 55 unit tests passing; 84 suites, 886 tests passing repository-wide).npm run lintandnpm run prettier(0 errors, 0 warnings).