(Solved) : 10 6 Marks Write Program Read Adjacency Matrices Two Graphs Time Graph Compute Degree Sequ Q33114913 . . .
10. [6 marks] Write a program to read in the adjacency matrices for two graphs at a time. For each graph compute the degree sequences (in ascending order) and report whether or not they are the same. If they are not the same, then the graphs are not isomorphic. If they are the same, then further testing would be required to know whether or not they are isomorphic. The input for each graph starts with an integer n 20 (the number of vertices), followed by the n x n adjacency matrix. For example: 0 1 0 0 10 0 1 0 0 0 1 0 1 1 0 The input file input-graphs.txt (download from content+assignments) contains 10 graphs. Output results for the first two graphs, then the next two, the next two, and so on. Thus, there are 5 pairs of graphs to compare. For each pair, provide the sorted degree sequences followed by a comment on whether or not they are the same. Also, hand in your code and comment on correctness. Sample output for the first pair of graphs: Degree seq for G1: 2 33 3 3 3 3 3 4478 Degree seq for G2: 3 3 3 3 3 3 3 3 55 6 8 The graphs do NOT have the same degree sequence Discrete math Show transcribed image text
Expert Answer
Answer to 10 6 Marks Write Program Read Adjacency Matrices Two Graphs Time Graph Compute Degree Sequ Q33114913 . . .
OR