Generate a graph by forming an adjacency matrix with random numbers. The
graph will have 10 nodes. The connections will be generated randomly with
the following rules.
• Each pair may have a connection with 60% probability. It means that
the connection weight for a node pair will be 0 with 40% probability.
• If a pair has a connection, the connection weight will be drawn from a
uniform distribution in the range 1 to 10. Connection weights will be
positive integer values.
• The graph is directed. Some connections may be one way and some
connections can be bidirectional.
• Each node will have a letter as label, such as 'A', 'B', 'C'
After creating the graph, implement the following functions:
• A function to generate adjacency list from the generated graph
• A function to check if the graph is connected
• If it is not connected, a function to return number of clusters (disjoint
subgraphs) with number of nodes in each cluster
• A function to return breadth-first listing of each cluster. (It will return
label list in the order of breadth-first)
• A function to return depth-first listing of each cluster
• A function to compute minimum-spanning tree for each cluster
• A function to return list of shortest path from a user given node name to
all nodes in a the cluster that node is located.

This looks like work or a class assignment. Is the graph graphical? If so, what libraries are used and on which OS as that can be an issue.

Let's skip all the part about where dumping assignments and all that and have you share more detail about where you are stuck.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.