Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Module 4.1 Guided Assignment 2: Graph Processing Code 2. Graph Processing Code Read the textbook section Undirected graph data type - API (pg 522) Typical
Module 4.1 Guided Assignment 2: Graph Processing Code
2. Graph Processing Code
- Read the textbook section
- Undirected graph data type - API (pg 522)
- Typical graph processing code (pg 525-527)
- Operations (pg 527)
- Implement the following methods
- Compute the degree of a vertex (0.1)
- Compute the maximum degree in the graph (0.1)
- Compute the minimum degree in the graph (0.1)
- Compute the average degree in the graph (0.1)
- Count the number of self-loops (0.1)
- Count the number of parallel vertices(0.1)
- Add a vertex (0.1)
- Delete a vertex (0.1)
- Delete an edge (0.1)
- Check whether the graph contains the edge v-w (0.1)
- Implement TestGraphOperationsclass that will read the description of a graph and print the detailed description (each tested method 0.1)
- Test with tinyG.txt; mediumG.txt; largeG.txt; and random operations for each
- Start by printing the graph (if the number of verticesis less than 20)
- Apply all the counting operations on each graph
- For each graph add 10 vertices, print the graphif the number of verticesis less than 30and then delete the 10 verticesin the order they were added
- For each graph add 10random edges, print the graphif the number of verticesis less than 30,and then delete the 10edgesin the order they were added
- For each graph test if they contain 10 randomly generated edges. Print the results.
Page 525:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started