A Python application that allows users to create, edit, and visualize graphs using depth-first search (DFS) and breadth-first search (BFS) algorithms. The application uses Tkinter for the graphical user interface.
- Create a graph by adding nodes and edges
- Toggle nodes on and off (useful for testing algorithms)
- Set a starting node for the search algorithms
- Visualize the search algorithms (DFS and BFS) in real-time
- Clear the graph to start over
- Python 3.x
- Clone the repository or download the source code:
git clone https://github.com/yourusername/graph-visualizer.git
- Change into the project directory:
cd graph-visualizer
To run the application, execute the following command from the project directory:
python main.py
The Graph Visualizer window will open. You can interact with the application using your mouse and keyboard.
- Click on a node to toggle it on (white) or off (black).
- Drag from one node to another to create an edge.
- Press 's' while hovering over a node to set it as the starting node (orange).
- Select the desired algorithm (DFS or BFS) from the dropdown menu in the control panel.
- Click the "Start" button to begin the visualization. The nodes visited by the algorithm will turn blue in the order they are visited.
- Click the "Clear" button in the control panel to reset the graph.
Please feel free to submit issues and pull requests for new features, bug fixes, or other improvements.
This project is licensed under the MIT License.
- Tkinter for providing the graphical user interface