This program allows you to visualize various graph search algorithms by interactively creating and manipulating a graph. You can add and remove nodes, add weighted edges, and run different algorithms on the graph.
Uninformed search algorithms
- BFS - Breadth-first search
- DFS - Depth-first search
- UCS - form Cost Search -
- ITS - Iterative-deepening Search
- DLS - Depth-Limited Search
Informed search algorithms
- Greedy
- A*
- Clone the repository to your local machine.
- Make sure you have Python and Pygame installed.
- Run the code using a Python IDE or from the command line.
- Upon launching the program, a window will appear where you can draw your graph.
- To add a node, left-click anywhere on the canvas. To remove a node, right-click on an existing node.
- You can add weighted edges by left-clicking on one node and dragging the mouse to another node. Release the mouse button to create the edge.
- The panel on the right side of the window provides various buttons and options:
- Directed: Toggle the directed/undirected property of the graph.
- Clear: Clear the entire graph.
- BFS: Run the Breadth-First Search algorithm on the graph.
- UCS: Run the Uniform Cost Search algorithm on the graph.
- DFS: Run the Depth-First Search algorithm on the graph.
- ITD: Run the Iterative Deepening algorithm on the graph. You can input the maximum depth in the console.
- DLS: Run the Depth-Limited Search algorithm on the graph. You can input the maximum depth in the console.
- GRY: Run the Greedy Best-First Search algorithm on the graph.
- AST: Run the A* Search algorithm on the graph.
- Speed: Adjust the speed of the algorithm visualization.
- Show H: Toggle the display of node heuristics.
- Show C: Toggle the display of edge costs.
- Follow the on-screen instructions and interact with the buttons and graph to visualize the selected algorithms.
- Left-click to add nodes, right-click to remove nodes.
- Left-click and drag to add weighted edges.
- Use the buttons on the panel to select and run different algorithms.
- Adjust the speed and toggle the display options as needed.
Contributions to this project are welcome. If you find any issues or have suggestions for improvement, please feel free to submit a pull request.
Under supervision of Dr. Ammar Mohammed, Professor of Artificial Intelligence, FGSSR, Cairo University