A C++ implementation of a weighted graph class using an adjacency matrix representation.
This repository contains a C++ implementation of a weighted graph class. Weighted graphs are graphs in which each edge has an associated numerical value called weight. The class provides functionality for managing vertices and edges, calculating distances between vertices, and printing the graph's adjacency matrix.
- Vertex and Edge Management: Insert and manage vertices and edges.
- Distance Calculation: Calculate the shortest distance between two vertices using Dijkstra's algorithm.
- Graph Representation: Visualize the graph's adjacency matrix.
- Robust Error Handling: Throw exceptions for invalid operations or out-of-bounds vertex indices.
- Include the
weighted_graph.h
header file in your C++ project - Use skeleton files to test.
- Initialization: Create a
Weighted_graph
object. - Vertex and Edge Operations: Insert vertices and edges using the
insert
method. - Graph Queries: Retrieve information about vertices, edges, and distances using appropriate methods.
- Printing: Print the adjacency matrix of the graph using the
operator<<
overload.
- Weighted_graph.h: Header file for the weighted graph class implementation.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
For more information or inquiries, contact: