https://github.com/joeesmithh/graphs
A modular graph library written in C++ with adjacency list/matrix representation, traversal algorithms, and a driver—used to validate shortest-path and connectivity algorithms.
https://github.com/joeesmithh/graphs
cpp data-structures-and-algorithms gui qt
Last synced: 2 months ago
JSON representation
A modular graph library written in C++ with adjacency list/matrix representation, traversal algorithms, and a driver—used to validate shortest-path and connectivity algorithms.
- Host: GitHub
- URL: https://github.com/joeesmithh/graphs
- Owner: joeesmithh
- Created: 2025-09-05T23:00:08.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-13T08:37:24.000Z (10 months ago)
- Last Synced: 2025-09-13T10:45:38.687Z (10 months ago)
- Topics: cpp, data-structures-and-algorithms, gui, qt
- Language: C++
- Homepage:
- Size: 958 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Graph Visualizer
A C++/Qt application for creating, visualizing, and interacting with graphs.
This project implements graph data structures (adjacency list and adjacency matrix) with a unified interface, and provides a GUI for building and traversing graphs in real-time.
## Features
- **Graph Implementations**
- `ListGraph`: Directed, weighted adjacency list representation.
- `MatrixGraph`: Directed, weighted adjacency matrix representation.
- `GraphInterface`: Abstract interface ensuring consistent operations across implementations.
- **GUI (Qt-based)**
- Create and connect vertices interactively.
- Real-time graph visualization using `QGraphicsView`.
- Menu-driven controls for adding vertices and traversals.
- **Core Functionality**
- Add vertices and edges dynamically.
- Track number of vertices and edges.
- Traversal support with reset mechanisms.
## Demo
Vertex Creation
Depth-First Traversal
## Project Structure
- `GraphInterface.h` – Abstract class defining graph operations
- `MatrixGraph.h / .cpp` – Adjacency matrix graph implementation
- `ListGraph.h / .cpp` – Adjacency list graph implementation
- `GraphVertex.h / .cpp` - Data container managed by ListGraph
- `GUIGraph.h / .cpp` – Graph GUI integration using Qt
- `GUIVertex.h / .cpp` – Vertex GUI integration using Qt
- `main_window.*` – Main application window setup
- `create_vertex_dialog.*` – Dialog for adding vertices
## Future Improvements
- Add breadth-first and depth-first traversal visualization.
- Support for weighted edge editing via GUI.
- Export/import graphs to file formats (JSON, CSV).
## Getting Started
### Prerequisites
- **C++17 or later**
- **Qt 5 or 6** development libraries
- **Qt VS Tools** extension
### Build Instructions
```bash
# Clone the repository
git clone https://github.com/joeesmithh/graphs.git
```
- Open `graphs.sln`
- **Qt Project Settings**
- Specify **Qt Installation**
- Specify **Qt Modules**, `core;gui;widgets`