Skip to content

Commit 00bdef8

Browse files
bellman-ford algo
1 parent adb3ef3 commit 00bdef8

File tree

6 files changed

+6
-87
lines changed

6 files changed

+6
-87
lines changed

public/graph.png

4.99 KB
Loading

src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
3-
import UnionFindPage from "../src/pages/graph/UnionFind.jsx"; // ✅ Import Union-Find Page
3+
// import UnionFindPage from "../src/pages/graph/UnionFind.jsx"; // ✅ Import Union-Find Page
44
import SortingPage from "./pages/sorting/SortingPage";
55
import GraphPage from "./pages/graph/GraphPage";
66
import Homepage from "./pages/Homepage.jsx";
@@ -10,7 +10,7 @@ function App() {
1010
<Router>
1111
<Routes>
1212
<Route path="/" element={<Homepage />} />
13-
<Route path="/graph/union-find" element={<UnionFindPage />} /> {/* ✅ Added route */}
13+
{/* <Route path="/graph/union-find" element={<UnionFindPage />} /> */}
1414
<Route path="/sorting" element={<SortingPage />} />
1515
<Route path="/graph" element={<GraphPage />} />
1616
</Routes>

src/components/graph/GraphVisualizer.jsx renamed to src/components/graph/BellmanFordGraph.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState, useEffect, useMemo } from "react";
22

3-
export default function GraphVisualizer({ nodes = [], edges = [], distances = {}, highlight = {} }) {
3+
export default function BellmanFordGraph({ nodes = [], edges = [], distances = {}, highlight = {} }) {
44
const [positions, setPositions] = useState({});
55

66
// Arrange nodes in a circle when nodes change

src/components/graph/BellmanFordVisualizer.jsx

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/pages/Homepage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const sections = [
3636
description:
3737
"Explore BFS, DFS, Kruskal’s, Prim’s, and now Union-Find — all brought to life interactively.",
3838
phase: "Phase 2",
39-
img: "",
39+
img: "/graph.png",
4040
link: "/graph",
4141
flag: false
4242
},

src/pages/graph/BellmanFord.jsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState } from "react";
22
import { Toaster, toast } from "react-hot-toast";
3-
import BellmanFordVisualizer from "../../components/graph/BellmanFordVisualizer";
4-
import GraphVisualizer from "../../components/graph/GraphVisualizer";
3+
import BellmanFordGraph from "../../components/graph/BellmanFordGraph";
54

65
// Bellman-Ford generator function
76
function* bellmanFord(nodes, edges, source) {
@@ -237,13 +236,7 @@ export default function BellmanFord() {
237236
</div>
238237
)}
239238

240-
{/* <BellmanFordVisualizer
241-
nodes={nodes}
242-
edges={edges}
243-
distances={distances}
244-
highlight={highlight}
245-
/> */}
246-
<GraphVisualizer
239+
<BellmanFordGraph
247240
nodes={nodes}
248241
edges={edges}
249242
distances={distances}

0 commit comments

Comments
 (0)