Lab
Graph
Prelab Task:
1. Understand what we learned about graph (i.e. graph creation and graph operations) and read the related book materials
2. Read and understand "d_graph.h"
3. Create a data file named graphA.dat for the graph A. The format of the data file is given in graph.dat, where m is the number of vertices in graph, n is number of edges, weight_i is the weight of edge from source_i to destination_i . You will use the data file you created for graph A in this lab.
Lab Task:
In this lab, you will create a data file for a graph and carry out common graph operations on it.
Copy "d_graph.h", "d_galgs.h", and "d_util.h" into your working directory. These files may be used in your program
Write your program in a file named lab_09.cpp. Your program will first input the data file for the graph A, and then carry out the following tasks:
Insert an edge from F to D with weight 1
Delete vertex B
Erase the edge (A,D)
Prompt the user to input a vertex, and list all the neighbors of the vertex
Insert the new vertex G
Add the following edges with weight 1: (G,C), (G,F), (D,G).
Output the graph using the operator <<