An open API service indexing awesome lists of open source software.

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.

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`