Please help me with these C++ program questions

Write C++ program to create directed-weighted-graph data structure using adjacency list (use link-list). Insert 1000 vertexes, use random function to insert edge direction and weight.
a. Case-A: Sparse graph, insert 200 x 200 weighted edges
b. Case-B: Dense Graph, insert 700 x 700 weighted edges
c. Case-C: Complete graph, insert 1000 x 1000 weighted edges
d. Test each Case- A, B, and C by counting the total number of edges, and print the correct total edges from above cases, separately.

  1. To extend above Task 2, write C++ program (functions) for graph shortest path algorithms. Implement Dijkstra and Bellman–Ford algorithms. Do comparative analysis of both algorithms by using Task 2.
    a. For analysis of each Case- A, B, and C, you need to compute the total time (seconds) consumed by each algorithm. Use time.h to calculate the time.
    b. In each Case- A, B, and C, search all possible paths for each vertex to all other vertexes from graph.
    c. You should compare both algorithms for each Case- A, B, and C, separately.

hi @xy_06
I can give you some hints. Please try yourself first then we will check your code, if not working.

First thing is: When to use adjacency list & when to use adjacency matrix. The thing is when you have a complete graph(Case C) adjacency matrix representation is better. For other two cases, adjacency list representation is of course better. Can you tell me why?

Please follow our graph tutorials as well to learn graph. Please reply back to this thread.