Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Projeet 10: Degree Distribution of the Vertices in a Graph Due: April 18; 11.59 PM You are given the code of graph implementation in which

image text in transcribed

Projeet 10: Degree Distribution of the Vertices in a Graph Due: April 18; 11.59 PM You are given the code of graph implementation in which the information of the neighbors of the nodes (i.e., the adjacency list) is stored as an array of linked lists. The code for the List class, implemented as a Singly Linked List, is also given. Note that the implementation assumes the vertices are labeled from 0 to N-1, where N is the number of vertices in the graph. Your tasks in this project are to: 0) add member functions to the List class and the Graph class so that we could find the degree (the number of neighbors) for any node in the graph (ii) after implementing the required member functions, add code in the main function to print the degrees of the vertices in the graph as well as compute and print the probability of finding vertices with a certain degree (ranging from I to N-I, where N is t graph based on these probabilities (computed as the weighted average of the number of vertices with the possible degree values, as shown in the slides). he number of vertices in the graph) and the average degree of the vertices in the given Test your code with a connected graph of 10 vertices or more such that the degree of any vertex is at least 1 and is at most N-1 (where N is the number of vertices in the graph). edgel ist is passed as input to your program. The edges of a graph (edgel ist) are stored as an ordered ces with the ID of the first vertex in the pair being always less than the ID of the second vertex in the pair. For example, the edgel ist for the graph below is shown alongside 0 2 3 5 0 3: 4 3 5 4 5 4 6 5 6 2 4 6 A sample screenshot of the output for the above 7-vertex graph is shown below. Your code should generate a similar output for your test graph of 10 or more vertices. Projeet 10: Degree Distribution of the Vertices in a Graph Due: April 18; 11.59 PM You are given the code of graph implementation in which the information of the neighbors of the nodes (i.e., the adjacency list) is stored as an array of linked lists. The code for the List class, implemented as a Singly Linked List, is also given. Note that the implementation assumes the vertices are labeled from 0 to N-1, where N is the number of vertices in the graph. Your tasks in this project are to: 0) add member functions to the List class and the Graph class so that we could find the degree (the number of neighbors) for any node in the graph (ii) after implementing the required member functions, add code in the main function to print the degrees of the vertices in the graph as well as compute and print the probability of finding vertices with a certain degree (ranging from I to N-I, where N is t graph based on these probabilities (computed as the weighted average of the number of vertices with the possible degree values, as shown in the slides). he number of vertices in the graph) and the average degree of the vertices in the given Test your code with a connected graph of 10 vertices or more such that the degree of any vertex is at least 1 and is at most N-1 (where N is the number of vertices in the graph). edgel ist is passed as input to your program. The edges of a graph (edgel ist) are stored as an ordered ces with the ID of the first vertex in the pair being always less than the ID of the second vertex in the pair. For example, the edgel ist for the graph below is shown alongside 0 2 3 5 0 3: 4 3 5 4 5 4 6 5 6 2 4 6 A sample screenshot of the output for the above 7-vertex graph is shown below. Your code should generate a similar output for your test graph of 10 or more vertices

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions